mirror of
https://github.com/mappu/miqt.git
synced 2025-02-22 12:30:23 +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
|
||||
if nodename[0] == 'Q' && strings.HasSuffix(nodename, "Private") {
|
||||
// Also skip over any custom exceptions
|
||||
if !AllowClass(nodename) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,27 @@ func ImportHeaderForClass(className string) bool {
|
||||
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 {
|
||||
|
||||
if p.QMapOf() {
|
||||
|
@ -175,7 +175,6 @@ func main() {
|
||||
}
|
||||
|
||||
// AST transforms on our IL
|
||||
astTransformBlacklist(parsed)
|
||||
astTransformOptional(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