line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OBEX::Packet::Request; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
44733
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
107
|
|
7
|
2
|
|
|
2
|
|
551
|
use Net::OBEX::Packet::Request::Connect; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
8
|
2
|
|
|
2
|
|
538
|
use Net::OBEX::Packet::Request::Disconnect; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
35
|
|
9
|
2
|
|
|
2
|
|
534
|
use Net::OBEX::Packet::Request::Get; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
46
|
|
10
|
2
|
|
|
2
|
|
538
|
use Net::OBEX::Packet::Request::Put; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
11
|
2
|
|
|
2
|
|
571
|
use Net::OBEX::Packet::Request::SetPath; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
43
|
|
12
|
2
|
|
|
2
|
|
533
|
use Net::OBEX::Packet::Request::Abort; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1102
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '1.001001'; # VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my %Valid_Packets = map { $_ => 1 } |
17
|
|
|
|
|
|
|
qw(connect disconnect get put setpath abort); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my %Make_Packet = ( |
20
|
|
|
|
|
|
|
connect => sub { _make_connect( shift ); }, |
21
|
|
|
|
|
|
|
disconnect => sub { _make_disconnect( shift ); }, |
22
|
|
|
|
|
|
|
get => sub { _make_get( shift ); }, |
23
|
|
|
|
|
|
|
put => sub { _make_put( shift ); }, |
24
|
|
|
|
|
|
|
setpath => sub { _make_setpath( shift ); }, |
25
|
|
|
|
|
|
|
abort => sub { _make_abort( shift ); }, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
1
|
|
|
1
|
1
|
352
|
my $class = shift; |
30
|
1
|
|
|
|
|
5
|
return bless {}, $class; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub make { |
34
|
6
|
|
|
6
|
1
|
1766
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
6
|
50
|
|
|
|
20
|
croak "Must have even number of arguments to new()" |
37
|
|
|
|
|
|
|
if @_ & 1; |
38
|
|
|
|
|
|
|
|
39
|
6
|
|
|
|
|
16
|
my %args = @_; |
40
|
6
|
|
|
|
|
31
|
$args{ +lc } = delete $args{ $_ } for keys %args; |
41
|
|
|
|
|
|
|
|
42
|
6
|
50
|
|
|
|
21
|
croak "Invalid packet name was specified (the `packet` argument)" |
43
|
|
|
|
|
|
|
unless exists $Valid_Packets{ $args{packet} }; |
44
|
|
|
|
|
|
|
|
45
|
6
|
|
|
|
|
10
|
my $make_ref = $Make_Packet{ $args{packet} }; |
46
|
6
|
|
|
|
|
11
|
delete $args{packet}; |
47
|
6
|
|
|
|
|
18
|
return $make_ref->( \%args ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _make_connect { |
51
|
1
|
|
|
1
|
|
3
|
my $args = shift; |
52
|
1
|
|
|
|
|
12
|
return Net::OBEX::Packet::Request::Connect->new( %$args )->make; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub _make_disconnect { |
56
|
1
|
|
|
1
|
|
2
|
my $args = shift; |
57
|
1
|
|
|
|
|
14
|
return Net::OBEX::Packet::Request::Disconnect->new( %$args )->make; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub _make_get { |
61
|
1
|
|
|
1
|
|
1
|
my $args = shift; |
62
|
1
|
|
|
|
|
10
|
return Net::OBEX::Packet::Request::Get->new( %$args )->make; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub _make_put { |
66
|
1
|
|
|
1
|
|
2
|
my $args = shift; |
67
|
1
|
|
|
|
|
10
|
return Net::OBEX::Packet::Request::Put->new( %$args )->make; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub _make_setpath { |
71
|
1
|
|
|
1
|
|
2
|
my $args = shift; |
72
|
1
|
|
|
|
|
9
|
return Net::OBEX::Packet::Request::SetPath->new( %$args )->make; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub _make_abort { |
76
|
1
|
|
|
1
|
|
3
|
my $args = shift; |
77
|
1
|
|
|
|
|
15
|
return Net::OBEX::Packet::Request::Abort->new( %$args )->make; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |