28 char const*
const commaSpace =
", ";
30 while ((index = demangledName.find(commaSpace)) != std::string::npos) {
31 demangledName.erase(index + 1, 1);
36 removeParameter(std::string& demangledName, std::string
const& toRemove) {
38 char const*
const delimiters =
"<>";
40 while ((index = demangledName.find(toRemove)) != std::string::npos) {
43 while ((inx = demangledName.find_first_of(delimiters, inx)) != std::string::npos) {
44 if (demangledName[inx] ==
'<') {
49 demangledName.erase(index, inx + 1 - index);
50 if (demangledName[index] ==
' ') {
51 demangledName.erase(index, 1);
62 constBeforeIdentifier(std::string& demangledName) {
63 std::string
const toBeMoved(
" const");
66 while ((index = demangledName.find(toBeMoved)) != std::string::npos) {
67 demangledName.erase(index, asize);
70 char const c = demangledName[inx];
73 }
else if (depth > 0) {
74 if (c ==
'<') --depth;
75 }
else if (c ==
'<' || c ==
',') {
76 demangledName.insert(inx + 1,
"const ");
88 size_t*
const nullSize = 0;
90 demangledName += abi::__cxa_demangle(name, null, nullSize, &status);
95 noSpaceAfterComma(demangledName);
97 std::string
const allocator(
",std::allocator<");
98 removeParameter(demangledName, allocator);
100 std::string
const comparator(
",std::less<");
101 removeParameter(demangledName, comparator);
103 constBeforeIdentifier(demangledName);
std::string demangledName(const std::type_info &typeInfo)
void typeDemangle(char const *mangledName, std::string &demangledName)