line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ESPPlus::Storage::Record; |
2
|
6
|
|
|
6
|
|
91
|
use 5.006; |
|
6
|
|
|
|
|
19
|
|
|
6
|
|
|
|
|
218
|
|
3
|
6
|
|
|
6
|
|
28
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
156
|
|
4
|
6
|
|
|
6
|
|
26
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
141
|
|
5
|
6
|
|
|
6
|
|
28
|
use Carp 'confess'; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
392
|
|
6
|
6
|
|
|
6
|
|
31
|
use ESPPlus::Storage::Util; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
1181
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
6
|
|
|
6
|
|
21
|
for (qw(compressed |
10
|
|
|
|
|
|
|
uncompressed |
11
|
|
|
|
|
|
|
header_text)) { |
12
|
18
|
|
|
|
|
58
|
attribute_builder( $_, 'read only' ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
6
|
|
|
|
|
24
|
attribute_builder( 'uncompress_function' ); |
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
|
|
28
|
for ([qw[expected_length L]], |
18
|
|
|
|
|
|
|
[qw[timestamp U]], |
19
|
|
|
|
|
|
|
[qw[application A]]) { |
20
|
18
|
|
|
|
|
35
|
my $method_name = $_->[0]; |
21
|
18
|
|
|
|
|
30
|
my $header_tag = $_->[1]; |
22
|
|
|
|
|
|
|
|
23
|
18
|
50
|
|
1
|
1
|
2781
|
eval qq[ |
|
1
|
50
|
|
1
|
1
|
472
|
|
|
1
|
50
|
|
1
|
1
|
5
|
|
|
0
|
50
|
|
|
|
0
|
|
|
1
|
50
|
|
|
|
1
|
|
|
1
|
50
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
8
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
12
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
8
|
|
|
0
|
|
|
|
|
0
|
|
24
|
|
|
|
|
|
|
sub $method_name { |
25
|
|
|
|
|
|
|
my \$self = shift; |
26
|
|
|
|
|
|
|
if ( exists \$self->{'$method_name'} ) { |
27
|
|
|
|
|
|
|
return \$self->{'$method_name'}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my \$ht = \${\$self->{'header_text'}}; |
31
|
|
|
|
|
|
|
if ( \$ht =~ /$header_tag=(?>[^;]+);/ ) { |
32
|
|
|
|
|
|
|
return \$self->{'$method_name'} = |
33
|
|
|
|
|
|
|
substr( \$ht, |
34
|
|
|
|
|
|
|
\$-[0] + 2, |
35
|
|
|
|
|
|
|
\$+[0] - \$-[0] - 3 ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
]; |
41
|
18
|
50
|
|
|
|
3065
|
confess( $@ ) if $@; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub new { |
46
|
3
|
|
|
3
|
1
|
100
|
my $class = shift; |
47
|
3
|
|
|
|
|
6
|
my $p = shift; |
48
|
3
|
|
|
|
|
24
|
my $self = bless { %$p }, $class; |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
|
|
14
|
return $self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub body { |
54
|
3
|
|
|
3
|
1
|
537
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
3
|
100
|
|
|
|
12
|
if ( exists $self->{'uncompressed'} ) { |
57
|
1
|
|
|
|
|
4
|
return $self->{'uncompressed'}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
2
|
50
|
|
|
|
20
|
unless ( exists $self->{'compressed'} ) { |
61
|
0
|
|
|
|
|
0
|
confess "Record missing body!"; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
2
|
|
|
|
|
3
|
my $expt_len; |
65
|
|
|
|
|
|
|
# Inlined the ->expected_length method call here. |
66
|
2
|
100
|
|
|
|
9
|
if ( exists $self->{'expected_length'} ) { |
67
|
1
|
|
|
|
|
3
|
$expt_len = $self->{'expected_length'}; |
68
|
|
|
|
|
|
|
} else { |
69
|
1
|
50
|
|
|
|
1
|
if( ${$self->{'header_text'}} =~ /L=(?>[^;]+);/ ) { |
|
1
|
|
|
|
|
10
|
|
70
|
1
|
|
|
|
|
6
|
$expt_len = substr |
71
|
1
|
|
|
|
|
3
|
( ${$self->{'header_text'}}, |
72
|
|
|
|
|
|
|
$-[0] + 2, |
73
|
|
|
|
|
|
|
$+[0] - $-[0] - 3 ); |
74
|
|
|
|
|
|
|
} else { |
75
|
0
|
|
|
|
|
0
|
$expt_len = undef; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
2
|
|
|
|
|
13
|
$self->{'uncompressed'} = |
80
|
|
|
|
|
|
|
$self->{'uncompress_function'}( $self->{'compressed'}, |
81
|
|
|
|
|
|
|
$expt_len ); |
82
|
|
|
|
|
|
|
|
83
|
2
|
|
|
|
|
9
|
my $retr_len = length ${$self->{'uncompressed'}}; |
|
2
|
|
|
|
|
7
|
|
84
|
2
|
50
|
|
|
|
8
|
unless ( $expt_len == $retr_len ) { |
85
|
0
|
|
|
|
|
0
|
confess "Uncompressed record length $retr_len did not match expected " |
86
|
|
|
|
|
|
|
. "length $expt_len for record $self->{record_number}."; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
2
|
|
|
|
|
37
|
return $self->{'uncompressed'}; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
1
|
|
|
1
|
1
|
1328
|
sub header_length { length ${$_[0]->{'header_text'}} } |
|
1
|
|
|
|
|
7
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |