lib/Archive/Lha/Stream/String.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 3 / 3 totaltotal 92.1% 35 / 38 CC 2 SCAR 2.9
CC
2
Cov
93%
open
2.0
close
2.0
BEGIN
1.0
CRAP 1.3
« lib/Archive/Lha/Stream/Hex.pm ↑ Summary tools/plhasa »
1 package Archive::Lha::Stream::String;
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use bytes;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use base qw( Archive::Lha::Stream::Base );
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 3 ▶sub open {
Subroutine open: called CC=2 SCAR=7.0
Pod documented
10 3 my ($self, %options) = @_;
11
12 3 ▶ $self->{string} = $options{string} or croak "String is missing";
Branch: 1 branch
BranchTrueFalseTotal
$self->{"string"} = $options{"string"} or croak("String is missing") 3 0 3
13 3 $self->{length} = length( $options{string} );
14 3 $self->{pos} = 0;
15 }
16
17 0 ▶sub close { return }
Subroutine close: not called CC=1 SCAR=6.9
Pod documented
18
19 47 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
Pod documented
20 47 my ($self, $length) = @_;
21
22 47 my $str = substr( $self->{string}, $self->{pos}, $length );
23 47 $self->{pos} += $length;
24 47 return $str;
25 }
26
27 2 1;
28
29 __END__
« lib/Archive/Lha/Stream/Hex.pm ↑ Summary tools/plhasa »