Menu

[r146]: / trunk / cppunit / src / cppunit / TypeInfoHelper.cpp  Maximize  Restore  History

Download this file

31 lines (20 with data), 633 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <cppunit/Portability.h>
#if CPPUNIT_USE_TYPEINFO_NAME
#include <string>
#include <cppunit/extensions/TypeInfoHelper.h>
namespace CppUnit {
std::string
TypeInfoHelper::getClassName( const std::type_info &info )
{
static std::string classPrefix( "class " );
std::string name( info.name() );
bool has_class_prefix = 0 ==
#if CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
name.compare( classPrefix, 0, classPrefix.length() );
#else
name.compare( 0, classPrefix.length(), classPrefix );
#endif
return has_class_prefix ? name.substr( classPrefix.length() ) : name;
}
} // namespace CppUnit
#endif
MongoDB Logo MongoDB