line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Mark::SlaveBuffer; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
57
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
38
|
|
5
|
2
|
|
|
2
|
|
6
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
99
|
|
6
|
2
|
|
|
2
|
|
8
|
use IO::Mark::Cache; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
35
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
8
|
use base qw(IO::Mark::Buffer); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
222
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
10
|
use version; our $VERSION = qv( '0.0.1' ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub PUSHED { |
13
|
6
|
|
|
6
|
0
|
15
|
my ( $class, $mode, $fh ) = @_; |
14
|
6
|
|
|
|
|
38
|
return bless {}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub OPEN { |
18
|
6
|
|
|
6
|
|
7
|
my $self = shift; |
19
|
6
|
|
|
|
|
14
|
my ( $path, $mode, $fh ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
|
|
15
|
my $cache = IO::Mark::Buffer::_get_cache( $path ); |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
18
|
$self->{key} = $path; |
24
|
6
|
|
|
|
|
16
|
$self->{pos} = $cache->_get_master_pos; |
25
|
6
|
|
|
|
|
16
|
$cache->_inc_ref_count; |
26
|
|
|
|
|
|
|
|
27
|
6
|
|
|
|
|
33
|
return 1; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub READ { |
31
|
1201
|
|
|
1201
|
|
29055
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
1201
|
|
|
|
|
2755
|
my $cache = IO::Mark::Buffer::_get_cache( $self->{key} ); |
34
|
1201
|
|
|
|
|
3457
|
my $got = $cache->_read( $_[0], $_[1], $self->{pos} ); |
35
|
1201
|
|
|
|
|
1634
|
$self->{pos} += $got; |
36
|
|
|
|
|
|
|
|
37
|
1201
|
|
|
|
|
3418
|
return $got; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
IO::Mark::SlaveBuffer - Stream buffer for IO::Mark |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This document describes IO::Mark version 0.0.1 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SYNOPSIS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Don't use IO::Mark::SlaveBuffer directly; it has no usable public |
53
|
|
|
|
|
|
|
interface. Use instead L. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
No bugs have been reported. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
60
|
|
|
|
|
|
|
C, or through the web interface at |
61
|
|
|
|
|
|
|
L. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 AUTHOR |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Andy Armstrong C<< >> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 LICENCE AND COPYRIGHT |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright (c) 2007, Andy Armstrong C<< >>. All rights reserved. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
72
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. See L. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
77
|
|
|
|
|
|
|
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
78
|
|
|
|
|
|
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
79
|
|
|
|
|
|
|
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER |
80
|
|
|
|
|
|
|
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
81
|
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE |
82
|
|
|
|
|
|
|
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH |
83
|
|
|
|
|
|
|
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL |
84
|
|
|
|
|
|
|
NECESSARY SERVICING, REPAIR, OR CORRECTION. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
87
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
88
|
|
|
|
|
|
|
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE |
89
|
|
|
|
|
|
|
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, |
90
|
|
|
|
|
|
|
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE |
91
|
|
|
|
|
|
|
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
92
|
|
|
|
|
|
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
93
|
|
|
|
|
|
|
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
94
|
|
|
|
|
|
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
95
|
|
|
|
|
|
|
SUCH DAMAGES. |