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

Comparing COMP/SCRAM/src/ActiveDoc/SimpleURLDoc.pm (file contents):
Revision 1.1.2.1 by williamc, Wed Aug 9 12:38:22 2000 UTC vs.
Revision 1.1.2.2 by williamc, Wed Aug 9 12:55:52 2000 UTC

# Line 10 | Line 10
10   # ---------
11   # new(URLcache)         : A new SimpleURLDoc object
12   # addbasetags(parse)    : Add Base Tags to the given parse
13 < # urlget(urlstring)     : get the given url. Returns (url, filename)
13 > # urlget(urlstring[,location]) : get the given url. Returns (url, filename)
14 > # cache([cache])        : get/set the current URL cache
15  
16   package ActiveDoc::SimpleURLDoc;
17   use ActiveDoc::SimpleDoc;
# Line 21 | Line 22 | sub new {
22          my $class=shift;
23          my $self={};
24          bless $self, $class;
25 <        $self->{cache}=shift;
25 <        $self->{urlhandler}=URL::URLhandler->new($self->{cache});
25 >        $self->cache(shift);
26          $self->{switch}=ActiveDoc::SimpleDoc->new();
27          return $self;
28   }
# Line 36 | Line 36 | sub addbasetags {
36                                       \&Base_end,$self);
37   }
38  
39 + sub cache {
40 +        my $self=shift;
41 +        if ( @_ ) {
42 +          $self->{cache}=shift;
43 +          $self->{urlhandler}=URL::URLhandler->new($self->{cache});
44 +        }
45 +        return $self->{cache};
46 + }
47 +
48   sub urlget {
49          my $self=shift;
50          my $urlstring=shift;
51 <        ($fullurl,$filename)=$self->{urlhandler}->get($urlstring);
51 >
52 >        ($fullurl,$filename)=$self->{urlhandler}->get($urlstring, @_);
53          if ( ( ! defined $filename ) || ( $filename eq "" ) ) {
54            $self->{switch}->parseerror("Failed to get $fullurl");
55          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines