line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::Transform; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
100
|
use strictures 1; |
|
16
|
|
|
|
|
96
|
|
|
16
|
|
|
|
|
405
|
|
4
|
16
|
|
|
16
|
|
1616
|
use base qw(HTML::Zoom::SubObject); |
|
16
|
|
|
|
|
48
|
|
|
16
|
|
|
|
|
10888
|
|
5
|
16
|
|
|
16
|
|
10676
|
use HTML::Zoom::TransformedStream; |
|
16
|
|
|
|
|
53
|
|
|
16
|
|
|
|
|
6374
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
296
|
|
|
296
|
0
|
450
|
my ($class, $args) = @_; |
9
|
296
|
|
|
|
|
930
|
my $new = $class->SUPER::new($args); |
10
|
296
|
|
|
|
|
680
|
$new->{selector} = $args->{selector}; |
11
|
296
|
50
|
|
|
|
738
|
$new->{match} = $args->{match} if $args->{match}; |
12
|
296
|
|
50
|
|
|
951
|
$new->{filters} = $args->{filters}||[]; |
13
|
296
|
|
|
|
|
3389
|
$new; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
266
|
|
|
266
|
0
|
849
|
sub selector { shift->{selector} } |
17
|
|
|
|
|
|
|
|
18
|
257
|
|
|
257
|
0
|
1270
|
sub filters { shift->{filters} } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub with_filter { |
21
|
130
|
|
|
130
|
0
|
212
|
my ($self, $filter) = @_; |
22
|
130
|
|
|
|
|
276
|
(ref $self)->new({ |
23
|
|
|
|
|
|
|
selector => $self->selector, |
24
|
|
|
|
|
|
|
($self->{match} ? (match => $self->{match}) : ()), |
25
|
130
|
50
|
|
|
|
339
|
filters => [ @{$self->filters}, $filter ] |
26
|
|
|
|
|
|
|
}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub match { |
30
|
130
|
|
|
130
|
0
|
194
|
my ($self) = @_; |
31
|
130
|
|
66
|
|
|
588
|
$self->{match} ||= |
32
|
|
|
|
|
|
|
$self->_zconfig |
33
|
|
|
|
|
|
|
->selector_parser |
34
|
|
|
|
|
|
|
->parse_selector($self->{selector}); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub apply_to_stream { |
38
|
130
|
|
|
130
|
0
|
192
|
my ($self, $stream) = @_; |
39
|
130
|
|
|
|
|
434
|
HTML::Zoom::TransformedStream->new({ |
40
|
|
|
|
|
|
|
stream => $stream, |
41
|
|
|
|
|
|
|
transform => $self, |
42
|
|
|
|
|
|
|
zconfig => $self->_zconfig, |
43
|
|
|
|
|
|
|
}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |