]>
git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/lib/wxFileList.pm
9 use wxFileList qw(grep_filetype grep_fileflag grep_not_fileflag
10 grep_source grep_header sort_files make_arrays);
13 # @wxGeneric = sort_files grep_filetype 'Generic', @wxALL;
14 # @wxGenericInclude = sort_files grep_filetype 'GenericH', @wxALL;
15 make_arrays( 'wxGeneric', 'wxGenericInclude' );
23 # alias wxALL from main
25 *wxALL
= \
@main::wxALL
;
28 use vars
qw(@EXPORT_OK %EXPORT_TAGS);
30 @EXPORT_OK = qw(grep_filetype grep_fileflag grep_not_fileflag
31 grep_source grep_header sort_files make_arrays);
33 %EXPORT_TAGS = ( 'default' => [ qw(grep_filetype grep_fileflag grep_source
34 grep_not_fileflag grep_header
40 Generic
=> "wxGeneric",
41 GenericH
=> "wxGenericInclude",
43 HtmlH
=> "wxHtmlInclude",
45 MotifH
=> "wxMotifInclude",
46 ProtoH
=> "wxProtocolInclude",
48 UnixH
=> "wxUnixInclude",
52 my %array_2_type = map { ( $type_2_array{$_}, $_ ) } keys %type_2_array;
55 sort { $a->filename cmp $b->filename } @_;
60 my @files = grep_filetype 'Type', @all_files;
62 Returns files in C<@all_files> whose file type matches C<'Type'>.
67 my $filetype = lc( shift );
69 return _sort
grep { $filetype eq lc( $_->filetype ) } @_;
74 =head2 grep_not_fileflag
76 my @files = grep_fileflag 'NotX', @all_files;
77 my @files2 = grep_not_fileflag 'NotX', @all_files;
79 Return files in C<@all_files> [not] having the given file flag.
86 return _sort
grep { $_->has_flag( $fileflag ) } @_;
89 sub grep_not_fileflag
{
92 return _sort
grep { !( $_->has_flag( $fileflag ) ) } @_;
99 my @headers = grep_header @all_files;
100 my @sources = grep_source @all_files;
102 Return header/source files contained in C<@all_files>.
107 return _sort
grep { $_->is_header } @_;
111 return _sort
grep { $_->is_source } @_;
116 my @sorted_files = sort_files @files;
118 Sorts files by file name.
123 return sort { $a->{filename
} cmp $b->{filename
} } @_;
133 my( $package ) = caller;
135 foreach my $array ( @_ ) {
136 my $type = $array_2_type{$array};
140 croak
( "Invalid array name '$array'" );
144 @{"${package}::${array}"} = sort_files grep_filetype
$type, @wxALL;