genbindings: add new AllowCtor framework

This commit is contained in:
mappu 2025-02-07 18:55:01 +13:00
parent cae8967119
commit 0b39af57e3
2 changed files with 10 additions and 0 deletions

View File

@ -394,6 +394,10 @@ nextMethod:
// an existing class instance
mm.IsStatic = true
if !AllowCtor(ret.ClassName, mm) {
continue
}
ret.Ctors = append(ret.Ctors, mm)
case "CXXDestructorDecl":

View File

@ -321,6 +321,12 @@ func AllowMethod(className string, mm CppMethod) error {
return nil // OK, allow
}
func AllowCtor(className string, mm CppMethod) bool {
// Default allow
return true
}
// AllowType controls whether to permit binding of a method, if a method uses
// this type in its parameter list or return type.
// Any type not permitted by AllowClass is also not permitted by this method.