X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FTypeInfo.cc;h=a321163aba2c7d5c780d02d8e49276cce00a1a05;hb=93d9568d448749dc187e7622b733a4a3caa319df;hp=bed28764c3f9d6595abfd8297b278f063bfa45ea;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Utils/TypeInfo.cc b/senf/Utils/TypeInfo.cc index bed2876..a321163 100644 --- a/senf/Utils/TypeInfo.cc +++ b/senf/Utils/TypeInfo.cc @@ -32,7 +32,7 @@ //#include "TypeInfo.mpp" #define prefix_ -///////////////////////////////cc.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// prefix_ std::string senf::prettyName(std::type_info const & type) { @@ -45,7 +45,17 @@ prefix_ std::string senf::prettyName(std::type_info const & type) return name; } -///////////////////////////////cc.e//////////////////////////////////////// +prefix_ std::string senf::prettyBaseName(std::type_info const & type) +{ + std::string name (prettyName(type)); + std::string::size_type e (name.find('<')); + if (e == std::string::npos) e = name.size(); + std::string::size_type b (name.rfind(':', e)); + if (b == std::string::npos) b = 0; else ++b; + return name.substr(b,e-b); +} + +//-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ //#include "TypeInfo.mpp"