| 1 | package IO::Uncompress::Adapter::Bunzip2; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 87 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 87 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 87 | ▶ | use bytes; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 87 | ▶ | use IO::Compress::Base::Common 2.225 qw(:Status); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 87 | ▶ | use Compress::Raw::Bzip2 2.225 ; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 87 | our ($VERSION, @ISA); | |||||||||||||||||||||||||||
| 12 | 87 | $VERSION = '2.225'; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub mkUncompObject | ||||||||||||||||||||||||||||
| 15 | 798 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
mkUncompObject: called CC=4 SCAR=14.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 798 | ▶ | my $small = shift || 0; | ||||||||||||||||||||||||||
|
Condition100%2/2
shift() || 0
MC/DC100%1/1
shift() || 0
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 17 | 798 | ▶ | my $verbosity = shift || 0; | ||||||||||||||||||||||||||
|
Condition50%1/2
shift() || 0
MC/DC0%0/1
shift() || 0
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 798 | my ($inflate, $status) = Compress::Raw::Bunzip2->new(1, 1, $small, $verbosity, 1); | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 798 | ▶ | return (undef, "Could not create Inflation object: $status", $status) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | if $status != BZ_OK ; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 798 | return bless {'Inf' => $inflate, | |||||||||||||||||||||||||||
| 25 | 'CompSize' => 0, | ||||||||||||||||||||||||||||
| 26 | 'UnCompSize' => 0, | ||||||||||||||||||||||||||||
| 27 | 'Error' => '', | ||||||||||||||||||||||||||||
| 28 | 'ConsumesInput' => 1, | ||||||||||||||||||||||||||||
| 29 | } ; | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub uncompr | ||||||||||||||||||||||||||||
| 34 | 1105 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
uncompr: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 1105 | my $self = shift ; | |||||||||||||||||||||||||||
| 36 | 1105 | my $from = shift ; | |||||||||||||||||||||||||||
| 37 | 1105 | my $to = shift ; | |||||||||||||||||||||||||||
| 38 | 1105 | my $eof = shift ; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1105 | my $inf = $self->{Inf}; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 1105 | my $status = $inf->bzinflate($from, $to); | |||||||||||||||||||||||||||
| 43 | 1105 | $self->{ErrorNo} = $status; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 1105 | ▶ | if ($status != BZ_OK && $status != BZ_STREAM_END ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$status != BZ_OK() and $status != BZ_STREAM_END()
MC/DC100%2/2
$status != BZ_OK() and $status != BZ_STREAM_END()
$status != BZ_OK()
$status != BZ_STREAM_END()
Truth table100%3/3
A and B
A= $status != BZ_OK()B= $status != BZ_STREAM_END()
| |||||||||||||||||||||||||||||
| 46 | { | ||||||||||||||||||||||||||||
| 47 | 2 | $self->{Error} = "Inflation Error: $status"; | |||||||||||||||||||||||||||
| 48 | 2 | return STATUS_ERROR; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 1103 | ▶ | return STATUS_OK if $status == BZ_OK ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 53 | 1101 | ▶ | return STATUS_ENDSTREAM if $status == BZ_STREAM_END ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | 0 | return STATUS_ERROR ; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | sub reset | ||||||||||||||||||||||||||||
| 59 | 350 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
reset: called CC=3 SCAR=12.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 60 | 350 | my $self = shift ; | |||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 350 | my ($inf, $status) = Compress::Raw::Bunzip2->new(); | |||||||||||||||||||||||||||
| 63 | 350 | ▶ | $self->{ErrorNo} = ($status == BZ_OK) ? 0 : $status ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 350 | ▶ | if ($status != BZ_OK) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | { | ||||||||||||||||||||||||||||
| 67 | 0 | $self->{Error} = "Cannot create Inflate object: $status"; | |||||||||||||||||||||||||||
| 68 | 0 | return STATUS_ERROR; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 350 | $self->{Inf} = $inf; | |||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 350 | return STATUS_OK ; | |||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | sub compressedBytes | ||||||||||||||||||||||||||||
| 77 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
compressedBytes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 78 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 79 | 0 | $self->{Inf}->compressedBytes(); | |||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | sub uncompressedBytes | ||||||||||||||||||||||||||||
| 83 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
uncompressedBytes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 84 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 85 | 0 | $self->{Inf}->uncompressedBytes(); | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | sub crc32 | ||||||||||||||||||||||||||||
| 89 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
crc32: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 90 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 91 | #$self->{Inf}->crc32(); | ||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | sub adler32 | ||||||||||||||||||||||||||||
| 95 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
adler32: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 96 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 97 | #$self->{Inf}->adler32(); | ||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | sub sync | ||||||||||||||||||||||||||||
| 101 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
sync: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 102 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 103 | #( $self->{Inf}->inflateSync(@_) == BZ_OK) | ||||||||||||||||||||||||||||
| 104 | # ? STATUS_OK | ||||||||||||||||||||||||||||
| 105 | # : STATUS_ERROR ; | ||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 87 | 1; | |||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | __END__ | ||||||||||||||||||||||||||||