X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FConsole%2FSTLSupport.ct;h=18af3dcda5ece37e972058531b28b3b7c327b3b6;hb=c5d0e492a701a054b1f3d56e128b2c4675b0d50b;hp=ca7f59949012cf9b439ba70cf98dba67b6ef3c88;hpb=7ff3c55db7420433cea0bd7f0fe6c82583f78d4f;p=senf.git diff --git a/Utils/Console/STLSupport.ct b/Utils/Console/STLSupport.ct index ca7f599..18af3dc 100644 --- a/Utils/Console/STLSupport.ct +++ b/Utils/Console/STLSupport.ct @@ -26,6 +26,7 @@ //#include "VectorSupport.ih" // Custom includes +#include #define prefix_ ///////////////////////////////ct.p//////////////////////////////////////// @@ -82,6 +83,42 @@ prefix_ void senf::console::SequenceReturnValueTraits::format(type con os << ")"; } +template +prefix_ void senf::console::ArgumentTraits< std::pair >:: +parse(ParseCommandInfo::TokensRange const & tokens, type & out) +{ + CheckedArgumentIteratorWrapper arg (tokens); + senf::console::parse( *(arg++), out.first ); + senf::console::parse( *(arg++), out.second ); +} + +template +prefix_ std::string senf::console::ArgumentTraits< std::pair >::description() +{ + return (boost::format("pair<%s,%s>") + % ArgumentTraits::description() + % ArgumentTraits::description()).str(); +} + +template +prefix_ std::string senf::console::ArgumentTraits< std::pair >::str(type const & value) +{ + std::stringstream ss; + senf::console::format(value, ss); + return ss.str(); +} + +template +prefix_ void senf::console::ReturnValueTraits< std::pair >::format(type const & value, + std::ostream & os) +{ + os << "("; + senf::console::format(value.first, os); + os << " "; + senf::console::format(value.second, os); + os << ")"; +} + #endif ///////////////////////////////ct.e////////////////////////////////////////