/[libconf]/libconf/perl-Libconf/Glueconf/Shell.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/Glueconf/Shell.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by dams, Sun May 25 13:13:02 2003 UTC revision 1.6 by dams, Sun Aug 17 14:20:11 2003 UTC
# Line 28  use Libconf; Line 28  use Libconf;
28  @ISA = qw(Libconf);  @ISA = qw(Libconf);
29    
30  sub new {  sub new {
31      my ($pkg, $filename) = @_;      my ($class, $filename, $data_description, $data_mapping) = @_;
32      my $libconf = Libconf::new('Libconf', $filename, 'shell', '');      my $libconf = Libconf::new('Libconf', $filename, 'shell', '');
33      tie my %wrapper, 'Libconf::Glueconf::Shell::Wrapper', $libconf;      tie my %wrapper, 'Libconf::Glueconf::Shell::Wrapper', $libconf, $data_description, $data_mapping;
34      bless \%wrapper, $pkg;      bless \%wrapper, $class;
35  }  }
36    
37  sub readConf {  sub readConf {
# Line 49  package Libconf::Glueconf::Shell::Wrappe Line 49  package Libconf::Glueconf::Shell::Wrappe
49  sub debug { Libconf::debug(@_) }  sub debug { Libconf::debug(@_) }
50    
51  sub TIEHASH {  sub TIEHASH {
52      my ($pkg, $libconf) = @_;      my ($pkg, $libconf, $data_description, $data_mapping) = @_;
53      debug;      debug;
54      bless { libconf => $libconf }, $pkg;      bless {
55               libconf => $libconf,
56               _data_description => $data_description,
57               _data_mapping => $data_mapping,
58              }, $pkg;
59  }  }
60    
61  sub CLEAR {  sub CLEAR {
# Line 109  sub FETCH { Line 113  sub FETCH {
113      my ($obj, $key) = @_;      my ($obj, $key) = @_;
114      debug "key : $key";      debug "key : $key";
115      $key eq 'libconf' and return $obj->{libconf};      $key eq 'libconf' and return $obj->{libconf};
116        substr($key, 0, 1) eq '_' and return $obj->{$key};
117      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUE', key => $key });      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUE', key => $key });
118        @pos == 0 and return undef;
119      $obj->{libconf}->getAtom($pos[-1])->{value};      $obj->{libconf}->getAtom($pos[-1])->{value};
120  }  }
121    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26