line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OBEX::Packet::Request::SetPath; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
979
|
use strict; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
103
|
|
7
|
2
|
|
|
2
|
|
25
|
use base 'Net::OBEX::Packet::Request::Base'; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
1012
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.001001'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
2
|
|
|
2
|
1
|
6
|
my $class = shift; |
12
|
2
|
50
|
|
|
|
7
|
croak "Must have even number of arguments to new()" |
13
|
|
|
|
|
|
|
if @_ & 1; |
14
|
2
|
|
|
|
|
3
|
my %args = @_; |
15
|
2
|
|
|
|
|
7
|
$args{ +lc } = delete $args{ $_ } for keys %args; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
11
|
%args = ( |
18
|
|
|
|
|
|
|
do_up => 0, |
19
|
|
|
|
|
|
|
no_create => 1, |
20
|
|
|
|
|
|
|
constants => "\x00", |
21
|
|
|
|
|
|
|
headers => [], |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
%args, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
6
|
my $self = bless \%args, $class; |
27
|
|
|
|
|
|
|
|
28
|
2
|
50
|
|
|
|
6
|
my $flags = $args{no_create} ? '1' : '0'; |
29
|
2
|
50
|
|
|
|
7
|
$flags .= $args{do_up} ? '1' : '0'; |
30
|
2
|
|
|
|
|
13
|
$self->flags( pack 'B8', '000000' . $flags ); |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
8
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub make { |
36
|
2
|
|
|
2
|
1
|
1913
|
my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
5
|
my $packet; |
39
|
2
|
|
|
|
|
5
|
my $headers = join '', @{ $self->headers }; |
|
2
|
|
|
|
|
13
|
|
40
|
2
|
50
|
33
|
|
|
8
|
if ( $self->do_up and not length $headers ) { |
41
|
0
|
|
|
|
|
0
|
$packet = $self->flags . $self->constants; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
else { |
44
|
2
|
|
|
|
|
6
|
$packet = $self->flags . $self->constants . $headers; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
|
|
19
|
return $self->raw("\x85" . pack('n', 3 + length $packet) . $packet); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub flags { |
51
|
4
|
|
|
4
|
1
|
7
|
my $self = shift; |
52
|
4
|
100
|
|
|
|
12
|
if ( @_ ) { |
53
|
2
|
|
|
|
|
17
|
$self->{ flags } = shift; |
54
|
|
|
|
|
|
|
} |
55
|
4
|
|
|
|
|
16
|
return $self->{ flags }; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub do_up { |
59
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
60
|
2
|
50
|
|
|
|
8
|
if ( @_ ) { |
61
|
0
|
|
|
|
|
0
|
$self->{ do_up } = shift; |
62
|
|
|
|
|
|
|
} |
63
|
2
|
|
|
|
|
12
|
return $self->{ do_up }; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub constants { |
67
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
68
|
2
|
50
|
|
|
|
7
|
if ( @_ ) { |
69
|
0
|
|
|
|
|
0
|
$self->{ constants } = shift; |
70
|
|
|
|
|
|
|
} |
71
|
2
|
|
|
|
|
8
|
return $self->{ constants }; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub no_create { |
75
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
76
|
0
|
0
|
|
|
|
|
if ( @_ ) { |
77
|
0
|
|
|
|
|
|
$self->{ no_create } = shift; |
78
|
|
|
|
|
|
|
} |
79
|
0
|
|
|
|
|
|
return $self->{ no_create }; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |