diff options
Diffstat (limited to 'ACE/bin/doxygen-convert-h.pl')
-rwxr-xr-x | ACE/bin/doxygen-convert-h.pl | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/ACE/bin/doxygen-convert-h.pl b/ACE/bin/doxygen-convert-h.pl index 3fcfc64abe0..d8d84370059 100755 --- a/ACE/bin/doxygen-convert-h.pl +++ b/ACE/bin/doxygen-convert-h.pl @@ -10,13 +10,14 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # (Search for @todo in this script) use File::Copy; +use FileHandle; use Getopt::Std; ############################################################################## # Parse the options if (!getopts ('dDhsu') || $opt_h) { - print "doxygen-convert-h.pl [-dDhsu] filename\n"; + print "doxygen-convert-h.pl [-dDhsu] filenames or directories\n"; print "\n"; print " -d debug script\n"; print " -D really verbose debug\n"; @@ -34,12 +35,48 @@ $opt_d = 1 if (defined $opt_D); @files = (); +sub recursive_find { + my($file) = shift; + my(@rfiles) = (); + my($fh) = new FileHandle(); + + if (opendir($fh, $file)) { + foreach my $f (grep(!/^\.\.?$/, readdir($fh))) { + if ($f ne '.svn') { + my($full) = "$file/$f"; + if (-d $full) { + push(@rfiles, recursive_find($full)); + } + else { + push(@rfiles, $full) + ## If we want to limit the recursive find to "source" files, + ## un-comment this line : + ##if ($f =~ /\.(h|hxx|hpp|hh|inl|cpp|cxx|cc|c|C)$/) + ; + } + } + } + closedir($fh); + } + + return @rfiles; +} + foreach $arg (@ARGV) { my @results = glob $arg; if ($#results < 0) { print STDERR "File not Found: $arg\n" } - push @files, @results; + else { + foreach my $result (@results) { + if (-d $result) { + push(@files, recursive_find($result)); + } + else { + push(@files, $results); + } + } + } } ############################################################################## |