| 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
| |||||||||||
| 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__ | ||||||||||