Add DemangleTypeName function
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#else
|
#else
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@@ -90,5 +91,15 @@ namespace OpenVulkano
|
|||||||
template Array<char> Utils::ReadFile<std::string>(const std::string& filePath, bool emptyOnMissing, bool nullTerminateString);
|
template Array<char> Utils::ReadFile<std::string>(const std::string& filePath, bool emptyOnMissing, bool nullTerminateString);
|
||||||
template Array<char> Utils::ReadFile<std::filesystem::path>(const std::filesystem::path& filePath,
|
template Array<char> Utils::ReadFile<std::filesystem::path>(const std::filesystem::path& filePath,
|
||||||
bool emptyOnMissing, bool nullTerminateString);
|
bool emptyOnMissing, bool nullTerminateString);
|
||||||
|
|
||||||
|
std::string Utils::DemangleTypeName(const char* name)
|
||||||
|
{
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
return name
|
||||||
|
#else
|
||||||
|
int status = 0;
|
||||||
|
std::unique_ptr<char, void(*)(void*)> res(abi::__cxa_demangle(name, NULL, NULL, &status), std::free);
|
||||||
|
return (status==0) ? res.get() : name ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,5 +196,7 @@ namespace OpenVulkano
|
|||||||
static const int id = uniqueTypeID++;
|
static const int id = uniqueTypeID++;
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string DemangleTypeName(const char* name);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user