line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin::ApplicationBzip2; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
126578
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
150
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
132
|
|
5
|
4
|
|
|
4
|
|
14
|
use vars qw($VERSION); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
208
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
17
|
use parent qw(MIME::Expander::Plugin); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
29
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
10
|
|
|
|
|
|
|
application/bzip2 |
11
|
|
|
|
|
|
|
)]); |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
2325
|
use IO::Uncompress::Bunzip2; |
|
4
|
|
|
|
|
83296
|
|
|
4
|
|
|
|
|
689
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub expand { |
16
|
3
|
|
|
3
|
0
|
7567
|
my $self = shift; |
17
|
3
|
|
|
|
|
35
|
my $part = shift; |
18
|
3
|
|
|
|
|
7
|
my $callback = shift; |
19
|
3
|
|
|
|
|
6
|
my $c = 0; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
14
|
my $contents = $part->body; |
22
|
3
|
50
|
|
|
|
335
|
my $z = IO::Uncompress::Bunzip2->new( |
23
|
|
|
|
|
|
|
\$contents, Append => 1, |
24
|
|
|
|
|
|
|
) or die "bzip2 failed: $IO::Uncompress::Bunzip2::Bunzip2Error"; |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
|
|
5381
|
my $buf; |
27
|
3
|
|
|
|
|
21
|
1 while( 0 < $z->read($buf) ); |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
50
|
|
|
163
|
my $h = $z->getHeaderInfo || {}; |
30
|
3
|
50
|
|
|
|
49
|
$callback->( \$buf, { |
31
|
|
|
|
|
|
|
filename => $h->{Name}, |
32
|
|
|
|
|
|
|
} ) if( ref $callback eq 'CODE' ); |
33
|
3
|
|
|
|
|
2776
|
++$c; |
34
|
|
|
|
|
|
|
|
35
|
3
|
|
|
|
|
49
|
return $c; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
__END__ |