| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package IO::Compress::Zstd ; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 11 |  |  | 11 |  | 37097 | use strict ; | 
|  | 11 |  |  |  |  | 72 |  | 
|  | 11 |  |  |  |  | 320 |  | 
| 4 | 11 |  |  | 11 |  | 55 | use warnings; | 
|  | 11 |  |  |  |  | 32 |  | 
|  | 11 |  |  |  |  | 354 |  | 
| 5 |  |  |  |  |  |  | require Exporter ; | 
| 6 | 11 |  |  | 11 |  | 5169 | use bytes; | 
|  | 11 |  |  |  |  | 128 |  | 
|  | 11 |  |  |  |  | 57 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 11 |  |  | 11 |  | 6376 | use IO::Compress::Base 2.206 ; | 
|  | 11 |  |  |  |  | 245310 |  | 
|  | 11 |  |  |  |  | 633 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 11 |  |  | 11 |  | 90 | use IO::Compress::Base::Common  2.206 qw(createSelfTiedObject); | 
|  | 11 |  |  |  |  | 146 |  | 
|  | 11 |  |  |  |  | 695 |  | 
| 11 | 11 |  |  | 11 |  | 5458 | use IO::Compress::Adapter::Zstd 2.206 ; | 
|  | 11 |  |  |  |  | 236 |  | 
|  | 11 |  |  |  |  | 453 |  | 
| 12 | 11 |  |  | 11 |  | 81 | use Compress::Stream::Zstd qw(ZSTD_MAX_CLEVEL); | 
|  | 11 |  |  |  |  | 21 |  | 
|  | 11 |  |  |  |  | 5440 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZstdError); | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | $VERSION = '2.206'; | 
| 18 |  |  |  |  |  |  | $ZstdError = ''; | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | @ISA    = qw( IO::Compress::Base Exporter ); | 
| 21 |  |  |  |  |  |  | @EXPORT_OK = qw( $ZstdError zstd ZSTD_MAX_CLEVEL ) ; | 
| 22 |  |  |  |  |  |  | %EXPORT_TAGS = %IO::Compress::Base::EXPORT_TAGS ; | 
| 23 |  |  |  |  |  |  | push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; | 
| 24 |  |  |  |  |  |  | Exporter::export_ok_tags('all'); | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | sub new | 
| 27 |  |  |  |  |  |  | { | 
| 28 | 118 |  |  | 118 | 1 | 1815455 | my $class = shift ; | 
| 29 |  |  |  |  |  |  |  | 
| 30 | 118 |  |  |  |  | 461 | my $obj = createSelfTiedObject($class, \$ZstdError); | 
| 31 | 118 |  |  |  |  | 5206 | return $obj->_create(undef, @_); | 
| 32 |  |  |  |  |  |  | } | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | sub zstd | 
| 35 |  |  |  |  |  |  | { | 
| 36 | 128 |  |  | 128 | 1 | 226619 | my $obj = createSelfTiedObject(undef, \$ZstdError); | 
| 37 | 128 |  |  |  |  | 5668 | return $obj->_def(@_); | 
| 38 |  |  |  |  |  |  | } | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | sub mkHeader | 
| 41 |  |  |  |  |  |  | { | 
| 42 | 216 |  |  | 216 | 0 | 14209 | my $self = shift ; | 
| 43 | 216 |  |  |  |  | 338 | my $param = shift ; | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 216 |  |  |  |  | 567 | return ''; | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | } | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | sub ckParams | 
| 50 |  |  |  |  |  |  | { | 
| 51 | 218 |  |  | 218 | 0 | 45138 | my $self = shift ; | 
| 52 | 218 |  |  |  |  | 386 | my $got = shift; | 
| 53 |  |  |  |  |  |  |  | 
| 54 | 218 |  |  |  |  | 405 | return 1 ; | 
| 55 |  |  |  |  |  |  | } | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | sub mkComp | 
| 59 |  |  |  |  |  |  | { | 
| 60 | 217 |  |  | 217 | 0 | 5245 | my $self = shift ; | 
| 61 | 217 |  |  |  |  | 332 | my $got = shift ; | 
| 62 |  |  |  |  |  |  |  | 
| 63 | 217 |  |  |  |  | 528 | my ($obj, $errstr, $errno) =  IO::Compress::Adapter::Zstd::mkCompObject( | 
| 64 |  |  |  |  |  |  | $got->getValue('level'), | 
| 65 |  |  |  |  |  |  | ); | 
| 66 |  |  |  |  |  |  |  | 
| 67 | 217 | 50 |  |  |  | 722 | return $self->saveErrorString(undef, $errstr, $errno) | 
| 68 |  |  |  |  |  |  | if ! defined $obj; | 
| 69 |  |  |  |  |  |  |  | 
| 70 | 217 |  |  |  |  | 779 | return $obj; | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | } | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | sub mkTrailer | 
| 76 |  |  |  |  |  |  | { | 
| 77 | 216 |  |  | 216 | 0 | 3511 | my $self = shift ; | 
| 78 | 216 |  |  |  |  | 479 | return ""; | 
| 79 |  |  |  |  |  |  | } | 
| 80 |  |  |  |  |  |  |  | 
| 81 |  |  |  |  |  |  | sub mkFinalTrailer | 
| 82 |  |  |  |  |  |  | { | 
| 83 | 216 |  |  | 216 | 0 | 7247 | my $self = shift ; | 
| 84 |  |  |  |  |  |  |  | 
| 85 | 216 |  |  |  |  | 533 | return ''; | 
| 86 |  |  |  |  |  |  | } | 
| 87 |  |  |  |  |  |  |  | 
| 88 |  |  |  |  |  |  | #sub newHeader | 
| 89 |  |  |  |  |  |  | #{ | 
| 90 |  |  |  |  |  |  | #    my $self = shift ; | 
| 91 |  |  |  |  |  |  | #    return ''; | 
| 92 |  |  |  |  |  |  | #} | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | our %PARAMS = ( | 
| 95 |  |  |  |  |  |  | 'level' => [IO::Compress::Base::Common::Parse_unsigned,  3], | 
| 96 |  |  |  |  |  |  | ); | 
| 97 |  |  |  |  |  |  |  | 
| 98 |  |  |  |  |  |  | sub getExtraParams | 
| 99 |  |  |  |  |  |  | { | 
| 100 | 218 |  |  | 218 | 0 | 21925 | return %PARAMS ; | 
| 101 |  |  |  |  |  |  | } | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  | sub getInverseClass | 
| 104 |  |  |  |  |  |  | { | 
| 105 | 0 |  |  | 0 | 0 |  | return ('IO::Uncompress::UnZstd'); | 
| 106 |  |  |  |  |  |  | } | 
| 107 |  |  |  |  |  |  |  | 
| 108 |  |  |  |  |  |  | 1; | 
| 109 |  |  |  |  |  |  |  | 
| 110 |  |  |  |  |  |  | __END__ |