genbindings/clang2il: detect pure virtual, detect overrides

This commit is contained in:
mappu 2024-11-15 15:31:07 +13:00
parent d25301c910
commit 2ae1e6090c
2 changed files with 11 additions and 0 deletions

View File

@ -676,6 +676,10 @@ func parseMethod(node map[string]interface{}, mm *CppMethod) error {
mm.IsVirtual = true
}
if pure, ok := node["pure"].(bool); ok && pure {
mm.IsPureVirtual = true
}
if methodInner, ok := node["inner"].([]interface{}); ok {
paramCounter := 0
for _, methodObj := range methodInner {
@ -718,6 +722,12 @@ func parseMethod(node map[string]interface{}, mm *CppMethod) error {
// Next
paramCounter++
case "OverrideAttr":
// void keyPressEvent(QKeyEvent *e) override;
// This is a virtual method being overridden and is a replacement
// for actually using the 'virtual' keyword
mm.IsVirtual = true
default:
// Something else inside a declaration??
log.Printf("==> NOT IMPLEMENTED CXXMethodDecl->%q\n", methodObj["kind"])

View File

@ -239,6 +239,7 @@ type CppMethod struct {
IsSignal bool
IsConst bool
IsVirtual bool
IsPureVirtual bool // Virtual method was declared with = 0 i.e. there is no base method here to call
IsProtected bool // If true, we can't call this method but we may still be able to overload it
HiddenParams []CppParameter // Populated if there is an overload with more parameters