| 1 | package EPUB::Parser::Util::EpubLoad; | ||||||||||||
| 2 | 14 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 14 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 14 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 14 | ▶ | use Archive::Zip qw/:ERROR_CODES/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 13 | ▶ | sub load_file { | ||||||||||
|
Subroutine
load_file: called CC=4 SCAR=14.5
Pod
undocumented
| |||||||||||||
| 8 | 13 | my $class = shift; | |||||||||||
| 9 | 13 | ▶ | my $args = shift || {}; | ||||||||||
|
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 10 | 13 | ▶ | my $file_path = $args->{file_path} or croak "mandatory parameter 'file_path'"; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 11 | |||||||||||||
| 12 | 13 | my $zip = Archive::Zip->new(); | |||||||||||
| 13 | 13 | ▶ | ( $zip->read( $file_path ) == AZ_OK() ) or die 'read error'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | |||||||||||||
| 15 | 13 | return $zip; | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 1 | ▶ | sub load_binary { | ||||||||||
|
Subroutine
load_binary: called CC=4 SCAR=14.3
Pod
undocumented
| |||||||||||||
| 19 | 1 | my $class = shift; | |||||||||||
| 20 | 1 | ▶ | my $args = shift || {}; | ||||||||||
|
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 21 | 1 | ▶ | my $zip_data = $args->{data} or croak "mandatory parameter 'data'"; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | |||||||||||||
| 23 | 1 | require IO::String; | |||||||||||
| 24 | 1 | my $zip = Archive::Zip->new(); | |||||||||||
| 25 | 1 | ▶ | ( $zip->readFromFileHandle( IO::String->new($zip_data) ) == AZ_OK() ) or die 'open error'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | |||||||||||||
| 27 | 1 | return $zip; | |||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | |||||||||||||
| 31 | |||||||||||||
| 32 | 14 | 1; | |||||||||||