| 1 | package IO::Uncompress::Adapter::UnZstd; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 12 | ▶ | use bytes; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 12 | ▶ | use IO::Compress::Base::Common 2.224 qw(:Status); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 12 | ▶ | use Compress::Stream::Zstd ; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 12 | ▶ | use Compress::Stream::Zstd::Decompressor qw(ZSTD_DSTREAM_IN_SIZE); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 12 | our ($VERSION, @ISA); | |||||||||||||||||||||||||||
| 11 | 12 | $VERSION = '2.224'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub mkUncompObject | ||||||||||||||||||||||||||||
| 15 | 920 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
mkUncompObject: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 920 | my $decompressor = Compress::Stream::Zstd::Decompressor->new; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 920 | return bless { | |||||||||||||||||||||||||||
| 20 | 'Inf' => $decompressor, | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 'CompBytes' => 0, | ||||||||||||||||||||||||||||
| 23 | 'UnCompBytes' => 0, | ||||||||||||||||||||||||||||
| 24 | 'Error' => '', | ||||||||||||||||||||||||||||
| 25 | 'ErrorNo' => 0, | ||||||||||||||||||||||||||||
| 26 | 'ConsumesInput' => 0, | ||||||||||||||||||||||||||||
| 27 | } ; | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | sub uncompr | ||||||||||||||||||||||||||||
| 31 | 2618 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
uncompr: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 2618 | my $self = shift ; | |||||||||||||||||||||||||||
| 33 | 2618 | my $from = shift ; | |||||||||||||||||||||||||||
| 34 | 2618 | my $to = shift ; | |||||||||||||||||||||||||||
| 35 | # my $eof = shift ; | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 2618 | my $inf = $self->{Inf}; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 2618 | eval { $$to .= $inf->decompress($$from); } ; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 2618 | ▶ | if ($@ || $inf->isError()) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$@ or $inf->isError
MC/DC50%1/2
$@ or $inf->isError
$@
$inf->isError
Truth table66%2/3
A or B
A= $@B= $inf->isError
| |||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||
| 43 | 22 | $self->{Error} = $inf->getErrorName(); | |||||||||||||||||||||||||||
| 44 | 22 | $self->{ErrorNo} = $inf->status() ; | |||||||||||||||||||||||||||
| 45 | 22 | return STATUS_ERROR ; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 2596 | $self->{Error} = "" ; | |||||||||||||||||||||||||||
| 49 | 2596 | $self->{ErrorNo} = 0; | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 2596 | ▶ | return STATUS_ENDSTREAM if $inf->isEndFrame() ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 2236 | return STATUS_OK ; | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | sub reset | ||||||||||||||||||||||||||||
| 57 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
reset: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 58 | 1 | return STATUS_OK ; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | #sub count | ||||||||||||||||||||||||||||
| 62 | #{ | ||||||||||||||||||||||||||||
| 63 | # my $self = shift ; | ||||||||||||||||||||||||||||
| 64 | # $self->{UnCompBytes}; | ||||||||||||||||||||||||||||
| 65 | #} | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | sub compressedBytes | ||||||||||||||||||||||||||||
| 68 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
compressedBytes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 69 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 70 | 0 | $self->{CompBytes}; | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | sub uncompressedBytes | ||||||||||||||||||||||||||||
| 74 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
uncompressedBytes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 75 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 76 | 0 | $self->{UnCompBytes}; | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | sub crc32 | ||||||||||||||||||||||||||||
| 80 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
crc32: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 81 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 82 | #$self->{Inf}->crc32(); | ||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | sub adler32 | ||||||||||||||||||||||||||||
| 86 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
adler32: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 87 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 88 | #$self->{Inf}->adler32(); | ||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | sub sync | ||||||||||||||||||||||||||||
| 92 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
sync: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 93 | 0 | my $self = shift ; | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | 12 | 1; | |||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | __END__ | ||||||||||||||||||||||||||||