line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML; |
2
|
|
|
|
|
|
|
$HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML::VERSION = '0.0.8'; |
3
|
2
|
|
|
2
|
|
1279
|
use 5.008; |
|
2
|
|
|
|
|
6
|
|
4
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
38
|
|
5
|
2
|
|
|
2
|
|
8
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
use parent 'HTML::Widgets::NavMenu::ToJSON::Data_Persistence'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
827
|
use YAML::XS (); |
|
2
|
|
|
|
|
4550
|
|
|
2
|
|
|
|
|
277
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref([ qw( _filename ) ]); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _init |
15
|
|
|
|
|
|
|
{ |
16
|
1
|
|
|
1
|
|
654
|
my ($self, $args) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
6
|
$self->_filename($args->{filename}); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
2
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub load |
26
|
|
|
|
|
|
|
{ |
27
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
2
|
my $data; |
30
|
|
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
2
|
if (!eval |
32
|
|
|
|
|
|
|
{ |
33
|
1
|
|
|
|
|
5
|
($data) = YAML::XS::LoadFile($self->_filename()); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
1; |
36
|
|
|
|
|
|
|
}) |
37
|
|
|
|
|
|
|
{ |
38
|
1
|
|
|
|
|
65
|
$data = $self->_calc_initial_data(); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$self->_data( |
42
|
1
|
|
|
|
|
5
|
$data |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
3
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub save |
50
|
|
|
|
|
|
|
{ |
51
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
7
|
YAML::XS::DumpFile( |
54
|
|
|
|
|
|
|
$self->_filename, |
55
|
|
|
|
|
|
|
$self->_data |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
183
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; # End of HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |