28 lines
793 B
C++
28 lines
793 B
C++
/*
|
|
*******************************************************************************
|
|
* INCLUDE
|
|
*******************************************************************************
|
|
*/
|
|
#include "ClassAssistant.h"
|
|
|
|
namespace Util
|
|
{
|
|
/*
|
|
*******************************************************************************
|
|
* CLASS DEFINE
|
|
*******************************************************************************
|
|
*/
|
|
std::string Util::ClassAssistant::demangle(const std::type_info& ti)
|
|
{
|
|
int status;
|
|
char* demangled = abi::__cxa_demangle(ti.name(), nullptr, nullptr, &status);
|
|
if (status == 0)
|
|
{
|
|
std::string result(demangled);
|
|
free(demangled);
|
|
return result;
|
|
}
|
|
|
|
return ti.name();
|
|
}
|
|
}
|