findclasslist.pl: add a way to mark lines to be ignored

In case they get erroneously extracted. For example, in Core5Compat,
QTextCodec appears in the _p.h as a full class if !QT_CONFIG(textcodec)
(I don't know what that is for, but it's there).

Pick-to: 6.4
Change-Id: Ic6547f8247454b47baa8fffd170eb1d0f7e6d0f9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
bb10
Thiago Macieira 2022-08-25 17:53:43 -03:00
parent 9afe954783
commit 845697bf11
2 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,12 @@ while (<STDIN>) {
open HDR, "<$1" or die("Could not open header $1: $!");
my $comment = " /* $1 */";
while (my $line = <HDR>) {
if ($line =~ /\bELFVERSION:(\S+)\b/) {
last if $1 eq "stop";
<HDR> if $1 eq "ignore-next"; # load next line
next if $1 eq "ignore" or $1 eq "ignore-next";
}
# Match a struct or class declaration, but not a forward declaration
$line =~ /^(?:struct|class|namespace) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next;
print $comment if $comment;

View File

@ -15,6 +15,8 @@
// We mean it.
//
// These structures are not ours, so ELFVERSION:stop
extern "C" {
// Equivalent to dbus-arch-deps.h (generated from dbus-arch-deps.h.in)