| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Archive::SevenZip::Entry; |
|
2
|
12
|
|
|
12
|
|
89
|
use strict; |
|
|
12
|
|
|
|
|
25
|
|
|
|
12
|
|
|
|
|
364
|
|
|
3
|
12
|
|
|
12
|
|
62
|
use warnings; |
|
|
12
|
|
|
|
|
25
|
|
|
|
12
|
|
|
|
|
338
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
12
|
|
|
12
|
|
6785
|
use Archive::Zip::Member; |
|
|
12
|
|
|
|
|
859918
|
|
|
|
12
|
|
|
|
|
877
|
|
|
6
|
12
|
|
|
12
|
|
6343
|
use Time::Piece; # for strptime |
|
|
12
|
|
|
|
|
85906
|
|
|
|
12
|
|
|
|
|
72
|
|
|
7
|
12
|
|
|
12
|
|
929
|
use File::Basename (); |
|
|
12
|
|
|
|
|
27
|
|
|
|
12
|
|
|
|
|
193
|
|
|
8
|
12
|
|
|
12
|
|
5620
|
use Path::Class (); |
|
|
12
|
|
|
|
|
220481
|
|
|
|
12
|
|
|
|
|
5870
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION= '0.18'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
|
13
|
0
|
|
|
0
|
0
|
|
my( $class, %options) = @_; |
|
14
|
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
bless \%options => $class |
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub archive { |
|
19
|
|
|
|
|
|
|
$_[0]->{_Container} |
|
20
|
0
|
|
|
0
|
0
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub fileName { |
|
23
|
0
|
|
|
0
|
0
|
|
my( $self ) = @_; |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $res = $self->{Path}; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Normalize to unixy path names |
|
28
|
0
|
|
|
|
|
|
$res =~ s!\\!/!g; |
|
29
|
|
|
|
|
|
|
# If we're a directory, append the slash: |
|
30
|
0
|
0
|
0
|
|
|
|
if( exists $self->{Folder} and $self->{Folder} eq '+') { |
|
31
|
0
|
|
|
|
|
|
$res .= '/'; |
|
32
|
|
|
|
|
|
|
}; |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$res |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Class::Path API |
|
38
|
|
|
|
|
|
|
sub basename { |
|
39
|
0
|
|
|
0
|
0
|
|
Path::Class::file( $_[0]->{Path} )->basename |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub components { |
|
43
|
0
|
|
|
0
|
0
|
|
my $cp = file( $_[0]->{Path} ); |
|
44
|
0
|
|
|
|
|
|
$cp->components() |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub lastModTime { |
|
48
|
0
|
|
|
0
|
0
|
|
(my $dt = $_[0]->{Modified}) =~ s/\.\d+$//; |
|
49
|
0
|
|
|
|
|
|
Time::Piece->strptime($dt, '%Y-%m-%d %H:%M:%S')->epoch; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub lastModFileDateTime { |
|
53
|
0
|
|
|
0
|
0
|
|
Archive::Zip::Member::_unixToDosTime($_[0]->lastModTime()) |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub crc32 { |
|
57
|
0
|
|
|
0
|
0
|
|
hex( $_[0]->{CRC} ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub crc32String { |
|
61
|
0
|
|
|
0
|
0
|
|
lc $_[0]->{CRC}; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub desiredCompressionMethod { |
|
65
|
|
|
|
|
|
|
$_[0]->{Method} |
|
66
|
0
|
|
|
0
|
0
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub uncompressedSize { |
|
69
|
|
|
|
|
|
|
$_[0]->{Size} |
|
70
|
0
|
|
|
0
|
0
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub dir { |
|
73
|
|
|
|
|
|
|
# We need to return the appropriate class here |
|
74
|
|
|
|
|
|
|
# so that further calls to (like) dir->list |
|
75
|
|
|
|
|
|
|
# still work properly |
|
76
|
0
|
|
|
0
|
0
|
|
die "->dir Not implemented"; |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub open { |
|
80
|
0
|
|
|
0
|
0
|
|
my( $self, $mode, $permissions )= @_; |
|
81
|
0
|
|
|
|
|
|
$self->archive->openMemberFH( membername => $self->fileName, binmode => $mode ); |
|
82
|
|
|
|
|
|
|
} |
|
83
|
12
|
|
|
12
|
|
141
|
{ no warnings 'once'; |
|
|
12
|
|
|
|
|
48
|
|
|
|
12
|
|
|
|
|
2242
|
|
|
84
|
|
|
|
|
|
|
*fh = \&open; # Archive::Zip API |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
# Path::Class API |
|
88
|
|
|
|
|
|
|
sub slurp { |
|
89
|
0
|
|
|
0
|
0
|
|
my( $self, %options )= @_; |
|
90
|
0
|
|
|
|
|
|
my $fh = $self->archive->openMemberFH( membername => $self->fileName, binmode => $options{ iomode } ); |
|
91
|
0
|
|
|
|
|
|
local $/; |
|
92
|
|
|
|
|
|
|
<$fh> |
|
93
|
0
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# Archive::Zip API |
|
96
|
|
|
|
|
|
|
#externalFileName() |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# Archive::Zip API |
|
99
|
|
|
|
|
|
|
#fileName() |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Archive::Zip API |
|
102
|
|
|
|
|
|
|
#lastModFileDateTime() |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# Archive::Zip API |
|
105
|
|
|
|
|
|
|
#lastModTime() |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# Archive::Zip API |
|
108
|
|
|
|
|
|
|
sub extractToFileNamed { |
|
109
|
0
|
|
|
0
|
0
|
|
my($self, $target) = @_; |
|
110
|
0
|
|
|
|
|
|
$self->archive->extractMember( $self->fileName, $target ); |
|
111
|
|
|
|
|
|
|
}; |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
1; |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 REPOSITORY |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
The public repository of this module is |
|
118
|
|
|
|
|
|
|
L. |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 SUPPORT |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
The public support forum of this module is |
|
123
|
|
|
|
|
|
|
L. |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 BUG TRACKER |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Please report bugs in this module via the RT CPAN bug queue at |
|
128
|
|
|
|
|
|
|
L |
|
129
|
|
|
|
|
|
|
or via mail to L. |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 AUTHOR |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Max Maischein C |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 COPYRIGHT (c) |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Copyright 2015-2022 by Max Maischein C. |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 LICENSE |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
This module is released under the same terms as Perl itself. |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=cut |