line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package APR::HTTP::Headers::Compat::MagicArray; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
51
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1417
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
APR::HTTP::Headers::Compat::MagicArray - magic array for multivalue headers |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=cut |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub TIEARRAY { |
13
|
0
|
|
|
0
|
|
|
my ( $class, $fld, $magic, @vals ) = @_; |
14
|
0
|
|
|
|
|
|
return bless { |
15
|
|
|
|
|
|
|
a => \@vals, |
16
|
|
|
|
|
|
|
f => $fld, |
17
|
|
|
|
|
|
|
m => $magic, |
18
|
|
|
|
|
|
|
}, $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub FETCH { |
22
|
0
|
|
|
0
|
|
|
my ( $self, $key ) = @_; |
23
|
0
|
|
|
|
|
|
return $self->{a}[$key]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Sync the table with our state |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _sync { |
29
|
0
|
|
|
0
|
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
my ( $table, $fld, @vals ) |
31
|
0
|
|
|
|
|
|
= ( $self->{m}->table, $self->{f}, @{ $self->{a} } ); |
32
|
0
|
|
|
|
|
|
$table->set( $fld, shift @vals ); |
33
|
0
|
|
|
|
|
|
$table->add( $fld, $_ ) for @vals; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub STORE { |
37
|
0
|
|
|
0
|
|
|
my ( $self, $key, $value ) = @_; |
38
|
0
|
|
|
|
|
|
$self->{a}[$key] = $value; |
39
|
0
|
|
|
|
|
|
$self->_sync; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
|
|
sub FETCHSIZE { scalar @{ shift->{a} } } |
|
0
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
|
|
sub STORESIZE { } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub CLEAR { |
46
|
0
|
|
|
0
|
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
$self->{a} = []; |
48
|
0
|
|
|
|
|
|
$self->_sync; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub PUSH { |
52
|
0
|
|
|
0
|
|
|
my ( $self, @list ) = @_; |
53
|
0
|
|
|
|
|
|
push @{ $self->{a} }, @list; |
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
$self->_sync; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub POP { |
58
|
0
|
|
|
0
|
|
|
my $self = shift; |
59
|
0
|
|
|
|
|
|
my $val = pop @{ $self->{a} }; |
|
0
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
$self->_sync; |
61
|
0
|
|
|
|
|
|
return $val; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub SHIFT { |
65
|
0
|
|
|
0
|
|
|
my $self = shift; |
66
|
0
|
|
|
|
|
|
my $val = shift @{ $self->{a} }; |
|
0
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$self->_sync; |
68
|
0
|
|
|
|
|
|
return $val; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub UNSHIFT { |
72
|
0
|
|
|
0
|
|
|
my ( $self, @list ) = @_; |
73
|
0
|
|
|
|
|
|
unshift @{ $self->{a} }, @list; |
|
0
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
$self->_sync; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub SPLICE { |
78
|
0
|
|
|
0
|
|
|
my ( $self, $offset, $length, @list ) = @_; |
79
|
0
|
|
|
|
|
|
splice @{ $self->{a} }, $offset, $length, @list; |
|
0
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
$self->_sync; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub EXISTS { |
84
|
0
|
|
|
0
|
|
|
my ( $self, $key ) = @_; |
85
|
0
|
|
|
|
|
|
return $key < @{ $self->{a} }; |
|
0
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
0
|
|
|
sub EXTEND { } |
89
|
0
|
|
|
0
|
|
|
sub DESTROY { } |
90
|
0
|
|
|
0
|
|
|
sub UNTIE { } |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# vim:ts=2:sw=2:sts=2:et:ft=perl |