line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin::ApplicationBzip2; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
31610
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
149
|
|
4
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
151
|
|
5
|
4
|
|
|
4
|
|
20
|
use vars qw($VERSION); |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
261
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1024
|
use parent qw(MIME::Expander::Plugin); |
|
4
|
|
|
|
|
375
|
|
|
4
|
|
|
|
|
42
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
10
|
|
|
|
|
|
|
application/bzip2 |
11
|
|
|
|
|
|
|
application/x-bzip2 |
12
|
|
|
|
|
|
|
)]); |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
3630
|
use IO::Uncompress::Bunzip2; |
|
4
|
|
|
|
|
138712
|
|
|
4
|
|
|
|
|
772
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub expand { |
17
|
3
|
|
|
3
|
0
|
8
|
my $self = shift; |
18
|
3
|
|
|
|
|
7
|
my $contents = shift; |
19
|
3
|
|
|
|
|
26
|
my $callback = shift; |
20
|
3
|
|
|
|
|
7
|
my $c = 0; |
21
|
|
|
|
|
|
|
|
22
|
3
|
50
|
|
|
|
46
|
my $z = IO::Uncompress::Bunzip2->new( |
|
|
50
|
|
|
|
|
|
23
|
|
|
|
|
|
|
ref $contents eq 'SCALAR' ? $contents : \$contents |
24
|
|
|
|
|
|
|
, Append => 1) |
25
|
|
|
|
|
|
|
or die "bzip2 failed: $IO::Uncompress::Bunzip2::Bunzip2Error"; |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
|
|
6194
|
my $buf; |
28
|
3
|
|
|
|
|
13
|
1 while( 0 < $z->read($buf) ); |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
50
|
|
|
332
|
my $h = $z->getHeaderInfo || {}; |
31
|
3
|
50
|
|
|
|
44
|
$callback->( \$buf, { |
32
|
|
|
|
|
|
|
filename => $h->{Name}, |
33
|
|
|
|
|
|
|
} ) if( ref $callback eq 'CODE' ); |
34
|
3
|
|
|
|
|
10139
|
++$c; |
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
|
|
56
|
return $c; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
__END__ |