mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
genbindings: add Delete() functions
This commit is contained in:
parent
8c572259c4
commit
76f4323676
@ -147,6 +147,9 @@ extern "C" {
|
|||||||
ret.WriteString(fmt.Sprintf("%s %s_%s(%s);\n", emitReturnTypeCabi(m.ReturnType), c.ClassName, m.SafeMethodName(), emitParametersCabi(m, "P"+c.ClassName)))
|
ret.WriteString(fmt.Sprintf("%s %s_%s(%s);\n", emitReturnTypeCabi(m.ReturnType), c.ClassName, m.SafeMethodName(), emitParametersCabi(m, "P"+c.ClassName)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete
|
||||||
|
ret.WriteString(fmt.Sprintf("void %s_Delete(P%s self);\n", c.ClassName, c.ClassName))
|
||||||
|
|
||||||
ret.WriteString("\n")
|
ret.WriteString("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +220,16 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
|
|||||||
afterCall,
|
afterCall,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete
|
||||||
|
ret.WriteString(fmt.Sprintf(
|
||||||
|
"void %s_Delete(P%s self) {\n"+
|
||||||
|
"\tdelete static_cast<%s*>(self);\n"+
|
||||||
|
"}\n"+
|
||||||
|
"\n",
|
||||||
|
c.ClassName, c.ClassName,
|
||||||
|
c.ClassName,
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret.String(), nil
|
return ret.String(), nil
|
||||||
|
@ -147,6 +147,12 @@ import "C"
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret.WriteString(`
|
||||||
|
func (this *` + c.ClassName + `) Delete() {
|
||||||
|
C.` + c.ClassName + `_Delete(this.h)
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goSrc := ret.String()
|
goSrc := ret.String()
|
||||||
|
Loading…
Reference in New Issue
Block a user