| 1 | package Sys::Export::VFAT::File; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | our $VERSION = '0.006'; # VERSION | |||||||||
| 4 | # ABSTRACT: Represents a file in VFAT, including packed encodings of directories | ||||||||||
| 5 | |||||||||||
| 6 | 3 | ▶ | use v5.26; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use experimental qw( signatures ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use Sys::Export::VFAT; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 3 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 3 | our @CARP_NOT= qw( Sys::Export::VFAT ); | |||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 10581 | ▶ | sub new($class, %attrs) { | ||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 15 | 10581 | my $self= bless {}, $class; | |||||||||
| 16 | 10581 | for (qw( name size data flags btime atime mtime align device_offset cluster )) { | |||||||||
| 17 | 105810 | ▶ | if (defined (my $v= delete $attrs{$_})) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 42234 | $self->{$_}= $v | |||||||||
| 19 | } | ||||||||||
| 20 | } | ||||||||||
| 21 | 10581 | ▶ | croak "Unknown attribute: ".join(', ', keys %attrs) if keys %attrs; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 10581 | $self; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | |||||||||||
| 26 | 45250 | ▶ | sub name { $_[0]{name} } | ||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 27 | 50836 | ▶ | sub size { $_[0]{size} } | ||||||||
|
Subroutine
size: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 28 | 10611 | ▶ | sub data { $_[0]{data} } | ||||||||
|
Subroutine
data: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 29 | 10550 | ▶ | sub flags { $_[0]{flags} } | ||||||||
|
Subroutine
flags: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 30 | 10618 | ▶ | sub mtime { $_[0]{mtime} } | ||||||||
|
Subroutine
mtime: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 31 | 10618 | ▶ | sub atime { $_[0]{atime} } | ||||||||
|
Subroutine
atime: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 32 | 10618 | ▶ | sub btime { $_[0]{btime} } | ||||||||
|
Subroutine
btime: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 33 | 31039 | ▶ | sub align { $_[0]{align} } | ||||||||
|
Subroutine
align: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 34 | 30687 | ▶ | sub device_offset { $_[0]{device_offset} } | ||||||||
|
Subroutine
device_offset: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 35 | 21233 | ▶ | sub cluster { $_[0]{cluster} } | ||||||||
|
Subroutine
cluster: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 36 | 21135 | ▶ | sub is_dir { $_[0]{flags} & Sys::Export::VFAT::ATTR_DIRECTORY() } | ||||||||
|
Subroutine
is_dir: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 37 | |||||||||||
| 38 | # Avoiding dependency on namespace::clean | ||||||||||
| 39 | 3 | delete @{Sys::Export::VFAT::File::}{qw( carp confess croak )}; | |||||||||
| 40 | 3 | 1; | |||||||||
| 41 | |||||||||||
| 42 | __END__ | ||||||||||