line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
56
|
use utf8; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
44
|
|
2
|
11
|
|
|
11
|
|
304
|
use strict; |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
163
|
|
3
|
11
|
|
|
11
|
|
37
|
use warnings; |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
285
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package DR::Tnt::Msgpack::Types::Blob; |
6
|
11
|
|
|
11
|
|
43
|
use Carp; |
|
11
|
|
|
|
|
13
|
|
|
11
|
|
|
|
|
2256
|
|
7
|
|
|
|
|
|
|
$Carp::Internal{ (__PACKAGE__) }++; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
13
|
|
|
13
|
0
|
24
|
my ($class, $v) = @_; |
11
|
13
|
|
33
|
|
|
74
|
bless \$v => ref($class) || $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub TO_MSGPACK { |
15
|
10
|
|
|
10
|
0
|
15
|
my ($self) = @_; |
16
|
10
|
|
|
|
|
15
|
my $v = $$self; |
17
|
|
|
|
|
|
|
|
18
|
10
|
50
|
|
|
|
19
|
return pack 'C', 0xC0 unless defined $v; |
19
|
|
|
|
|
|
|
|
20
|
10
|
100
|
|
|
|
19
|
utf8::encode $v if utf8::is_utf8 $v; |
21
|
10
|
|
|
|
|
13
|
my $len = length $v; |
22
|
|
|
|
|
|
|
|
23
|
10
|
100
|
|
|
|
60
|
return pack 'CC/a*', 0xC4, $v if $len <= 0xFF; |
24
|
2
|
100
|
|
|
|
17
|
return pack 'CS>/a*', 0xC5, $v if $len <= 0xFFFF; |
25
|
1
|
|
|
|
|
687
|
return pack 'CL>/a*', 0xC6, $v; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub TO_JSON { |
29
|
1
|
|
|
1
|
0
|
2
|
my ($self) = @_; |
30
|
1
|
|
|
|
|
3
|
return $$self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
DR::Tnt::Msgpack::Types::Blob - container for blob. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
use DR::Tnt::Msgpack::Types::Blob; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $o = DR::Tnt::Msgpack::Types::Blob->new(123); |
42
|
|
|
|
|
|
|
my $blob = msgpack($o); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
See L. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|