102 |
} |
} |
103 |
} |
} |
104 |
|
|
105 |
=head2 load_gs |
=head2 load_ds |
106 |
|
|
107 |
Retrive from disk one data_structure records using field 000 as key |
Retrive from disk one data_structure records using field 000 as key |
108 |
|
|
109 |
my @ds = $db->load_gs($rec); |
my @ds = $db->load_ds($rec); |
110 |
|
|
111 |
This function will also perform basic sanity checking on returned |
This function will also perform basic sanity checking on returned |
112 |
data and disable caching if data is corrupted (or changed since last |
data and disable caching if data is corrupted (or changed since last |
116 |
|
|
117 |
=cut |
=cut |
118 |
|
|
119 |
sub load_gs { |
sub load_ds { |
120 |
my $self = shift; |
my $self = shift; |
121 |
|
|
122 |
return unless $self->{'path'}; |
return unless $self->{'path'}; |
161 |
return undef; |
return undef; |
162 |
} |
} |
163 |
|
|
164 |
=head2 save_gs |
=head2 save_ds |
165 |
|
|
166 |
Store data_structure on disk. |
Store data_structure on disk. |
167 |
|
|
168 |
$db->save_gs( |
$db->save_ds( |
169 |
ds => \@ds, |
ds => \@ds, |
170 |
current_filename => $self->{'current_filename'}, |
current_filename => $self->{'current_filename'}, |
171 |
headline => $self->{'headline'}, |
headline => $self->{'headline'}, |
173 |
|
|
174 |
B<Totally broken, but fast.> |
B<Totally broken, but fast.> |
175 |
|
|
176 |
Depends on filename generated by C<load_gs>. |
Depends on filename generated by C<load_ds>. |
177 |
|
|
178 |
=cut |
=cut |
179 |
|
|
180 |
sub save_gs { |
sub save_ds { |
181 |
my $self = shift; |
my $self = shift; |
182 |
|
|
183 |
return unless($self->{'path'}); |
return unless($self->{'path'}); |
187 |
|
|
188 |
my $log = $self->_get_logger; |
my $log = $self->_get_logger; |
189 |
|
|
190 |
$log->logdie("save_gs without cache_file -- did you called gs_get before?") unless ($self->{'cache_file'}); |
$log->logdie("save_ds without cache_file -- did you called gs_get before?") unless ($self->{'cache_file'}); |
191 |
|
|
192 |
foreach my $e (qw/ds current_filename headline/) { |
foreach my $e (qw/ds current_filename headline/) { |
193 |
$log->logdie("missing $e") unless $arg->{$e}; |
$log->logdie("missing $e") unless $arg->{$e}; |