Pixar Arch
Loading...
Searching...
No Matches
demangle.h
Go to the documentation of this file.
1// Copyright 2016 Pixar
2//
3// Licensed under the terms set forth in the LICENSE.txt file available at
4// https://openusd.org/license.
5//
6// Modified by Jeremy Retailleau.
7
8#ifndef PXR_ARCH_DEMANGLE_H
9#define PXR_ARCH_DEMANGLE_H
10
11#if !defined(__cplusplus)
12#error This include file can only be included in C++ programs.
13#endif
14
17
18#include "./api.h"
19#include <string>
20#include <typeinfo>
21#include <typeindex>
22
23namespace pxr {
24
34ARCH_API bool ArchDemangle(std::string* typeName);
35
42ARCH_API std::string
43ArchGetDemangled(const std::string& typeName);
44
49ARCH_API std::string
50ArchGetDemangled(const char *typeName);
51
58inline std::string
59ArchGetDemangled(const std::type_info& typeInfo) {
60 return ArchGetDemangled(typeInfo.name());
61}
62
69inline std::string
70ArchGetDemangled(const std::type_index& typeIndex) {
71 return ArchGetDemangled(typeIndex.name());
72}
73
80template <typename T>
81inline std::string
83 return ArchGetDemangled(typeid(T).name());
84}
85
87ARCH_API
88void Arch_DemangleFunctionName(std::string* functionName);
89
90} // namespace pxr
91
92#endif // PXR_ARCH_DEMANGLE_H
ARCH_API bool ArchDemangle(std::string *typeName)
Demangle RTTI-generated type name.
std::string ArchGetDemangled()
Return demangled RTTI generated-type name.
Definition demangle.h:82