@@ -1461,6 +1461,35 @@ std::string Cppyy::GetMethodArgDefault(TCppMethod_t method, TCppIndex_t iarg)
1461
1461
return Cpp::GetFunctionArgDefault (method, iarg);
1462
1462
}
1463
1463
1464
+ Cppyy::TCppIndex_t Cppyy::CompareMethodArgType (TCppMethod_t method, TCppIndex_t iarg, const std::string &req_type)
1465
+ {
1466
+ // if (method) {
1467
+ // TFunction* f = m2f(method);
1468
+ // TMethodArg* arg = (TMethodArg *)f->GetListOfMethodArgs()->At((int)iarg);
1469
+ // void *argqtp = gInterpreter->TypeInfo_QualTypePtr(arg->GetTypeInfo());
1470
+
1471
+ // TypeInfo_t *reqti = gInterpreter->TypeInfo_Factory(req_type.c_str());
1472
+ // void *reqqtp = gInterpreter->TypeInfo_QualTypePtr(reqti);
1473
+
1474
+ // if (ArgSimilarityScore(argqtp, reqqtp) < 10) {
1475
+ // return ArgSimilarityScore(argqtp, reqqtp);
1476
+ // }
1477
+ // else { // Match using underlying types
1478
+ // if(gInterpreter->IsPointerType(argqtp))
1479
+ // argqtp = gInterpreter->TypeInfo_QualTypePtr(gInterpreter->GetPointerType(argqtp));
1480
+
1481
+ // // Handles reference types and strips qualifiers
1482
+ // TypeInfo_t *arg_ul = gInterpreter->GetNonReferenceType(argqtp);
1483
+ // TypeInfo_t *req_ul = gInterpreter->GetNonReferenceType(reqqtp);
1484
+ // argqtp = gInterpreter->TypeInfo_QualTypePtr(gInterpreter->GetUnqualifiedType(gInterpreter->TypeInfo_QualTypePtr(arg_ul)));
1485
+ // reqqtp = gInterpreter->TypeInfo_QualTypePtr(gInterpreter->GetUnqualifiedType(gInterpreter->TypeInfo_QualTypePtr(req_ul)));
1486
+
1487
+ // return ArgSimilarityScore(argqtp, reqqtp);
1488
+ // }
1489
+ // }
1490
+ return 0 ; // Method is not valid
1491
+ }
1492
+
1464
1493
std::string Cppyy::GetMethodSignature (TCppMethod_t method, bool show_formal_args, TCppIndex_t max_args)
1465
1494
{
1466
1495
std::ostringstream sig;
0 commit comments