| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: Writer class for YAML::PP representing output data |
|
2
|
48
|
|
|
48
|
|
144962
|
use strict; |
|
|
48
|
|
|
|
|
63
|
|
|
|
48
|
|
|
|
|
1506
|
|
|
3
|
48
|
|
|
48
|
|
191
|
use warnings; |
|
|
48
|
|
|
|
|
67
|
|
|
|
48
|
|
|
|
|
11111
|
|
|
4
|
|
|
|
|
|
|
package YAML::PP::Writer; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 'v0.40.0'; # VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
3024
|
|
|
3024
|
1
|
5680
|
sub output { return $_[0]->{output} } |
|
9
|
6792
|
|
|
6792
|
1
|
12940
|
sub set_output { $_[0]->{output} = $_[1] } |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
|
12
|
5120
|
|
|
5120
|
1
|
201176
|
my ($class, %args) = @_; |
|
13
|
5120
|
|
|
|
|
7061
|
my $output = delete $args{output}; |
|
14
|
5120
|
100
|
|
|
|
9361
|
$output = '' unless defined $output; |
|
15
|
5120
|
|
|
|
|
17280
|
return bless { |
|
16
|
|
|
|
|
|
|
output => $output, |
|
17
|
|
|
|
|
|
|
}, $class; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub write { |
|
21
|
12780
|
|
|
12780
|
1
|
17909
|
my ($self, $line) = @_; |
|
22
|
12780
|
|
|
|
|
30155
|
$self->{output} .= $line; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub init { |
|
26
|
5213
|
|
|
5213
|
1
|
10017
|
$_[0]->set_output(''); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub finish { |
|
30
|
1579
|
|
|
1579
|
1
|
2109
|
my ($self) = @_; |
|
31
|
1579
|
|
|
|
|
2624
|
$_[0]->set_output(undef); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |