line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::YADV::Structure::Hash; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
66
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
53
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use base 'Data::YADV::Structure::Base'; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
576
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub _get_child_node { |
9
|
26
|
|
|
26
|
|
37
|
my ($self, $entry) = @_; |
10
|
|
|
|
|
|
|
|
11
|
26
|
50
|
|
|
|
121
|
die qq(Wrong hash key format "$entry") |
12
|
|
|
|
|
|
|
unless $entry =~ /^\{(.+)\}$/; |
13
|
26
|
|
|
|
|
48
|
my $key = $1; |
14
|
|
|
|
|
|
|
|
15
|
26
|
|
|
|
|
97
|
my $structure = $self->get_structure; |
16
|
26
|
100
|
|
|
|
73
|
return undef unless exists $structure->{$key}; |
17
|
|
|
|
|
|
|
|
18
|
23
|
|
|
|
|
94
|
$self->_build_node($entry, $structure->{$key}) |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
0
|
2
|
sub get_size { keys %{$_[0]->get_structure} } |
|
1
|
|
|
|
|
6
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub each { |
24
|
2
|
|
|
2
|
0
|
5
|
my ($self, $cb) = @_; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
34
|
foreach my $key (keys %{$self->get_structure}) { |
|
2
|
|
|
|
|
9
|
|
27
|
4
|
|
|
|
|
30
|
$cb->($self->get_child("{$key}"), $key); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |