| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: Writer class for YAML::PP representing output data |
|
2
|
50
|
|
|
50
|
|
162577
|
use strict; |
|
|
50
|
|
|
|
|
131
|
|
|
|
50
|
|
|
|
|
1615
|
|
|
3
|
50
|
|
|
50
|
|
211
|
use warnings; |
|
|
50
|
|
|
|
|
68
|
|
|
|
50
|
|
|
|
|
12054
|
|
|
4
|
|
|
|
|
|
|
package YAML::PP::Writer; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 'v0.41.0'; # VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
3063
|
|
|
3063
|
1
|
6055
|
sub output { return $_[0]->{output} } |
|
9
|
6879
|
|
|
6879
|
1
|
12478
|
sub set_output { $_[0]->{output} = $_[1] } |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
|
12
|
5207
|
|
|
5207
|
1
|
198784
|
my ($class, %args) = @_; |
|
13
|
5207
|
|
|
|
|
6714
|
my $output = delete $args{output}; |
|
14
|
5207
|
100
|
|
|
|
9342
|
$output = '' unless defined $output; |
|
15
|
5207
|
|
|
|
|
16635
|
return bless { |
|
16
|
|
|
|
|
|
|
output => $output, |
|
17
|
|
|
|
|
|
|
}, $class; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub write { |
|
21
|
13116
|
|
|
13116
|
1
|
17052
|
my ($self, $line) = @_; |
|
22
|
13116
|
|
|
|
|
29984
|
$self->{output} .= $line; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub init { |
|
26
|
5300
|
|
|
5300
|
1
|
9399
|
$_[0]->set_output(''); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub finish { |
|
30
|
1579
|
|
|
1579
|
1
|
2085
|
my ($self) = @_; |
|
31
|
1579
|
|
|
|
|
2916
|
$_[0]->set_output(undef); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |