| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Archive::Zip::FileMember; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 28 |  |  | 28 |  | 173 | use strict; | 
|  | 28 |  |  |  |  | 60 |  | 
|  | 28 |  |  |  |  | 855 |  | 
| 4 | 28 |  |  | 28 |  | 132 | use vars qw( $VERSION @ISA ); | 
|  | 28 |  |  |  |  | 51 |  | 
|  | 28 |  |  |  |  | 1668 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | BEGIN { | 
| 7 | 28 |  |  | 28 |  | 84 | $VERSION = '1.67'; | 
| 8 | 28 |  |  |  |  | 1134 | @ISA     = qw ( Archive::Zip::Member ); | 
| 9 |  |  |  |  |  |  | } | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 28 |  |  |  |  | 12178 | use Archive::Zip qw( | 
| 12 |  |  |  |  |  |  | :UTILITY_METHODS | 
| 13 | 28 |  |  | 28 |  | 161 | ); | 
|  | 28 |  |  |  |  | 58 |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | sub externalFileName { | 
| 16 | 447 |  |  | 447 | 1 | 1630 | shift->{'externalFileName'}; | 
| 17 |  |  |  |  |  |  | } | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | # Return true if I depend on the named file | 
| 20 |  |  |  |  |  |  | sub _usesFileNamed { | 
| 21 | 108 |  |  | 108 |  | 163 | my $self     = shift; | 
| 22 | 108 |  |  |  |  | 136 | my $fileName = shift; | 
| 23 | 108 |  |  |  |  | 193 | my $xfn      = $self->externalFileName(); | 
| 24 | 108 | 50 |  |  |  | 216 | return undef if ref($xfn); | 
| 25 | 108 |  |  |  |  | 467 | return $xfn eq $fileName; | 
| 26 |  |  |  |  |  |  | } | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | sub fh { | 
| 29 | 1572 |  |  | 1572 | 1 | 1908 | my $self = shift; | 
| 30 |  |  |  |  |  |  | $self->_openFile() | 
| 31 | 1572 | 100 | 66 |  |  | 4335 | if !defined($self->{'fh'}) || !$self->{'fh'}->opened(); | 
| 32 | 1572 |  |  |  |  | 9882 | return $self->{'fh'}; | 
| 33 |  |  |  |  |  |  | } | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | # opens my file handle from my file name | 
| 36 |  |  |  |  |  |  | sub _openFile { | 
| 37 | 197 |  |  | 197 |  | 250 | my $self = shift; | 
| 38 | 197 |  |  |  |  | 426 | my ($status, $fh) = _newFileHandle($self->externalFileName(), 'r'); | 
| 39 | 197 | 50 |  |  |  | 594 | if (!$status) { | 
| 40 | 0 |  |  |  |  | 0 | _ioError("Can't open", $self->externalFileName()); | 
| 41 | 0 |  |  |  |  | 0 | return undef; | 
| 42 |  |  |  |  |  |  | } | 
| 43 | 197 |  |  |  |  | 410 | $self->{'fh'} = $fh; | 
| 44 | 197 |  |  |  |  | 507 | _binmode($fh); | 
| 45 | 197 |  |  |  |  | 2748 | return $fh; | 
| 46 |  |  |  |  |  |  | } | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | # Make sure I close my file handle | 
| 49 |  |  |  |  |  |  | sub endRead { | 
| 50 | 470 |  |  | 470 | 1 | 686 | my $self = shift; | 
| 51 | 470 |  |  |  |  | 2699 | undef $self->{'fh'};    # _closeFile(); | 
| 52 | 470 |  |  |  |  | 1496 | return $self->SUPER::endRead(@_); | 
| 53 |  |  |  |  |  |  | } | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | sub _become { | 
| 56 | 18 |  |  | 18 |  | 44 | my $self     = shift; | 
| 57 | 18 |  |  |  |  | 32 | my $newClass = shift; | 
| 58 | 18 | 50 |  |  |  | 62 | return $self if ref($self) eq $newClass; | 
| 59 | 18 |  |  |  |  | 57 | delete($self->{'externalFileName'}); | 
| 60 | 18 |  |  |  |  | 174 | delete($self->{'fh'}); | 
| 61 | 18 |  |  |  |  | 114 | return $self->SUPER::_become($newClass); | 
| 62 |  |  |  |  |  |  | } | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | 1; |