Archive-SevenZip

 view release on metacpan or  search on metacpan

lib/Archive/SevenZip/Entry.pm  view on Meta::CPAN

package Archive::SevenZip::Entry;
use strict;

use Time::Piece; # for strptime
use File::Basename ();
use Path::Class ();

our $VERSION= '0.12';

sub new {
    my( $class, %options) = @_;

    bless \%options => $class
}

sub archive {
    $_[0]->{_Container}
}

sub fileName {
    my( $self ) = @_;

    my $res = $self->{Path};

    # Normalize to unixy path names
    $res =~ s!\\!/!g;

    # If we're a directory, append the slash:
    if( $self->{Folder} eq '+') {
        $res .= '/';
    };

    $res
}

# Class::Path API
sub basename {
    Path::Class::file( $_[0]->{Path} )->basename
}

sub components {
    my $cp = file( $_[0]->{Path} );
    $cp->components()
}

sub lastModFileDateTime {
    0
}

sub crc32 {
    hex( $_[0]->{CRC} );
}

sub crc32String {
    lc $_[0]->{CRC};
}

sub desiredCompressionMethod {
    $_[0]->{Method}
}

sub uncompressedSize {
    $_[0]->{Size}
}

sub dir {
    # We need to return the appropriate class here
    # so that further calls to (like) dir->list
    # still work properly
    die "->dir Not implemented";
}

sub open {

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.958 second using v1.00-cache-1.14-grep-28634ff-cpan-207214f8fbd )