3 # ************************************************************
4 # Description : Reads the feature files and store the values
5 # Author : Chad Elliott
6 # Create Date : 5/21/2003
7 # ************************************************************
9 # ************************************************************
11 # ************************************************************
20 # ************************************************************
22 # ************************************************************
28 my $self = $class->SUPER::new
();
30 ## Set the values associative array
31 $self->{'values'} = {};
33 ## Process each feature file
34 foreach my $f (@files) {
36 my($status, $warn) = $self->read_file($f);
38 ## We only want to warn the user about problems
39 ## with the feature file.
40 my $lnumber = $self->get_line_number();
41 $self->warning($self->mpc_basename($f) . ": line $lnumber: $warn");
46 ## Process each feature definition
47 foreach my $feature (@
$features) {
48 my($status, $warn) = $self->parse_line(undef, $feature);
49 ## We only want to warn the user about problems
50 ## with the -feature option.
51 $self->warning("-features parameter: $warn") if (!$status);
59 my($self, $if, $line) = @_;
64 elsif ($line =~ /^(\w+)\s*=\s*(\d+)$/) {
65 ## This is a valid value, so we can store it.
66 $self->{'values'}->{lc($1)} = $2;
69 $error = "Unrecognized line: $line";
72 return (defined $error ?
0 : 1), $error;
77 my @names = sort keys %{$_[0]->{'values'}};
83 ## All feature names are case-insensitive.
85 return $self->{'values'}->{lc($tag)};