| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::Feature::Decoder; |
|
2
|
1
|
|
|
1
|
|
1271
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
38
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
27
|
|
|
4
|
1
|
|
|
1
|
|
2658
|
use Data::Decode; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Data::Decode::Chain; |
|
6
|
|
|
|
|
|
|
use Data::Decode::Encode::Guess; |
|
7
|
|
|
|
|
|
|
use Data::Decode::Encode::Guess::JP; |
|
8
|
|
|
|
|
|
|
use Data::Decode::Encode::HTTP::Response; |
|
9
|
|
|
|
|
|
|
use base qw(HTML::Feature::Base); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors($_) for qw(decoder); |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
|
14
|
|
|
|
|
|
|
my $class = shift; |
|
15
|
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
|
16
|
|
|
|
|
|
|
$self->_setup; |
|
17
|
|
|
|
|
|
|
return $self; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _setup { |
|
21
|
|
|
|
|
|
|
my $self = shift; |
|
22
|
|
|
|
|
|
|
my $decoder = Data::Decode->new( |
|
23
|
|
|
|
|
|
|
strategy => Data::Decode::Chain->new( |
|
24
|
|
|
|
|
|
|
decoders => [ |
|
25
|
|
|
|
|
|
|
Data::Decode::Encode::HTTP::Response->new, |
|
26
|
|
|
|
|
|
|
Data::Decode::Encode::Guess::JP->new, |
|
27
|
|
|
|
|
|
|
Data::Decode::Encode::Guess->new, |
|
28
|
|
|
|
|
|
|
] |
|
29
|
|
|
|
|
|
|
) |
|
30
|
|
|
|
|
|
|
); |
|
31
|
|
|
|
|
|
|
$self->decoder($decoder); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub decode { |
|
35
|
|
|
|
|
|
|
my $self = shift; |
|
36
|
|
|
|
|
|
|
my $data = shift; |
|
37
|
|
|
|
|
|
|
my $decoded = $self->decoder->decode($data); |
|
38
|
|
|
|
|
|
|
return $decoded; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
|
42
|
|
|
|
|
|
|
__END__ |