File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed
include/behaviortree_cpp/utils Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
1
#ifndef DEMANGLE_UTIL_H
2
2
#define DEMANGLE_UTIL_H
3
3
4
+ #include < chrono>
4
5
#include < string>
5
6
#include < typeindex>
6
7
@@ -83,44 +84,39 @@ inline std::string demangle(const std::type_index& index)
83
84
{
84
85
return " std::string" ;
85
86
}
86
-
87
- scoped_demangled_name demangled_name (index.name ());
88
- char const * const p = demangled_name.get ();
89
- if (p)
87
+ if (index == typeid (std::string_view))
90
88
{
91
- return p ;
89
+ return " std::string_view " ;
92
90
}
93
- else
91
+ if (index == typeid (std::chrono::seconds))
94
92
{
95
- return index. name () ;
93
+ return " std::chrono::seconds " ;
96
94
}
97
- }
98
-
99
- inline std::string demangle (const std::type_info* info)
100
- {
101
- if (!info)
95
+ if (index == typeid (std::chrono::milliseconds))
102
96
{
103
- return " void " ;
97
+ return " std::chrono::milliseconds " ;
104
98
}
105
- if (info == & typeid (std::string ))
99
+ if (index == typeid (std::chrono::microseconds ))
106
100
{
107
- return " std::string " ;
101
+ return " std::chrono::microseconds " ;
108
102
}
109
- scoped_demangled_name demangled_name (info->name ());
103
+
104
+ scoped_demangled_name demangled_name (index.name ());
110
105
char const * const p = demangled_name.get ();
111
106
if (p)
112
107
{
113
108
return p;
114
109
}
115
110
else
116
111
{
117
- return info-> name ();
112
+ return index. name ();
118
113
}
119
114
}
120
115
116
+
121
117
inline std::string demangle (const std::type_info& info)
122
118
{
123
- return demangle (& info);
119
+ return demangle (std::type_index ( info) );
124
120
}
125
121
126
122
} // namespace BT
You can’t perform that action at this time.
0 commit comments