"Fossies" - the Fresh Open Source Software Archive

Member "IO-Compress-2.093/lib/IO/Compress/Adapter/Identity.pm" (7 Dec 2019, 1438 Bytes) of package /linux/privat/IO-Compress-2.093.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Identity.pm" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.092_vs_2.093.

    1 package IO::Compress::Adapter::Identity ;
    2 
    3 use strict;
    4 use warnings;
    5 use bytes;
    6 
    7 use IO::Compress::Base::Common  2.093 qw(:Status);
    8 our ($VERSION);
    9 
   10 $VERSION = '2.093';
   11 
   12 sub mkCompObject
   13 {
   14     my $level    = shift ;
   15     my $strategy = shift ;
   16 
   17     return bless {
   18                   'CompSize'   => 0,
   19                   'UnCompSize' => 0,
   20                   'Error'      => '',
   21                   'ErrorNo'    => 0,
   22                  } ;     
   23 }
   24 
   25 sub compr
   26 {
   27     my $self = shift ;
   28 
   29     if (defined ${ $_[0] } && length ${ $_[0] }) {
   30         $self->{CompSize} += length ${ $_[0] } ;
   31         $self->{UnCompSize} = $self->{CompSize} ;
   32 
   33         if ( ref $_[1] ) 
   34           { ${ $_[1] } .= ${ $_[0] } }
   35         else
   36           { $_[1] .= ${ $_[0] } }
   37     }
   38 
   39     return STATUS_OK ;
   40 }
   41 
   42 sub flush
   43 {
   44     my $self = shift ;
   45 
   46     return STATUS_OK;    
   47 }
   48 
   49 sub close
   50 {
   51     my $self = shift ;
   52 
   53     return STATUS_OK;    
   54 }
   55 
   56 sub reset
   57 {
   58     my $self = shift ;
   59 
   60     $self->{CompSize}   = 0;
   61     $self->{UnCompSize} = 0;
   62 
   63     return STATUS_OK;    
   64 }
   65 
   66 sub deflateParams 
   67 {
   68     my $self = shift ;
   69 
   70     return STATUS_OK;   
   71 }
   72 
   73 #sub total_out
   74 #{
   75 #    my $self = shift ;
   76 #    return $self->{UnCompSize} ;
   77 #}
   78 #
   79 #sub total_in
   80 #{
   81 #    my $self = shift ;
   82 #    return $self->{UnCompSize} ;
   83 #}
   84 
   85 sub compressedBytes
   86 {
   87     my $self = shift ;
   88     return $self->{UnCompSize} ;
   89 }
   90 
   91 sub uncompressedBytes
   92 {
   93     my $self = shift ;
   94     return $self->{UnCompSize} ;
   95 }
   96 
   97 1;
   98 
   99 
  100 __END__
  101