line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Writer class for YAML::PP representing output data |
2
|
38
|
|
|
38
|
|
2105
|
use strict; |
|
38
|
|
|
|
|
118
|
|
|
38
|
|
|
|
|
1221
|
|
3
|
38
|
|
|
38
|
|
202
|
use warnings; |
|
38
|
|
|
|
|
116
|
|
|
38
|
|
|
|
|
9573
|
|
4
|
|
|
|
|
|
|
package YAML::PP::Writer; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.036'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1387
|
|
|
1387
|
1
|
3317
|
sub output { return $_[0]->{output} } |
9
|
2947
|
|
|
2947
|
1
|
6260
|
sub set_output { $_[0]->{output} = $_[1] } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
1570
|
|
|
1570
|
1
|
4480
|
my ($class, %args) = @_; |
13
|
1570
|
|
|
|
|
2576
|
my $output = delete $args{output}; |
14
|
1570
|
100
|
|
|
|
3420
|
$output = '' unless defined $output; |
15
|
1570
|
|
|
|
|
6313
|
return bless { |
16
|
|
|
|
|
|
|
output => $output, |
17
|
|
|
|
|
|
|
}, $class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub write { |
21
|
4000
|
|
|
4000
|
1
|
7406
|
my ($self, $line) = @_; |
22
|
4000
|
|
|
|
|
11760
|
$self->{output} .= $line; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub init { |
26
|
1663
|
|
|
1663
|
1
|
3665
|
$_[0]->set_output(''); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub finish { |
30
|
1284
|
|
|
1284
|
1
|
2107
|
my ($self) = @_; |
31
|
1284
|
|
|
|
|
2590
|
$_[0]->set_output(undef); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |