line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Entity::Parser::JSON; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
73180
|
use strict; |
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
155
|
|
4
|
5
|
|
|
5
|
|
29
|
use warnings; |
|
5
|
|
|
|
|
57
|
|
|
5
|
|
|
|
|
150
|
|
5
|
5
|
|
|
5
|
|
2015
|
use JSON::MaybeXS qw/decode_json/; |
|
5
|
|
|
|
|
25385
|
|
|
5
|
|
|
|
|
290
|
|
6
|
5
|
|
|
5
|
|
2883
|
use Encode qw/encode_utf8/; |
|
5
|
|
|
|
|
73096
|
|
|
5
|
|
|
|
|
1254
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
1
|
|
|
1
|
0
|
98
|
bless [''], $_[0]; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub add { |
13
|
7
|
|
|
7
|
0
|
23
|
my $self = shift; |
14
|
7
|
50
|
|
|
|
15
|
if (defined $_[0]) { |
15
|
7
|
|
|
|
|
22
|
$self->[0] .= $_[0]; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub finalize { |
20
|
1
|
|
|
1
|
0
|
5
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
15
|
my $p = decode_json($self->[0]); |
23
|
1
|
|
|
|
|
3
|
my @params; |
24
|
1
|
50
|
|
|
|
5
|
if (ref $p eq 'HASH') { |
25
|
1
|
|
|
|
|
8
|
while (my ($k, $v) = each %$p) { |
26
|
5
|
100
|
|
|
|
11
|
if (ref $v) { |
27
|
3
|
|
|
|
|
20
|
push @params, encode_utf8($k), $v; |
28
|
|
|
|
|
|
|
} else { |
29
|
2
|
|
|
|
|
15
|
push @params, encode_utf8($k), encode_utf8($v); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
1
|
|
|
|
|
7
|
return (\@params, []); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |