mirror of
https://github.com/mappu/miqt.git
synced 2025-02-23 13:00:25 +00:00
genbindings: move transformblacklist into exceptions.go
This commit is contained in:
parent
043db615b1
commit
bdbeb3d1e5
@ -51,8 +51,8 @@ func parseHeader(topLevel []interface{}) (*CppParsedHeader, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also skip over any QFooPrivate classes
|
// Also skip over any custom exceptions
|
||||||
if nodename[0] == 'Q' && strings.HasSuffix(nodename, "Private") {
|
if !AllowClass(nodename) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,27 @@ func ImportHeaderForClass(className string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AllowClass(className string) bool {
|
||||||
|
if className[0] != 'Q' {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasSuffix(className, "Private") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
switch className {
|
||||||
|
case
|
||||||
|
"QException", // Extends std::exception, too hard
|
||||||
|
"QItemSelection", // Extends a QList<>, too hard
|
||||||
|
"QXmlStreamAttributes", // Extends a QList<>, too hard
|
||||||
|
"QPolygon", "QPolygonF": // Extends a QVector<QPoint> template class, too hard
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func CheckComplexity(p CppParameter) error {
|
func CheckComplexity(p CppParameter) error {
|
||||||
|
|
||||||
if p.QMapOf() {
|
if p.QMapOf() {
|
||||||
|
@ -175,7 +175,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AST transforms on our IL
|
// AST transforms on our IL
|
||||||
astTransformBlacklist(parsed)
|
|
||||||
astTransformOptional(parsed)
|
astTransformOptional(parsed)
|
||||||
astTransformOverloads(parsed)
|
astTransformOverloads(parsed)
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
// astTransformBlacklist filters out things we do not want to parse.
|
|
||||||
func astTransformBlacklist(parsed *CppParsedHeader) {
|
|
||||||
var keep []CppClass
|
|
||||||
|
|
||||||
for _, c := range parsed.Classes {
|
|
||||||
if c.ClassName[0] != 'Q' {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
keep = append(keep, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
parsed.Classes = keep
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user