diff --git a/alib2str/src/core/stringApi.hpp b/alib2str/src/core/stringApi.hpp index b47b0c4abbb02e544ce576e94e5930e8a09e27c2..6e6113a8f34b98bc9b88b75c86a3390d2cdd16e8 100644 --- a/alib2str/src/core/stringApi.hpp +++ b/alib2str/src/core/stringApi.hpp @@ -75,8 +75,19 @@ private: public: template < class Type > - static void registerStringReader ( ) { - parseFunctions ( ).push_back ( std::make_pair ( stringApi < Type >::first, std::unique_ptr < GroupReader > ( new ReaderRegister < Type > ( ) ) ) ); + static void unregisterStringReader ( ext::list < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < GroupReader > > >::const_iterator iter ) { + parseFunctions ( ).erase ( iter ); + } + + template < class Type > + static ext::list < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < GroupReader > > >::const_iterator registerStringReader ( ) { + auto & entries = parseFunctions ( ); + return entries.insert ( entries.end ( ), std::make_pair ( stringApi < Type >::first, std::unique_ptr < GroupReader > ( new ReaderRegister < Type > ( ) ) ) ); + } + + template < class Type > + static void unregisterStringWriter ( ) { + composeFunctions ( ).erase ( ext::to_string < object::AnyObject < Type > > ( ) ); } template < class Type >