21 |
|
# hashref from a tag call |
22 |
|
# includeparse(local_parsename, objparsename, activedoc) : copy the parse from |
23 |
|
# one object to another |
24 |
+ |
# currentparser() : return the current parser object |
25 |
|
# currentparsename([name]) : get/set current parse name |
26 |
|
# getfile(url) : get a processedfile object given a url |
27 |
|
# activatedoc(url) : Return the object ref for a doc described by the given url |
42 |
|
# parseerror(string) : Report an error during parsing a file |
43 |
|
# line() : Return the current line number of the document |
44 |
|
# and the ProcessedFileObj it is in |
45 |
+ |
# |
46 |
+ |
# -- support for inheriting classes |
47 |
+ |
# _saveactivedoc(filehandle) |
48 |
+ |
# _restoreactivedoc(filehandle) |
49 |
|
|
50 |
|
package ActiveDoc::ActiveDoc; |
51 |
|
require 5.004; |
133 |
|
:$self->{currentparsename}; |
134 |
|
} |
135 |
|
|
136 |
+ |
sub currentparser { |
137 |
+ |
my $self=shift; |
138 |
+ |
return $self->{currentparser}; |
139 |
+ |
} |
140 |
+ |
|
141 |
+ |
|
142 |
|
sub newparse { |
143 |
|
my $self=shift; |
144 |
|
my $parselabel=shift; |
270 |
|
return $self->userinterface()->askuser(@_); |
271 |
|
} |
272 |
|
|
273 |
< |
sub getfile() { |
273 |
> |
sub getfile { |
274 |
|
my $self=shift; |
275 |
|
my $origurl=shift; |
276 |
|
|
468 |
|
@_?$self->{userinterface}=shift |
469 |
|
:$self->{userinterface} |
470 |
|
} |
471 |
+ |
|
472 |
+ |
sub _saveactivedoc { |
473 |
+ |
my $self=shift; |
474 |
+ |
my $fh=shift; |
475 |
+ |
print "Storing $self\n"; |
476 |
+ |
print $fh $self->url()."\n"; |
477 |
+ |
} |
478 |
+ |
|
479 |
+ |
sub _restoreactivedoc { |
480 |
+ |
my $self=shift; |
481 |
+ |
my $fh=shift; |
482 |
+ |
|
483 |
+ |
my $url=<$fh>; |
484 |
+ |
chomp $url; |
485 |
+ |
$self->url($url); |
486 |
+ |
} |