4 my ($srcdir) = ($0 =~ m!^(.*?)[^/]*$!);
5 my $dir = '../doxygen-xml';
9 open XAPIAN_RB
, '<', "${srcdir}/xapian.rb" or die $!;
10 mkdir 'docs', 0777 unless -d
'docs';
11 my $out = 'docs/xapian.rb';
12 open OUT
, '>', $out."T" or die $!;
15 if (m!^\s*class\s+Xapian::(\w+)!) {
23 open INDEX
, '<', "$dir/index.xml" or die $!;
25 if (m!\bkind="(?:class|struct)".*><name>Xapian::(.+)</name>!) {
27 if (exists $documented{$class} ||
28 $class =~ /^Internal::/ ||
29 $class =~ /::Internal$/ ||
33 if (m!\brefid="(\w+)"!) {
35 if ($refid !~ m![/.]!) {
38 print STDERR
"Bad refid: $refid\n";
41 print STDERR
"No refid found for $class: $_";
47 for my $refid (sort keys %id) {
49 open F
, '<', "$dir/$refid.xml";
51 if (/<compounddef id="\Q$refid\E" kind="class" prot="(\w+)"/) {
57 if ($refid =~ /^struct/ || (defined $prot && $prot eq 'public')) {
58 my $class = $id{$refid};
61 # {Xapian::$class C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1$class.html].
65 } elsif (!defined $prot) {
66 print STDERR
"No prot found for $refid\n";
70 rename $out."T", $out or die $!;