[system] / trunk / pg / lib / Value / Context / Data.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value/Context/Data.pm

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

Revision 2649 Revision 2658
9 my $self = shift; my $class = ref($self) || $self; 9 my $self = shift; my $class = ref($self) || $self;
10 my $parent = shift; 10 my $parent = shift;
11 my $data = bless { 11 my $data = bless {
12 context => $parent, # parent context 12 context => $parent, # parent context
13 dataName => {}, # name of data storage in context hash 13 dataName => {}, # name of data storage in context hash
14 pattern => '', # pattern for names of data items 14 pattern => '^$', # pattern for names of data items (default never matches)
15 namePattern => '', # pattern for allowed names for new items 15 namePattern => '', # pattern for allowed names for new items
16 name => '', Name => '', # lower- and upper-case names for the class of items 16 name => '', Name => '', # lower- and upper-case names for the class of items
17 }, $class; 17 }, $class;
18 $data->init(); 18 $data->init();
19 $parent->{$data->{dataName}} = {}; 19 $parent->{$data->{dataName}} = {};
62 my @pattern = (); 62 my @pattern = ();
63 push(@pattern,join('|',@_)) if scalar(@_) > 0; 63 push(@pattern,join('|',@_)) if scalar(@_) > 0;
64 push(@pattern,protectRegexp($s)) if length($s) ==1; 64 push(@pattern,protectRegexp($s)) if length($s) ==1;
65 push(@pattern,"[".protectChars($s)."]") if length($s) > 1; 65 push(@pattern,"[".protectChars($s)."]") if length($s) > 1;
66 my $pattern = join('|',@pattern); 66 my $pattern = join('|',@pattern);
67 $pattern = '^$' if $pattern eq '';
67 return $pattern; 68 return $pattern;
68} 69}
69 70
70sub protectRegexp { 71sub protectRegexp {
71 my $string = shift; 72 my $string = shift;

Legend:
Removed from v.2649  
changed lines
  Added in v.2658

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9