Commits

wlav committed 97fa84a

doc strings with C++ signatures for CINT backend

Comments (0)

Files changed (2)

pypy/module/cppyy/src/cintcwrapper.cxx

     return cppstring_to_cstring("");
 }
 
+char* cppyy_method_signature(cppyy_scope_t handle, int method_index) {
+    TFunction* f = type_get_method(handle, method_index);
+    TClassRef cr = type_from_handle(handle);
+    std::ostringstream sig;
+    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());
+}
+
 cppyy_method_t cppyy_get_method(cppyy_scope_t handle, int method_index) {
     TFunction* f = type_get_method(handle, method_index);
     return (cppyy_method_t)f->InterfaceMethod();

pypy/module/cppyy/test/fragile_LinkDef.h

 #pragma link C++ class fragile::G;
 #pragma link C++ class fragile::H;
 #pragma link C++ class fragile::I;
+#pragma link C++ class fragile::J;
 
 #pragma link C++ variable fragile::gI;