From ad880c45894a1146ccfd3d065b402c42be47d08e Mon Sep 17 00:00:00 2001 From: maximusron Date: Fri, 7 Jun 2024 16:47:25 +0200 Subject: [PATCH] Add canonical type interface for method args --- clingwrapper/src/clingwrapper.cxx | 8 ++++++++ clingwrapper/src/cpp_cppyy.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/clingwrapper/src/clingwrapper.cxx b/clingwrapper/src/clingwrapper.cxx index b3c2f441..8c22066c 100644 --- a/clingwrapper/src/clingwrapper.cxx +++ b/clingwrapper/src/clingwrapper.cxx @@ -1395,6 +1395,14 @@ std::string Cppyy::GetMethodArgTypeAsString(TCppMethod_t method, TCppIndex_t iar Cpp::GetFunctionArgType(method, iarg)); } +std::string Cppyy::GetMethodArgCanonTypeAsString(TCppMethod_t method, TCppIndex_t iarg) +{ + return + Cpp::GetTypeAsString( + Cpp::GetCanonicalType( + Cpp::GetFunctionArgType(method, iarg))); +} + std::string Cppyy::GetMethodArgDefault(TCppMethod_t method, TCppIndex_t iarg) { if (!method) diff --git a/clingwrapper/src/cpp_cppyy.h b/clingwrapper/src/cpp_cppyy.h index 91504e3f..2af7e8d2 100644 --- a/clingwrapper/src/cpp_cppyy.h +++ b/clingwrapper/src/cpp_cppyy.h @@ -284,6 +284,8 @@ namespace Cppyy { RPY_EXPORTED std::string GetMethodArgTypeAsString(TCppMethod_t method, TCppIndex_t iarg); RPY_EXPORTED + std::string GetMethodArgCanonTypeAsString(TCppMethod_t method, TCppIndex_t iarg); + RPY_EXPORTED std::string GetMethodArgDefault(TCppMethod_t, TCppIndex_t iarg); RPY_EXPORTED std::string GetMethodSignature(TCppMethod_t, bool show_formal_args, TCppIndex_t max_args = (TCppIndex_t)-1);