mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 06:08:38 +00:00
genbindings/clang2il: detect pure virtual, detect overrides
This commit is contained in:
parent
d25301c910
commit
2ae1e6090c
@ -676,6 +676,10 @@ func parseMethod(node map[string]interface{}, mm *CppMethod) error {
|
|||||||
mm.IsVirtual = true
|
mm.IsVirtual = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pure, ok := node["pure"].(bool); ok && pure {
|
||||||
|
mm.IsPureVirtual = true
|
||||||
|
}
|
||||||
|
|
||||||
if methodInner, ok := node["inner"].([]interface{}); ok {
|
if methodInner, ok := node["inner"].([]interface{}); ok {
|
||||||
paramCounter := 0
|
paramCounter := 0
|
||||||
for _, methodObj := range methodInner {
|
for _, methodObj := range methodInner {
|
||||||
@ -718,6 +722,12 @@ func parseMethod(node map[string]interface{}, mm *CppMethod) error {
|
|||||||
// Next
|
// Next
|
||||||
paramCounter++
|
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:
|
default:
|
||||||
// Something else inside a declaration??
|
// Something else inside a declaration??
|
||||||
log.Printf("==> NOT IMPLEMENTED CXXMethodDecl->%q\n", methodObj["kind"])
|
log.Printf("==> NOT IMPLEMENTED CXXMethodDecl->%q\n", methodObj["kind"])
|
||||||
|
@ -239,6 +239,7 @@ type CppMethod struct {
|
|||||||
IsSignal bool
|
IsSignal bool
|
||||||
IsConst bool
|
IsConst bool
|
||||||
IsVirtual 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
|
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
|
HiddenParams []CppParameter // Populated if there is an overload with more parameters
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user