static ArpString ArpDebugName(const char* mod) { ArpASSERT(mod != NULL); if( mod == NULL ) return ArpString(""); ArpString retName(mod); int length = retName.Length()+1; char* name = retName.LockBuffer(length); if( name ) { char* start = strrchr(name,'/'); if( !start ) start = name; else start++; char* end = strrchr(name,'.'); length = 0; while( *start && (end == 0 || start < end) ) { *name = *start; name++; start++; length++; } *name = 0; } retName.UnlockBuffer(length); return retName; }
/*! @internal */ inline std::string demangle(std::string mangledName) { int status = 0; char *demangledName = nullptr; std::size_t len; demangledName = abi::__cxa_demangle(mangledName.c_str(), 0, &len, &status); std::string retName(demangledName); free(demangledName); return retName; }