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