Of course it is not decoded by yourself, but some gods do this:
Http://hi.baidu.com/avengine/blog/item/9b7147a94c78c4fc1e17a2f7.html
And this
Http://sourceforge.net/projects/php-ms-demangle/
It is copied from wine.
This is to solve the problem that GCC typeinfo: name does not return the original name.
GCC output:
St6vectorisssaissee
STD: vector <STD: String, STD: Allocator <STD: String>
The typeinfo name of VC is after demangle, and the output is
Class STD: vector <class STD: basic_string <char, struct STD: char_traits <char>,
Class STD: Allocator <char>, class STD: Allocator <class STD: basic_string <char,
Struct STD: char_traits <char>, class STD: Allocator <char >>>
Class STD: vector <class STD: basic_string <char, struct STD: char_traits <char>,
Class STD: Allocator <char>, class STD: Allocator <class STD: basic_string <char,
Struct STD: char_traits <char>, class STD: Allocator <char >>>
# Include <typeinfo>
# Ifdef _ msc_ver
# Ifndef win32_lean_and_mean
# Define win32_lean_and_mean
# Endif
# Ifndef _ win32_winnt
# DEFINE _ win32_winnt 0x0501
# Endif
# Include <windows. h>
# Include <dbghelp. h>
STD: String cxxdemangle (const char * name)
{
Char buffer [1024];
DWORD length = undecoratesymbolname (name, buffer, sizeof (buffer), 0 );
If (length> 0)
Return STD: string (buffer, length );
Else
Return name;
}
# Pragma comment (Lib, "dbghelp ")
# Elif defined _ gnuc __
# Include <cxxabi. h>
STD: String cxxdemangle (const char * name)
{
Char buffer [1024];
Size_t size = sizeof (buffer );
Int status;
If (ABI ::__ cxa_demangle (name, buffer, & size, & Status ))
Return STD: string (buffer, size );
Else
Return name;
}
# Endif
# Include <vector>
# Include <stdio. h>
# Include <map>
# Include <set>
Int main ()
{
Const char * name = typeid (STD: vector <STD: String>). Name ();
Printf ("% s/n", name, cxxdemangle (name). c_str ());
}