| 1 | package IO::Compress::Bzip2 ; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 59 | ▶ | use strict ; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 59 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 59 | ▶ | use bytes; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 59 | require Exporter ; | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 59 | ▶ | use IO::Compress::Base 2.225 ; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 59 | ▶ | use IO::Compress::Base::Common 2.225 qw(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 59 | ▶ | use IO::Compress::Adapter::Bzip2 2.225 ; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 59 | our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 59 | $VERSION = '2.225'; | |||||||||||||||||||||||||||||||||||||||||
| 18 | 59 | $Bzip2Error = ''; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 59 | @ISA = qw(IO::Compress::Base Exporter); | |||||||||||||||||||||||||||||||||||||||||
| 21 | 59 | @EXPORT_OK = qw( $Bzip2Error bzip2 ) ; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 59 | %EXPORT_TAGS = %IO::Compress::Base::EXPORT_TAGS ; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | $EXPORT_TAGS{all} = [ defined $EXPORT_TAGS{all} ? @{ $EXPORT_TAGS{all} } : (), @EXPORT_OK ] ; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 59 | Exporter::export_ok_tags('all'); | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | sub new | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 401 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 401 | my $class = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 401 | my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bzip2Error); | |||||||||||||||||||||||||||||||||||||||||
| 33 | 401 | return $obj->_create(undef, @_); | |||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | sub bzip2 | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 139 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bzip2: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 139 | my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bzip2Error); | |||||||||||||||||||||||||||||||||||||||||
| 39 | 139 | $obj->_def(@_); | |||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | sub mkHeader | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 526 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mkHeader: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 526 | my $self = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 46 | 526 | return ''; | |||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | sub getExtraParams | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 586 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getExtraParams: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 586 | my $self = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 59 | ▶ | use IO::Compress::Base::Common 2.225 qw(:Parse); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | return ( | ||||||||||||||||||||||||||||||||||||||||||
| 57 | 586 | 'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1], | |||||||||||||||||||||||||||||||||||||||||
| 58 | 'workfactor' => [IO::Compress::Base::Common::Parse_unsigned, 0], | ||||||||||||||||||||||||||||||||||||||||||
| 59 | 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0], | ||||||||||||||||||||||||||||||||||||||||||
| 60 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | sub ckParams | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 947 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ckParams: called CC=8 SCAR=20.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 947 | my $self = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 947 | my $got = shift; | |||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | # check that BlockSize100K is a number between 1 & 9 | ||||||||||||||||||||||||||||||||||||||||||
| 71 | 947 | ▶ | if ($got->parsed('blocksize100k')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 12 | my $value = $got->getValue('blocksize100k'); | |||||||||||||||||||||||||||||||||||||||||
| 73 | 12 | ▶ | return $self->saveErrorString(undef, "Parameter 'BlockSize100K' not between 1 and 9, got $value") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
defined $value and $value >= 1 and $value <= 9
defined $value and $value >= 1
MC/DC66%2/3
defined $value and $value >= 1 and $value <= 9
defined $value
$value >= 1
$value <= 9
Truth table75%3/4
A and B and C
A= defined $valueB= $value >= 1C= $value <= 9
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | unless defined $value && $value >= 1 && $value <= 9; | ||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | # check that WorkFactor between 0 & 250 | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 944 | ▶ | if ($got->parsed('workfactor')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | 253 | my $value = $got->getValue('workfactor'); | |||||||||||||||||||||||||||||||||||||||||
| 81 | 253 | ▶ | return $self->saveErrorString(undef, "Parameter 'WorkFactor' not between 0 and 250, got $value") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$value >= 0 and $value <= 250
MC/DC50%1/2
$value >= 0 and $value <= 250
$value >= 0
$value <= 250
Truth table66%2/3
A and B
A= $value >= 0B= $value <= 250
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | unless $value >= 0 && $value <= 250; | ||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | 942 | return 1 ; | |||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | sub mkComp | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 527 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mkComp: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 527 | my $self = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 92 | 527 | my $got = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 527 | my $BlockSize100K = $got->getValue('blocksize100k'); | |||||||||||||||||||||||||||||||||||||||||
| 95 | 527 | my $WorkFactor = $got->getValue('workfactor'); | |||||||||||||||||||||||||||||||||||||||||
| 96 | 527 | my $Verbosity = $got->getValue('verbosity'); | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 527 | my ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject( | |||||||||||||||||||||||||||||||||||||||||
| 99 | $BlockSize100K, $WorkFactor, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | $Verbosity); | ||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | 527 | ▶ | return $self->saveErrorString(undef, $errstr, $errno) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | if ! defined $obj; | ||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | 527 | return $obj; | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | sub mkTrailer | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 526 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mkTrailer: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 526 | my $self = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 112 | 526 | return ''; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | sub mkFinalTrailer | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 499 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mkFinalTrailer: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 499 | return ''; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | #sub newHeader | ||||||||||||||||||||||||||||||||||||||||||
| 121 | #{ | ||||||||||||||||||||||||||||||||||||||||||
| 122 | # my $self = shift ; | ||||||||||||||||||||||||||||||||||||||||||
| 123 | # return ''; | ||||||||||||||||||||||||||||||||||||||||||
| 124 | #} | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | sub getInverseClass | ||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getInverseClass: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | return ('IO::Uncompress::Bunzip2'); | |||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | sub getFileInfo | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 90 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getFileInfo: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 90 | my $self = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 134 | 90 | my $params = shift; | |||||||||||||||||||||||||||||||||||||||||
| 135 | 90 | my $file = shift ; | |||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | 59 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | __END__ | ||||||||||||||||||||||||||||||||||||||||||