File Coverage

blib/lib/Bio/SFF/Reader/Sequential.pm
Criterion Covered Total %
statement 23 24 95.8
branch 6 8 75.0
condition n/a
subroutine 6 7 85.7
pod 2 2 100.0
total 37 41 90.2


line stmt bran cond sub pod time code
1             package Bio::SFF::Reader::Sequential;
2             {
3             $Bio::SFF::Reader::Sequential::VERSION = '0.007';
4             }
5              
6 1     1   13239 use Moo;
  1         2  
  1         11  
7              
8             with 'Bio::SFF::Reader';
9              
10 1     1   971 use Carp qw/croak/;
  1         2  
  1         256  
11 1     1   6 use Const::Fast;
  1         2  
  1         175  
12 1     1   104 use Fcntl qw/SEEK_SET SEEK_CUR/;
  1         2  
  1         14839  
13              
14             has _current_read => (
15             is => 'rw',
16             init_arg => undef,
17             default => sub { 0 },
18             );
19              
20             sub next_entry {
21 121     121 1 118121 my $self = shift;
22 121 100       660 return if $self->_current_read >= $self->_number_of_reads;
23 110 100       5093 $self->_fh->seek($self->_index_length, SEEK_CUR), if $self->_fh->tell == $self->_index_offset;
24 110         7425 my $ret = $self->_read_entry;
25 110 50       6103 $self->_current_read($self->_current_read + 1) if defined $ret;
26 110         494 return $ret;
27             }
28              
29             sub _has_index {
30 0     0   0 return 0;
31             }
32              
33             sub reset {
34 6     6 1 8164 my $self = shift;
35 6         41 $self->header;
36 6 50       313 $self->_fh->seek($self->header->header_length, SEEK_SET) or croak "Couldn't seek: $!";
37 6         340 $self->_current_read(0);
38 6         242 return;
39             };
40              
41             1;
42              
43             #ABSTRACT: Sequential SFF reader
44              
45             __END__