Pixar Arch 0.25.8
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 "pxr/arch/pxr.h"
19#include "pxr/arch/api.h"
20#include <string>
21#include <typeinfo>
22#include <typeindex>
23
24ARCH_NAMESPACE_OPEN_SCOPE
25
35ARCH_API bool ArchDemangle(std::string* typeName);
36
43ARCH_API std::string
44ArchGetDemangled(const std::string& typeName);
45
50ARCH_API std::string
51ArchGetDemangled(const char *typeName);
52
59inline std::string
60ArchGetDemangled(const std::type_info& typeInfo) {
61 return ArchGetDemangled(typeInfo.name());
62}
63
70inline std::string
71ArchGetDemangled(const std::type_index& typeIndex) {
72 return ArchGetDemangled(typeIndex.name());
73}
74
81template <typename T>
82inline std::string
84 return ArchGetDemangled(typeid(T).name());
85}
86
88ARCH_API
89void Arch_DemangleFunctionName(std::string* functionName);
90
91ARCH_NAMESPACE_CLOSE_SCOPE
92
93#endif // PXR_ARCH_DEMANGLE_H
bool ArchDemangle(std::string *typeName)
Demangle RTTI-generated type name.
std::string ArchGetDemangled(const std::string &typeName)
Return demangled RTTI-generated type name.