ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/PreProcessedFile.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/PreProcessedFile.pm (file contents):
Revision 1.8.4.1 by williamc, Thu Aug 17 15:59:22 2000 UTC vs.
Revision 1.8.4.2 by williamc, Mon Aug 21 18:40:19 2000 UTC

# Line 34 | Line 34 | sub new {
34          my $class=shift;
35          my $self={};
36          bless $self, $class;
37        $self->{cache}=shift;
37          $self->{dbstore}=shift;
39        $self->{switch}=ActiveDoc::ActiveDoc->
40                        new($self->{cache},$self->{dbstore});
41        $self->init();
38          bless $self, $class;
39          return $self;
40   }
41  
42 + sub cache {
43 +        my $self=shift;
44 +        if ( @_ ) {
45 +           $self->{cache}=shift;
46 +           $self->init();
47 +        }
48 +        return $self->{cache};
49 + }
50 +
51   sub init {
52          my $self=shift;
53          $self->{lastsequence}=-1;
54 +        $self->{switch}=ActiveDoc::ActiveDoc->
55 +                        new($self->{cache},$self->{dbstore});
56          # -- Specific Tags
57          $self->{switch}->newparse("include");
58          $self->{switch}->addbasetags("include");
# Line 190 | Line 197 | sub store {
197  
198          # -- get all include objects to store themselves
199          print $fh $self->{lastsequence}."\n";
200 +        print $fh ref($self->cache()).":::".$self->cache()->location()."\n";
201          print $fh ($self->url()?$self->url():"");
202          print $fh "\n";
203          foreach $inc ( @{$self->{includesdesc}} ) {
# Line 207 | Line 215 | sub restore {
215  
216          $self->{lastsequence}=<$fh>;
217          chomp $self->{lastsequence};
218 +        # -- recreate the cache
219 +        my $cacheinfo=<$fh>;
220 +        chomp $cacheinfo;
221 +        my ($type,$location)=split /:::/, $cacheinfo;
222 +        my $cache=$type->new($location);
223 +        $self->cache($cache);
224 +
225          my $url=<$fh>;
226          chomp $url;
227          $self->url($url);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines