line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TV::ARIB::ProgramGenre::ChildGenre; |
2
|
2
|
|
|
2
|
|
2228
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
66
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
4
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
30
|
|
5
|
2
|
|
|
2
|
|
53
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
170
|
|
6
|
2
|
|
|
2
|
|
10
|
use Encode qw/decode_utf8 encode_utf8/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
831
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT |
9
|
|
|
|
|
|
|
sub CHILD_GENRES { |
10
|
0
|
|
|
0
|
0
|
0
|
die; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
126
|
|
|
126
|
0
|
177
|
my ($class) = @_; |
15
|
126
|
|
|
|
|
892
|
bless {}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub get_child_genre_name { |
19
|
17
|
|
|
17
|
0
|
28
|
my ($self, $id) = @_; |
20
|
|
|
|
|
|
|
|
21
|
17
|
|
|
|
|
51
|
my $child_genre = $self->CHILD_GENRES->[$id]; |
22
|
17
|
100
|
|
|
|
69
|
if (not defined $child_genre) { |
23
|
1
|
|
|
|
|
158
|
croak "No such a genre (ID: $id)"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
16
|
|
|
|
|
48
|
return encode_utf8($child_genre); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub get_child_genre_id { |
30
|
109
|
|
|
109
|
0
|
182
|
my ($self, $name) = @_; |
31
|
|
|
|
|
|
|
|
32
|
109
|
|
|
|
|
119
|
eval { $name = decode_utf8($name) }; |
|
109
|
|
|
|
|
281
|
|
33
|
|
|
|
|
|
|
|
34
|
109
|
|
|
|
|
2123
|
my $id = 0; |
35
|
109
|
|
|
|
|
128
|
for my $genre (@{$self->CHILD_GENRES}) { |
|
109
|
|
|
|
|
407
|
|
36
|
1562
|
100
|
|
|
|
2570
|
return $id if $genre eq $name; |
37
|
1549
|
|
|
|
|
1688
|
$id++; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
96
|
|
|
|
|
470
|
croak encode_utf8("No such a child genre: $name"); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|