| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::RecordStream::OutputStream; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
App::RecordStream::OutputStream |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 AUTHOR |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Benjamin Bernard |
|
10
|
|
|
|
|
|
|
Keith Amling |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
The class responsible for knowing the conversion from in-memory |
|
15
|
|
|
|
|
|
|
records to record stream wire format (currently JSON). |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use App::RecordStream::OutputStream; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $string = App::RecordStream::OutputStream::hashref_string($record); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 PUBLIC METHODS |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=over 4 |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=item my $string = App::RecordStream::OutputStream::hashref_string($record); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Takes a record and produces the string format for passage between |
|
31
|
|
|
|
|
|
|
recs processes. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=back |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
our $VERSION = "4.0.24"; |
|
38
|
|
|
|
|
|
|
|
|
39
|
69
|
|
|
69
|
|
78192
|
use strict; |
|
|
69
|
|
|
|
|
177
|
|
|
|
69
|
|
|
|
|
1978
|
|
|
40
|
69
|
|
|
69
|
|
371
|
use warnings; |
|
|
69
|
|
|
|
|
153
|
|
|
|
69
|
|
|
|
|
1817
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
69
|
|
|
69
|
|
1021
|
use JSON::MaybeXS; |
|
|
69
|
|
|
|
|
10396
|
|
|
|
69
|
|
|
|
|
8326
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $json = JSON->new(); |
|
45
|
|
|
|
|
|
|
$json->allow_nonref(1); |
|
46
|
|
|
|
|
|
|
$json->allow_blessed(1); |
|
47
|
|
|
|
|
|
|
$json->convert_blessed(1); |
|
48
|
|
|
|
|
|
|
$json->canonical(1) if $ENV{HARNESS_ACTIVE}; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub hashref_string { |
|
51
|
26
|
|
|
26
|
1
|
40
|
my $record = shift; |
|
52
|
26
|
|
|
|
|
100
|
return $json->encode($record); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |