| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 68 | 0 | return $_[0]->{'NAME'}; | |||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | 1 | 1; | |||||||||