All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
demangle.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_ARCH_DEMANGLE_H
8#define PXR_BASE_ARCH_DEMANGLE_H
9
10#if !defined(__cplusplus)
11#error This include file can only be included in C++ programs.
12#endif
13
17
18#include "pxr/pxr.h"
19#include "pxr/base/arch/api.h"
20#include <string>
21#include <typeinfo>
22#include <typeindex>
23
24PXR_NAMESPACE_OPEN_SCOPE
25
28
38ARCH_API bool ArchDemangle(std::string* typeName);
39
46ARCH_API std::string
47ArchGetDemangled(const std::string& typeName);
48
53ARCH_API std::string
54ArchGetDemangled(const char *typeName);
55
62inline std::string
63ArchGetDemangled(const std::type_info& typeInfo) {
64 return ArchGetDemangled(typeInfo.name());
65}
66
73inline std::string
74ArchGetDemangled(const std::type_index& typeIndex) {
75 return ArchGetDemangled(typeIndex.name());
76}
77
84template <typename T>
85inline std::string
87 return ArchGetDemangled(typeid(T).name());
88}
89
91
93ARCH_API
94void Arch_DemangleFunctionName(std::string* functionName);
95
96PXR_NAMESPACE_CLOSE_SCOPE
97
98#endif // PXR_BASE_ARCH_DEMANGLE_H
std::string ArchGetDemangled()
Return demangled RTTI generated-type name.
Definition: demangle.h:86
ARCH_API bool ArchDemangle(std::string *typeName)
Demangle RTTI-generated type name.