line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OBEX::Packet::Request::Put; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
950
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
71
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.001001'; # VERSION |
6
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
111
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
9
|
use base 'Net::OBEX::Packet::Request::Base'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
654
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# opcodes 0x02 (0x82) |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
1
|
6
|
my $class = shift; |
14
|
2
|
50
|
|
|
|
6
|
croak "Must have even number of arguments to new()" |
15
|
|
|
|
|
|
|
if @_ & 1; |
16
|
2
|
|
|
|
|
3
|
my %args = @_; |
17
|
2
|
|
|
|
|
8
|
$args{ +lc } = delete $args{ $_ } for keys %args; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
7
|
%args = ( |
20
|
|
|
|
|
|
|
is_final => 0, |
21
|
|
|
|
|
|
|
headers => [], |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
%args, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
10
|
return bless \%args, $class; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub make { |
30
|
2
|
|
|
2
|
1
|
1810
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
2
|
50
|
|
|
|
9
|
my $packet = $self->is_final() ? "\x82" : "\x02"; |
33
|
2
|
|
|
|
|
4
|
my $headers = join '', @{$self->headers}; |
|
2
|
|
|
|
|
12
|
|
34
|
2
|
|
|
|
|
8
|
$packet .= pack 'n', 3+length $headers; |
35
|
2
|
|
|
|
|
4
|
$packet .= $headers; |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
11
|
return $self->raw($packet); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub is_final { |
41
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
42
|
2
|
50
|
|
|
|
8
|
if ( @_ ) { |
43
|
0
|
|
|
|
|
0
|
$self->{ is_final } = shift; |
44
|
|
|
|
|
|
|
} |
45
|
2
|
|
|
|
|
15
|
return $self->{ is_final }; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |