line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Writer class for YAML::PP representing output data |
2
|
38
|
|
|
38
|
|
2094
|
use strict; |
|
38
|
|
|
|
|
112
|
|
|
38
|
|
|
|
|
1242
|
|
3
|
38
|
|
|
38
|
|
210
|
use warnings; |
|
38
|
|
|
|
|
75
|
|
|
38
|
|
|
|
|
9486
|
|
4
|
|
|
|
|
|
|
package YAML::PP::Writer; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.036_002'; # TRIAL VERSION |
7
|
|
|
|
|
|
|
|
8
|
3016
|
|
|
3016
|
1
|
6913
|
sub output { return $_[0]->{output} } |
9
|
6767
|
|
|
6767
|
1
|
14160
|
sub set_output { $_[0]->{output} = $_[1] } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
5098
|
|
|
5098
|
1
|
28462
|
my ($class, %args) = @_; |
13
|
5098
|
|
|
|
|
8186
|
my $output = delete $args{output}; |
14
|
5098
|
100
|
|
|
|
10710
|
$output = '' unless defined $output; |
15
|
5098
|
|
|
|
|
18929
|
return bless { |
16
|
|
|
|
|
|
|
output => $output, |
17
|
|
|
|
|
|
|
}, $class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub write { |
21
|
12751
|
|
|
12751
|
1
|
23238
|
my ($self, $line) = @_; |
22
|
12751
|
|
|
|
|
38343
|
$self->{output} .= $line; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub init { |
26
|
5191
|
|
|
5191
|
1
|
10564
|
$_[0]->set_output(''); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub finish { |
30
|
1576
|
|
|
1576
|
1
|
3035
|
my ($self) = @_; |
31
|
1576
|
|
|
|
|
3230
|
$_[0]->set_output(undef); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |