| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: Writer class for YAML::PP representing output data |
|
2
|
50
|
|
|
50
|
|
151733
|
use strict; |
|
|
50
|
|
|
|
|
67
|
|
|
|
50
|
|
|
|
|
1604
|
|
|
3
|
50
|
|
|
50
|
|
172
|
use warnings; |
|
|
50
|
|
|
|
|
63
|
|
|
|
50
|
|
|
|
|
11276
|
|
|
4
|
|
|
|
|
|
|
package YAML::PP::Writer; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 'v0.40.1'; # TRIAL VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
3063
|
|
|
3063
|
1
|
5420
|
sub output { return $_[0]->{output} } |
|
9
|
6879
|
|
|
6879
|
1
|
12668
|
sub set_output { $_[0]->{output} = $_[1] } |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
|
12
|
5207
|
|
|
5207
|
1
|
196762
|
my ($class, %args) = @_; |
|
13
|
5207
|
|
|
|
|
6784
|
my $output = delete $args{output}; |
|
14
|
5207
|
100
|
|
|
|
9168
|
$output = '' unless defined $output; |
|
15
|
5207
|
|
|
|
|
16262
|
return bless { |
|
16
|
|
|
|
|
|
|
output => $output, |
|
17
|
|
|
|
|
|
|
}, $class; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub write { |
|
21
|
13116
|
|
|
13116
|
1
|
17805
|
my ($self, $line) = @_; |
|
22
|
13116
|
|
|
|
|
28743
|
$self->{output} .= $line; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub init { |
|
26
|
5300
|
|
|
5300
|
1
|
9398
|
$_[0]->set_output(''); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub finish { |
|
30
|
1579
|
|
|
1579
|
1
|
2256
|
my ($self) = @_; |
|
31
|
1579
|
|
|
|
|
2744
|
$_[0]->set_output(undef); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |