整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
28
util/ClassAssistant.cpp
Normal file
28
util/ClassAssistant.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue