X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FSTLSupport.ct;h=108b9744ec9258b80b6e03402491a002a58eb804;hb=3d7b1c7de10871dab0a8b64aa465b79abe8579c5;hp=569211e701692c65ce2b2a0b4a847b6a4ff23a96;hpb=411b898d78f6b51341b95448c9b73c0f8ad074aa;p=senf.git diff --git a/senf/Utils/Console/STLSupport.ct b/senf/Utils/Console/STLSupport.ct index 569211e..108b974 100644 --- a/senf/Utils/Console/STLSupport.ct +++ b/senf/Utils/Console/STLSupport.ct @@ -40,12 +40,7 @@ template prefix_ std::string senf::console::detail::CollectionArgumentTraitsBase::description() { - std::string type (prettyName(typeid(Collection))); - std::string::size_type e (type.find('<')); - if (e == std::string::npos) e = type.size(); - std::string::size_type b (type.rfind(':', e)); - if (b == std::string::npos) b = 0; else ++b; - return type.substr(b,e-b) + "<" + return senf::prettyBaseName(typeid(Collection)) + "<" + ArgumentTraits::description() + ">"; } @@ -87,7 +82,7 @@ senf::console::detail::CollectionReturnValueTraits::format(Collectio typename type::const_iterator const i_end (value.end()); if (i != i_end) for (;;) { - senf::console::format(*i, os); + os << senf::console::str(*i); if (++i == i_end) break; else @@ -120,12 +115,7 @@ parse(ParseCommandInfo::TokensRange const & tokens, Collection & out) template prefix_ std::string senf::console::detail::MapArgumentTraits::description() { - std::string type (prettyName(typeid(Collection))); - std::string::size_type e (type.find('<')); - if (e == std::string::npos) e = type.size(); - std::string::size_type b (type.rfind(':', e)); - if (b == std::string::npos) b = 0; else ++b; - return type.substr(b,e-b) + "<" + return senf::prettyBaseName(typeid(Collection)) + "<" + ArgumentTraits::description() + "," + ArgumentTraits::description() + ">"; } @@ -152,9 +142,9 @@ senf::console::detail::MapReturnValueTraits::format(Collection const typename type::const_iterator const i_end (value.end()); if (i != i_end) for (;;) { - senf::console::format(i->first, os); - os << "="; - senf::console::format(i->second, os); + os << senf::console::str(i->first) + << "=" + << senf::console::str(i->second); if (++i == i_end) break; else @@ -198,11 +188,8 @@ 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 << ")"; + os << "(" << senf::console::str(value.first) + << " " << senf::console::str(value.second) << ")"; } #endif