File Coverage

blib/lib/Palm/Raw.pm
Criterion Covered Total %
statement 20 32 62.5
branch n/a
condition n/a
subroutine 8 12 66.6
pod 8 8 100.0
total 36 52 69.2


line stmt bran cond sub pod time code
1             package Palm::Raw;
2             #
3             # Perl class for dealing with "raw" PDB databases. A "raw" database is
4             # one where the AppInfo and sort blocks, and all of the
5             # records/resources, are just strings of bytes.
6             # This is useful as a default PDB handler, for cases where you want to
7             # be able to handle any kind of database in a generic fashion.
8             # You may also find it useful to subclass this class, for cases where
9             # you don't care about every type of thing in a database.
10             #
11             # Copyright (C) 1999, 2000, Andrew Arensburger.
12             #
13             # This program is free software; you can redistribute it and/or modify
14             # it under the same terms as Perl itself.
15             #
16             # This program is distributed in the hope that it will be useful,
17             # but WITHOUT ANY WARRANTY; without even the implied warranty of
18             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
19             # GNU General Public License or the Artistic License for more details.
20              
21 3     3   5901 use 5.006;
  3         7  
  3         91  
22 3     3   12 use strict;
  3         4  
  3         81  
23 3     3   10 use Palm::PDB;
  3         4  
  3         630  
24              
25             our $VERSION = '1.016'; # VERSION
26             # This file is part of Palm-PDB 1.016 (January 24, 2015)
27              
28             our @ISA = qw( Palm::PDB );
29              
30             # ABSTRACT: Handler for "raw" Palm databases
31              
32             #'
33              
34             sub import
35             {
36             # This package handles any PDB.
37 3     3   26 &Palm::PDB::RegisterPDBHandlers(__PACKAGE__,
38             [ "", "" ]
39             );
40             }
41              
42             # sub new
43             # sub new_Record
44             # These are just inherited.
45              
46             sub ParseAppInfoBlock
47             {
48 0     0 1 0 my $self = shift;
49 0         0 my $data = shift;
50              
51 0         0 return $data;
52             }
53              
54             sub ParseSortBlock
55             {
56 0     0 1 0 my $self = shift;
57 0         0 my $data = shift;
58              
59 0         0 return $data;
60             }
61              
62             sub ParseRecord
63             {
64 3     3 1 2 my $self = shift;
65 3         7 my %record = @_;
66              
67 3         8 return \%record;
68             }
69              
70             sub ParseResource
71             {
72 0     0 1 0 my $self = shift;
73 0         0 my %resource = @_;
74              
75 0         0 return \%resource;
76             }
77              
78             sub PackAppInfoBlock
79             {
80 1     1 1 2 my $self = shift;
81              
82 1         4 return $self->{appinfo};
83             }
84              
85             sub PackSortBlock
86             {
87 1     1 1 2 my $self = shift;
88              
89 1         3 return $self->{sort};
90             }
91              
92             sub PackRecord
93             {
94 3     3 1 4 my $self = shift;
95 3         4 my $record = shift;
96              
97 3         7 return $record->{data};
98             }
99              
100             sub PackResource
101             {
102 0     0 1   my $self = shift;
103 0           my $resource = shift;
104              
105 0           return $resource->{data};
106             }
107              
108             1;
109              
110             __END__