line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Unicode::Block::List; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
120285
|
use strict; |
|
3
|
|
|
|
|
16
|
|
|
3
|
|
|
|
|
65
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
78
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1086
|
use Class::Utils qw(set_params); |
|
3
|
|
|
|
|
55242
|
|
|
3
|
|
|
|
|
71
|
|
7
|
3
|
|
|
3
|
|
1208
|
use Unicode::Block; |
|
3
|
|
|
|
|
63323
|
|
|
3
|
|
|
|
|
85
|
|
8
|
3
|
|
|
3
|
|
2292
|
use Unicode::UCD qw(charblock charblocks); |
|
3
|
|
|
|
|
73636
|
|
|
3
|
|
|
|
|
670
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.04; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constructor. |
13
|
|
|
|
|
|
|
sub new { |
14
|
3
|
|
|
3
|
1
|
3645
|
my ($class, @params) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Create object. |
17
|
3
|
|
|
|
|
15
|
my $self = bless {}, $class; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Process parameters. |
20
|
3
|
|
|
|
|
9
|
set_params($self, @params); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Object. |
23
|
1
|
|
|
|
|
6
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Get block. |
27
|
|
|
|
|
|
|
sub block { |
28
|
0
|
|
|
0
|
1
|
|
my ($self, $block) = @_; |
29
|
0
|
|
|
|
|
|
my $charblock_ar = charblock($block); |
30
|
0
|
0
|
0
|
|
|
|
if (ref $charblock_ar ne 'ARRAY' || ! @{$charblock_ar}) { |
|
0
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
0
|
|
|
|
|
|
my $char_from = sprintf '%04x', $charblock_ar->[0]->[0]; |
34
|
0
|
|
|
|
|
|
my $char_to = sprintf '%04x', $charblock_ar->[0]->[1]; |
35
|
0
|
|
|
|
|
|
return Unicode::Block->new( |
36
|
|
|
|
|
|
|
'title' => $charblock_ar->[0]->[2], |
37
|
|
|
|
|
|
|
'char_from' => $char_from, |
38
|
|
|
|
|
|
|
'char_to' => $char_to, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Get list of blocks. |
43
|
|
|
|
|
|
|
sub list { |
44
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
45
|
0
|
|
|
|
|
|
my $charblocks_hr = charblocks(); |
46
|
0
|
|
|
|
|
|
return sort keys %{$charblocks_hr}; |
|
0
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |