Hotline/FileListItem.pm

filter: Statementstmt 33.3% 8 / 24 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 28.5% 2 / 7 Podpod 100% 5 / 5 totaltotal 32.6% 15 / 46 CC 6 SCAR 16.4
CC
6
Cov
24%
new
6.0
type
6.0
creator
6.0
CRAP 5.2
« Hotline/FileInfoItem.pm ↑ Summary Hotline/Protocol/Header.pm »
1 package Net::Hotline::FileListItem;
2  
3 ## Copyright(c) 1998-2002 by John C. Siracusa. All rights reserved. This
4 ## program is free software; you can redistribute it and/or modify it under
5 ## the same terms as Perl itself.
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 $VERSION = '0.80';
12  
13 sub new
14 0 ▶{
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
15 0 my($class, $data) = @_;
16 0 my($self);
17  
18 0 ▶ if(defined($data))
Branch: 1 branch
BranchTrueFalseTotal
if (defined $data) { } 0 0 0
19 {
20 0 my($name_len) = unpack("L", substr($data, 16, 4));
21  
22 0 $self =
23 {
24 'TYPE' => substr($data, 0, 4),
25 'CREATOR' => substr($data, 4, 4),
26 'SIZE' => unpack("N", substr($data, 8, 4)),
27 'UNKNOWN' => substr($data, 12, 4),
28 'NAME' => substr($data, 20, $name_len)
29 };
30 }
31 else
32 {
33 0 $self =
34 {
35 'TYPE' => undef,
36 'CREATOR' => undef,
37 'SIZE' => 0x00000000,
38 'UNKNOWN' => 0x00000000,
39 'NAME' => undef
40 };
41 }
42  
43 0 bless $self, $class;
44 0 return $self;
45 }
46  
47 sub type
48 0 ▶{
Subroutine type: not called CC=2 SCAR=17.9
Pod documented
49 0 ▶ $_[0]->{'TYPE'} = $_[1] if(@_ == 2);
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 0 0 0
50 0 return $_[0]->{'TYPE'};
51 }
52  
53 sub creator
54 0 ▶{
Subroutine creator: not called CC=2 SCAR=17.9
Pod documented
55 0 ▶ $_[0]->{'CREATOR'} = $_[1] if(@_ == 2);
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 0 0 0
56 0 return $_[0]->{'CREATOR'};
57 }
58  
59 sub size
60 0 ▶{
Subroutine size: not called CC=2 SCAR=17.9
Pod documented
61 0 ▶ $_[0]->{'SIZE'} = $_[1] if(@_ == 2);
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 0 0 0
62 0 return $_[0]->{'SIZE'};
63 }
64  
65 sub name
66 0 ▶{
Subroutine name: not called CC=2 SCAR=17.9
Pod documented
67 0 ▶ $_[0]->{'NAME'} = $_[1] if(@_ == 2);
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 2 0 0 0
68 0 return $_[0]->{'NAME'};
69 }
70  
71 1 1;
« Hotline/FileInfoItem.pm ↑ Summary Hotline/Protocol/Header.pm »