line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
36
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
420
|
|
4
|
|
|
|
|
|
|
package |
5
|
|
|
|
|
|
|
Data::Tabular::Row; |
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
3895
|
use Data::Tabular::Cell; |
|
6
|
|
|
|
|
310
|
|
|
6
|
|
|
|
|
218
|
|
8
|
6
|
|
|
6
|
|
53
|
use Carp qw(croak); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
576
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
|
|
85
|
use overload '@{}' => \&array, |
11
|
6
|
|
|
6
|
|
38
|
'""' => \&str; |
|
6
|
|
|
|
|
14
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
209
|
|
|
209
|
0
|
293
|
my $caller = shift; |
16
|
209
|
|
33
|
|
|
1014
|
my $class = ref($caller) || $caller; |
17
|
209
|
|
|
|
|
786
|
my $self = { @_ }; |
18
|
209
|
50
|
|
|
|
511
|
if (ref($caller)) { |
19
|
0
|
0
|
|
|
|
0
|
croak(q|Don't know how to copy object: | . $class) |
20
|
|
|
|
|
|
|
unless $caller->isa(__PACKAGE__); |
21
|
0
|
|
|
|
|
0
|
$self = $caller->clone(); |
22
|
|
|
|
|
|
|
} |
23
|
209
|
|
|
|
|
522
|
$self = bless $self, $class; |
24
|
|
|
|
|
|
|
|
25
|
209
|
50
|
|
|
|
575
|
die caller unless $self->table->headers; |
26
|
209
|
50
|
|
|
|
536
|
croak 'need table' unless $self->table->headers; |
27
|
209
|
50
|
|
|
|
500
|
croak 'need table' unless $self->table; |
28
|
|
|
|
|
|
|
|
29
|
209
|
|
|
|
|
710
|
$self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub str |
33
|
|
|
|
|
|
|
{ |
34
|
4544
|
|
|
4544
|
0
|
14189
|
my $self = shift; |
35
|
4544
|
|
|
|
|
22234
|
'Row : '. $self->{input_row} . ';'; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub headers |
39
|
|
|
|
|
|
|
{ |
40
|
129
|
|
|
129
|
0
|
184
|
my $self = shift; |
41
|
129
|
|
|
|
|
295
|
my @list1 = $self->table->headers; |
42
|
129
|
|
|
|
|
553
|
my @list2 = $self->output->headers; |
43
|
|
|
|
|
|
|
|
44
|
129
|
|
|
|
|
263
|
my %tmp; |
45
|
|
|
|
|
|
|
|
46
|
129
|
|
|
|
|
7891
|
$tmp{$_} = 1 for (@list1); |
47
|
|
|
|
|
|
|
|
48
|
129
|
|
|
|
|
301
|
my @list3 = grep({$tmp{$_}} @list2); |
|
1267
|
|
|
|
|
17704
|
|
49
|
|
|
|
|
|
|
|
50
|
129
|
50
|
|
|
|
4415
|
warn 'bug' unless @list3; |
51
|
129
|
50
|
|
|
|
298
|
return @list1 unless @list3; |
52
|
|
|
|
|
|
|
|
53
|
129
|
|
|
|
|
916
|
return @list3; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub html_attribute_string |
57
|
|
|
|
|
|
|
{ |
58
|
44
|
|
|
44
|
0
|
60
|
my $self = shift; |
59
|
44
|
|
|
|
|
65
|
my $ret = ' class="ende"'; |
60
|
|
|
|
|
|
|
|
61
|
44
|
|
|
|
|
116
|
$ret; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub cells |
65
|
|
|
|
|
|
|
{ |
66
|
189
|
|
|
189
|
0
|
301
|
my $self = shift; |
67
|
189
|
|
|
|
|
1273
|
my @ret = (); |
68
|
|
|
|
|
|
|
|
69
|
189
|
|
|
|
|
1142
|
my @headers = $self->headers(@_); |
70
|
|
|
|
|
|
|
|
71
|
189
|
|
|
|
|
356
|
my $x = 0; |
72
|
189
|
|
|
|
|
328
|
for my $header (@headers) { |
73
|
1125
|
50
|
|
|
|
2892
|
next unless $header; |
74
|
1125
|
|
|
|
|
2863
|
push(@ret, |
75
|
|
|
|
|
|
|
Data::Tabular::Cell->new( |
76
|
|
|
|
|
|
|
row => $self, |
77
|
|
|
|
|
|
|
cell => $header, |
78
|
|
|
|
|
|
|
colspan => $self->colspan($header), |
79
|
|
|
|
|
|
|
id => $x++, |
80
|
|
|
|
|
|
|
) |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
} |
83
|
189
|
|
|
|
|
972
|
@ret; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub output |
87
|
|
|
|
|
|
|
{ |
88
|
311
|
|
|
311
|
0
|
406
|
my $self = shift; |
89
|
|
|
|
|
|
|
|
90
|
311
|
50
|
|
|
|
2739
|
$self->{output} || die; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub colspan |
94
|
|
|
|
|
|
|
{ |
95
|
1045
|
|
|
1045
|
0
|
3768
|
1; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub table |
99
|
|
|
|
|
|
|
{ |
100
|
3838
|
|
|
3838
|
0
|
17492
|
shift->{table}; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub hdr |
104
|
271
|
|
|
271
|
0
|
961
|
{ |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub id |
108
|
|
|
|
|
|
|
{ |
109
|
850
|
|
|
850
|
0
|
1062
|
my $self = shift; |
110
|
|
|
|
|
|
|
|
111
|
850
|
50
|
|
|
|
8715
|
$self->{row_id} || 'No ID available'; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub cell_html_attributes |
115
|
|
|
|
|
|
|
{ |
116
|
|
|
|
|
|
|
{ |
117
|
0
|
|
|
0
|
0
|
0
|
align => undef, |
118
|
|
|
|
|
|
|
}; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub type |
122
|
|
|
|
|
|
|
{ |
123
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
124
|
0
|
|
|
|
|
0
|
warn 'No type for ' . ref($self); |
125
|
0
|
|
|
|
|
0
|
'unknown'; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
64
|
|
|
64
|
0
|
464
|
sub is_title { 0 }; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
1; |
131
|
|
|
|
|
|
|
__END__ |