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 11#ifndef DEMANGLE_UTIL_H
22#define DEMANGLE_UTIL_H
33
4+ #include < chrono>
45#include < string>
56#include < typeindex>
67
@@ -83,44 +84,39 @@ inline std::string demangle(const std::type_index& index)
8384 {
8485 return " std::string" ;
8586 }
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))
9088 {
91- return p ;
89+ return " std::string_view " ;
9290 }
93- else
91+ if (index == typeid (std::chrono::seconds))
9492 {
95- return index. name () ;
93+ return " std::chrono::seconds " ;
9694 }
97- }
98-
99- inline std::string demangle (const std::type_info* info)
100- {
101- if (!info)
95+ if (index == typeid (std::chrono::milliseconds))
10296 {
103- return " void " ;
97+ return " std::chrono::milliseconds " ;
10498 }
105- if (info == & typeid (std::string ))
99+ if (index == typeid (std::chrono::microseconds ))
106100 {
107- return " std::string " ;
101+ return " std::chrono::microseconds " ;
108102 }
109- scoped_demangled_name demangled_name (info->name ());
103+
104+ scoped_demangled_name demangled_name (index.name ());
110105 char const * const p = demangled_name.get ();
111106 if (p)
112107 {
113108 return p;
114109 }
115110 else
116111 {
117- return info-> name ();
112+ return index. name ();
118113 }
119114}
120115
116+
121117inline std::string demangle (const std::type_info& info)
122118{
123- return demangle (& info);
119+ return demangle (std::type_index ( info) );
124120}
125121
126122} // namespace BT
You can’t perform that action at this time.
0 commit comments