]>
git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/lib/wxFileInfo.pm
11 my $info = new wxFileInfo( $filename, $filetype, $fileflags );
12 my $info2 = new wxFileInfo( 'mdig.cpp', 'Generic',
13 'NotWin32,NotGTK,NotMac' );
17 $flags = $info->fileflags;
18 $bool = $info->is_header;
19 $bool = $info->is_source;
20 $file = $info->object_file;
21 $file = $info->source_file;
22 $bool = $info->has_flag( 'NotX' );
30 my $class = ref( $ref ) || $ref;
31 my $self = bless {}, $class;
33 my( $filename, $filetype, $fileflags ) = @_;
34 $fileflags =~ tr/ \t//d;
36 @{$self}{'filename', 'filetype'} = ( $filename, $filetype );
37 $self->{fileflags
} = [ split /,/, $fileflags ];
42 sub filename
{ $_[0]->{filename
} }
43 sub filetype
{ $_[0]->{filetype
} }
44 sub fileflags
{ $_[0]->{fileflags
} }
45 sub is_header
{ scalar( $_[0]->{filename
} =~ m/\.h$/i ) }
46 sub is_source
{ !scalar( $_[0]->{filename
} =~ m/\.h$/i ) }
50 my $obj = $self->{filename
};
52 $obj =~ s/cp?p?$/o/i; # PORTABILITY
57 my %src_prefix = ( Common
=> 'common/',
58 Generic
=> 'generic/',
68 ProtoH
=> 'protocol/',
72 GenericH
=> 'generic/',
78 my $type = $self->filetype;
80 die "Unknown file type '$type'" unless exists $src_prefix{$type};
81 return $src_prefix{$type} . $self->filename; # PORTABILITY
85 my( $self, $flag ) = @_;
87 return grep { lc( $_ ) eq $flag } @{$self->{fileflags
}};