X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FConsole%2FSTLSupport.hh;h=d4594888fa6cee6e328b63b033bc3c40b8a726d9;hb=bd9f9d3fd6fbcff0112a7bf48ab9284da9576b11;hp=68794836f2319034a8b5ad24b1dc9803a1eddda7;hpb=7ff3c55db7420433cea0bd7f0fe6c82583f78d4f;p=senf.git diff --git a/Utils/Console/STLSupport.hh b/Utils/Console/STLSupport.hh index 6879483..d459488 100644 --- a/Utils/Console/STLSupport.hh +++ b/Utils/Console/STLSupport.hh @@ -43,6 +43,7 @@ namespace console { struct SequenceArgumentTraits { typedef Sequence type; + static bool const singleToken = false; static void parse(ParseCommandInfo::TokensRange const & tokens, type & out); static std::string description(); @@ -77,6 +78,25 @@ namespace console { : public SequenceReturnValueTraits< std::list > {}; + template + struct ArgumentTraits< std::pair > + { + typedef std::pair type; + static bool const singleToken = false; + + static void parse(ParseCommandInfo::TokensRange const & tokens, type & out); + static std::string description(); + static std::string str(type const & value); + }; + + template + struct ReturnValueTraits< std::pair > + { + typedef std::pair type; + + static void format(type const & value, std::ostream & os); + }; + #endif }}