line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Author : Maxime Soulé |
3
|
|
|
|
|
|
|
# Created On : Thu Dec 30 00:26:56 2004 |
4
|
|
|
|
|
|
|
# Last Modified By: Maxime Soule |
5
|
|
|
|
|
|
|
# Last Modified On: Mon May 3 14:56:33 2010 |
6
|
|
|
|
|
|
|
# Update Count : 1 |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright (C) 2005, Maxime Soulé |
9
|
|
|
|
|
|
|
# You may distribute this file under the terms of the Artistic |
10
|
|
|
|
|
|
|
# License, as specified in the README file. |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Palm::MaTirelire::DBItem; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
5104
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
42
|
|
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
582
|
use Palm::BlockPack; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
58
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
14
|
use Palm::MaTirelire; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
12
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
52
|
use base qw(Palm::MaTirelire); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
872
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '1.0'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub meta_infos ($) |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
0
|
0
|
|
return {}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub new |
33
|
|
|
|
|
|
|
{ |
34
|
0
|
|
|
0
|
1
|
|
my $classname = shift; |
35
|
0
|
|
|
|
|
|
my $self = $classname->SUPER::new(@_); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Create a generic PDB. No need to rebless it, |
38
|
|
|
|
|
|
|
# though. |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $ref_meta_infos = $self->meta_infos; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$self->{name} = $ref_meta_infos->{name}; |
43
|
0
|
|
|
|
|
|
$self->{type} = $ref_meta_infos->{type}; |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
if (defined $ref_meta_infos->{appinfo_block}) |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
|
|
|
$ref_meta_infos->{appinfo_block}->init_block($self->{appinfo}); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub new_Record |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
56
|
0
|
|
|
|
|
|
my $retval = $self->SUPER::new_Record(@_); |
57
|
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
if (defined(my $record_block = $self->meta_infos->{record_block})) |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
|
|
|
|
|
$record_block->init_block($retval); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $retval; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub ParseAppInfoBlock |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
70
|
|
|
|
|
|
|
|
71
|
0
|
0
|
|
|
|
|
if (defined(my $appinfo_block = $self->meta_infos->{appinfo_block})) |
72
|
|
|
|
|
|
|
{ |
73
|
0
|
|
|
|
|
|
return $appinfo_block->unpack_block(shift); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
$self->SUPER::ParseAppInfoBlock(@_); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub PackAppInfoBlock |
81
|
|
|
|
|
|
|
{ |
82
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
83
|
|
|
|
|
|
|
|
84
|
0
|
0
|
|
|
|
|
if (defined(my $appinfo_block = $self->meta_infos->{appinfo_block})) |
85
|
|
|
|
|
|
|
{ |
86
|
0
|
|
|
|
|
|
return $appinfo_block->pack_block($self->{appinfo}); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
$self->SUPER::PackAppInfoBlock(@_); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub ParseRecord |
94
|
|
|
|
|
|
|
{ |
95
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
96
|
0
|
|
|
|
|
|
my %record = @_; |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
delete $record{offset}; # This is useless |
99
|
|
|
|
|
|
|
|
100
|
0
|
0
|
|
|
|
|
if (defined(my $record_block = $self->meta_infos->{record_block})) |
101
|
|
|
|
|
|
|
{ |
102
|
0
|
|
|
|
|
|
$record_block->unpack_block(delete $record{data}, \%record); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
return \%record; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub PackRecord |
110
|
|
|
|
|
|
|
{ |
111
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
112
|
|
|
|
|
|
|
|
113
|
0
|
0
|
|
|
|
|
if (defined(my $record_block = $self->meta_infos->{record_block})) |
114
|
|
|
|
|
|
|
{ |
115
|
0
|
|
|
|
|
|
return $record_block->pack_block(shift); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
return ''; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
1; |
122
|
|
|
|
|
|
|
__END__ |