From a6d63f33d2e894a6324707ed4eae72ba656eb016 Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 14 Aug 2024 18:38:57 +1200 Subject: [PATCH] genbindings: skip non-Qt classes found --- cmd/genbindings/main.go | 1 + cmd/genbindings/transformblacklist.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 cmd/genbindings/transformblacklist.go diff --git a/cmd/genbindings/main.go b/cmd/genbindings/main.go index 1c5ef115..2dd7f8aa 100644 --- a/cmd/genbindings/main.go +++ b/cmd/genbindings/main.go @@ -87,6 +87,7 @@ func main() { } // AST transforms on our IL + astTransformBlacklist(parsed) astTransformOptional(parsed) astTransformOverloads(parsed) diff --git a/cmd/genbindings/transformblacklist.go b/cmd/genbindings/transformblacklist.go new file mode 100644 index 00000000..254c2021 --- /dev/null +++ b/cmd/genbindings/transformblacklist.go @@ -0,0 +1,16 @@ +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 +}