line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WARC::Record::Stub; # -*- CPerl -*- |
2
|
|
|
|
|
|
|
|
3
|
25
|
|
|
25
|
|
72032
|
use strict; |
|
25
|
|
|
|
|
63
|
|
|
25
|
|
|
|
|
716
|
|
4
|
25
|
|
|
25
|
|
124
|
use warnings; |
|
25
|
|
|
|
|
46
|
|
|
25
|
|
|
|
|
1013
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(WARC::Record::FromVolume); |
7
|
|
|
|
|
|
|
|
8
|
25
|
|
|
25
|
|
599
|
use WARC; *WARC::Record::Stub::VERSION = \$WARC::VERSION; |
|
25
|
|
|
|
|
44
|
|
|
25
|
|
|
|
|
954
|
|
9
|
|
|
|
|
|
|
|
10
|
25
|
|
|
25
|
|
153
|
use Carp; |
|
25
|
|
|
|
|
47
|
|
|
25
|
|
|
|
|
5803
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
require WARC::Record::FromVolume; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# This implementation uses a hash as the underlying structure. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Instances of this class carry only two keys: volume and offset. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Other method calls result in loading the full object. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
215
|
|
|
215
|
1
|
7005
|
my $class = shift; |
22
|
215
|
|
|
|
|
249
|
my $volume = shift; |
23
|
215
|
|
|
|
|
305
|
my $offset = shift; |
24
|
|
|
|
|
|
|
|
25
|
215
|
100
|
|
|
|
698
|
croak "unbalanced key/value pairs" if scalar @_ % 2; |
26
|
|
|
|
|
|
|
|
27
|
214
|
|
|
|
|
523
|
my $ob = {volume => $volume, offset => $offset, @_}; |
28
|
|
|
|
|
|
|
|
29
|
214
|
|
|
|
|
692
|
bless $ob, $class; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _load_and_forward { |
33
|
186
|
|
|
186
|
|
224
|
my $self = shift; |
34
|
186
|
|
|
|
|
228
|
my $method = shift; |
35
|
|
|
|
|
|
|
|
36
|
186
|
|
|
|
|
389
|
my $new = _read WARC::Record::FromVolume ($self->volume, $self->offset); |
37
|
|
|
|
|
|
|
|
38
|
186
|
|
|
|
|
2115
|
$self->{$_} = $new->{$_} for keys %$new; |
39
|
186
|
|
|
|
|
395
|
bless $self, ref $new; |
40
|
|
|
|
|
|
|
|
41
|
186
|
|
|
|
|
556
|
$self->$method(@_) |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
BEGIN { |
45
|
25
|
|
|
25
|
|
179
|
no strict 'refs'; |
|
25
|
|
|
|
|
66
|
|
|
25
|
|
|
|
|
2047
|
|
46
|
25
|
|
|
25
|
|
113
|
foreach my $sub (qw/ fields protocol next open_block replay open_payload /) |
47
|
150
|
|
|
186
|
|
600
|
{ *{$sub} = sub { (shift)->_load_and_forward($sub => @_)} } |
|
150
|
|
|
|
|
1307
|
|
|
186
|
|
|
|
|
7579
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
__END__ |