Skip to content

Commit b422a61

Browse files
committed
Implement Cppyy::ResolveName
1 parent 075b328 commit b422a61

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

clingwrapper/src/clingwrapper.cxx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,15 @@ std::string Cppyy::ToString(TCppType_t klass, TCppObject_t obj)
362362
}
363363

364364
// // name to opaque C++ scope representation -----------------------------------
365-
std::string Cppyy::ResolveName(const std::string& cppitem_name)
366-
{
367-
#ifdef PRINT_DEBUG
368-
printf("Resolve name input = %s\n", cppitem_name.c_str());
369-
#endif
370-
return cppitem_name;
371-
365+
std::string Cppyy::ResolveName(const std::string& name) {
366+
if (!name.empty()) {
367+
if (Cppyy::TCppType_t type =
368+
Cppyy::GetType(name, /*enable_slow_lookup=*/true))
369+
return Cppyy::GetTypeAsString(Cppyy::ResolveType(type));
370+
return name;
371+
}
372+
return "";
373+
}
372374
// // Fully resolve the given name to the final type name.
373375
//
374376
// // try memoized type cache, in case seen before
@@ -443,7 +445,7 @@ std::string Cppyy::ResolveName(const std::string& cppitem_name)
443445
// if (tclean.compare(0, 6, "const ") != 0)
444446
// return TClassEdit::ShortType(tclean.c_str(), 2);
445447
// return "const " + TClassEdit::ShortType(tclean.c_str(), 2);
446-
}
448+
// }
447449

448450

449451
Cppyy::TCppType_t Cppyy::ResolveType(TCppType_t type) {

0 commit comments

Comments
 (0)