diff --git a/openVulkanoCpp/Base/Utils.cpp b/openVulkanoCpp/Base/Utils.cpp index f9bb154..e1bb9ea 100644 --- a/openVulkanoCpp/Base/Utils.cpp +++ b/openVulkanoCpp/Base/Utils.cpp @@ -10,6 +10,7 @@ #include #else #include + #include #endif #include #include @@ -90,5 +91,15 @@ namespace OpenVulkano template Array Utils::ReadFile(const std::string& filePath, bool emptyOnMissing, bool nullTerminateString); template Array Utils::ReadFile(const std::filesystem::path& filePath, bool emptyOnMissing, bool nullTerminateString); - + + std::string Utils::DemangleTypeName(const char* name) + { + #ifdef _MSC_VER + return name + #else + int status = 0; + std::unique_ptr res(abi::__cxa_demangle(name, NULL, NULL, &status), std::free); + return (status==0) ? res.get() : name ; + #endif + } } diff --git a/openVulkanoCpp/Base/Utils.hpp b/openVulkanoCpp/Base/Utils.hpp index 0999241..8782429 100644 --- a/openVulkanoCpp/Base/Utils.hpp +++ b/openVulkanoCpp/Base/Utils.hpp @@ -196,5 +196,7 @@ namespace OpenVulkano static const int id = uniqueTypeID++; return id; } + + static std::string DemangleTypeName(const char* name); }; }