Author: Wim Lavrijsen <[email protected]>
Branch: cling-support
Changeset: r85702:60f4ffb2e3b4
Date: 2016-07-14 09:44 -0700
http://bitbucket.org/pypy/pypy/changeset/60f4ffb2e3b4/
Log: from Aditi: add signature strings
diff --git a/pypy/module/cppyy/src/clingcwrapper.cxx
b/pypy/module/cppyy/src/clingcwrapper.cxx
--- a/pypy/module/cppyy/src/clingcwrapper.cxx
+++ b/pypy/module/cppyy/src/clingcwrapper.cxx
@@ -818,9 +818,22 @@
return "";
}
-std::string Cppyy::GetMethodSignature( TCppScope_t /* scope */, TCppIndex_t /*
imeth */ )
+std::string Cppyy::GetMethodSignature( TCppScope_t scope, TCppIndex_t imeth )
{
- return "<unknown>";
+ TClassRef& cr = type_from_handle( scope );
+ TFunction* f = type_get_method( scope, imeth );
+ std::ostringstream sig;
+ if ( cr.GetClass() && cr->GetClassInfo() )
+ sig << f->GetReturnTypeName() << " ";
+ sig << cr.GetClassName() << "::" << f->GetName() << "(";
+ int nArgs = f->GetNargs();
+ for ( int iarg = 0; iarg < nArgs; ++iarg ) {
+ sig << ((TMethodArg*)f->GetListOfMethodArgs()->At( iarg
))->GetFullTypeName();
+ if (iarg != nArgs-1)
+ sig << ", ";
+ }
+ sig << ")" << std::ends;
+ return cppstring_to_cstring(sig.str());
}
Bool_t Cppyy::IsConstMethod( TCppMethod_t method )
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit