| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Business::NAB::FileContainer; |
|
2
|
|
|
|
|
|
|
$Business::NAB::FileContainer::VERSION = '0.03'; |
|
3
|
|
|
|
|
|
|
# undocument abstract class |
|
4
|
|
|
|
|
|
|
|
|
5
|
8
|
|
|
8
|
|
6628
|
use strict; |
|
|
8
|
|
|
|
|
55
|
|
|
|
8
|
|
|
|
|
422
|
|
|
6
|
8
|
|
|
8
|
|
53
|
use warnings; |
|
|
8
|
|
|
|
|
18
|
|
|
|
8
|
|
|
|
|
659
|
|
|
7
|
8
|
|
|
8
|
|
80
|
use feature qw/ signatures /; |
|
|
8
|
|
|
|
|
20
|
|
|
|
8
|
|
|
|
|
1250
|
|
|
8
|
8
|
|
|
8
|
|
63
|
use autodie qw/ :all /; |
|
|
8
|
|
|
|
|
21
|
|
|
|
8
|
|
|
|
|
96
|
|
|
9
|
8
|
|
|
8
|
|
69007
|
use Carp qw/ croak /; |
|
|
8
|
|
|
|
|
38
|
|
|
|
8
|
|
|
|
|
826
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
8
|
|
|
8
|
|
100
|
use Moose; |
|
|
8
|
|
|
|
|
73
|
|
|
|
8
|
|
|
|
|
147
|
|
|
12
|
8
|
|
|
8
|
|
83781
|
no warnings qw/ experimental::signatures /; |
|
|
8
|
|
|
|
|
58
|
|
|
|
8
|
|
|
|
|
592
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
8
|
|
|
8
|
|
63
|
use Business::NAB::Types qw/ decamelize /; |
|
|
8
|
|
|
|
|
18
|
|
|
|
8
|
|
|
|
|
4057
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new_from_file ( |
|
17
|
6
|
|
|
|
|
14
|
$self, |
|
18
|
6
|
|
|
|
|
16
|
$parent, |
|
19
|
6
|
|
|
|
|
124
|
$file, |
|
20
|
6
|
|
|
|
|
19
|
$sub_class_map, |
|
21
|
6
|
|
|
|
|
13
|
$split_char = undef, |
|
22
|
6
|
|
|
6
|
0
|
16
|
) { |
|
|
6
|
|
|
|
|
13
|
|
|
23
|
6
|
|
|
|
|
55
|
open( my $fh, '<', $file ); |
|
24
|
|
|
|
|
|
|
|
|
25
|
6
|
|
|
|
|
15165
|
while ( my $line = <$fh> ) { |
|
26
|
|
|
|
|
|
|
|
|
27
|
62
|
|
|
|
|
5696
|
$line =~ s/\r\n$//; |
|
28
|
|
|
|
|
|
|
|
|
29
|
62
|
100
|
|
|
|
570
|
my ( $type ) = $split_char |
|
30
|
|
|
|
|
|
|
? ( split( $split_char, $line ) )[ 0 ] |
|
31
|
|
|
|
|
|
|
: substr( $line, 0, 1 ); |
|
32
|
|
|
|
|
|
|
|
|
33
|
62
|
50
|
|
|
|
234
|
next if !length( $type ); |
|
34
|
|
|
|
|
|
|
|
|
35
|
62
|
|
|
|
|
202
|
my $sub_class = $sub_class_map->{ $type }; |
|
36
|
62
|
|
|
|
|
296
|
my $attr = decamelize( $sub_class ); |
|
37
|
62
|
|
|
|
|
187
|
my $push = "add_${attr}"; |
|
38
|
|
|
|
|
|
|
|
|
39
|
62
|
50
|
|
|
|
267
|
$sub_class || croak( "Unrecognised record type ($type) at line $." ); |
|
40
|
62
|
|
|
|
|
161
|
$sub_class = "${parent}::${sub_class}"; |
|
41
|
|
|
|
|
|
|
|
|
42
|
62
|
|
|
|
|
608
|
my $Instance = $sub_class->new_from_record( $line ); |
|
43
|
|
|
|
|
|
|
|
|
44
|
62
|
|
|
|
|
440
|
$self->$push( $Instance ); |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
6
|
|
|
|
|
1039
|
return $self; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |