line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Dir::Dumper::Stream::JSON::Writer; |
2
|
|
|
|
|
|
|
$File::Dir::Dumper::Stream::JSON::Writer::VERSION = '0.6.4'; |
3
|
1
|
|
|
1
|
|
74905
|
use warnings; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
17
|
use 5.012; |
|
1
|
|
|
|
|
3
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
461
|
use parent 'File::Dir::Dumper::Base'; |
|
1
|
|
|
|
|
279
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
42
|
use Carp (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
14
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
508
|
use JSON::MaybeXS (); |
|
1
|
|
|
|
|
7994
|
|
|
1
|
|
|
|
|
30
|
|
13
|
1
|
|
|
1
|
|
493
|
use Class::XSAccessor accessors => { _out => '_out' }; |
|
1
|
|
|
|
|
2295
|
|
|
1
|
|
|
|
|
7
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _init |
17
|
|
|
|
|
|
|
{ |
18
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
19
|
1
|
|
|
|
|
2
|
my $args = shift; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
5
|
$self->_out( $args->{output} ); |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
3
|
$self->_init_stream(); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
2
|
return; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _print |
29
|
|
|
|
|
|
|
{ |
30
|
5
|
|
|
5
|
|
46
|
my $self = shift; |
31
|
5
|
|
|
|
|
8
|
my $line = shift; |
32
|
|
|
|
|
|
|
|
33
|
5
|
|
|
|
|
10
|
print { $self->_out() } $line, "\n"; |
|
5
|
|
|
|
|
16
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _init_stream |
37
|
|
|
|
|
|
|
{ |
38
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
4
|
$self->_print("# JSON Stream by Shlomif - Version 0.2.0"); |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
33
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub put |
46
|
|
|
|
|
|
|
{ |
47
|
2
|
|
|
2
|
1
|
14
|
my $self = shift; |
48
|
2
|
|
|
|
|
4
|
my $token = shift; |
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
8
|
$self->_print( JSON::MaybeXS->new( canonical => 1 )->encode($token) ); |
51
|
2
|
|
|
|
|
54
|
$self->_print("--/f"); |
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
43
|
return; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub close |
57
|
|
|
|
|
|
|
{ |
58
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
5
|
return close( $self->_out() ); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; # End of File::Dir::Dumper |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |