Raw.pm

filter: Statementstmt 64.7% 22 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 8 / 12 Podpod 100% 8 / 8 totaltotal 70.3% 38 / 54 SCAR 0.4
CC
1
Cov
65%
ParseAppInfoBlock
2.0
ParseSortBlock
2.0
ParseResource
2.0
CRAP 1.0
« PDB.pm ↑ Summary
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 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 3 ▶use Palm::PDB;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 3 our $VERSION = '1.016'; # VERSION
26 # This file is part of Palm-PDB 1.016 (January 24, 2015)
27  
28 3 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 ▶ &Palm::PDB::RegisterPDBHandlers(__PACKAGE__,
Subroutine import: called CC=1 SCAR=0.0
38 [ "", "" ]
39 );
40 }
41  
42 # sub new
43 # sub new_Record
44 # These are just inherited.
45  
46 sub ParseAppInfoBlock
47 {
48 0 ▶ my $self = shift;
Subroutine ParseAppInfoBlock: not called CC=1 SCAR=6.9
Pod documented
49 0 my $data = shift;
50  
51 0 return $data;
52 }
53  
54 sub ParseSortBlock
55 {
56 0 ▶ my $self = shift;
Subroutine ParseSortBlock: not called CC=1 SCAR=6.9
Pod documented
57 0 my $data = shift;
58  
59 0 return $data;
60 }
61  
62 sub ParseRecord
63 {
64 3 ▶ my $self = shift;
Subroutine ParseRecord: called CC=1 SCAR=0.0
Pod documented
65 3 my %record = @_;
66  
67 3 return \%record;
68 }
69  
70 sub ParseResource
71 {
72 0 ▶ my $self = shift;
Subroutine ParseResource: not called CC=1 SCAR=6.9
Pod documented
73 0 my %resource = @_;
74  
75 0 return \%resource;
76 }
77  
78 sub PackAppInfoBlock
79 {
80 1 ▶ my $self = shift;
Subroutine PackAppInfoBlock: called CC=1 SCAR=0.0
Pod documented
81  
82 1 return $self->{appinfo};
83 }
84  
85 sub PackSortBlock
86 {
87 1 ▶ my $self = shift;
Subroutine PackSortBlock: called CC=1 SCAR=0.0
Pod documented
88  
89 1 return $self->{sort};
90 }
91  
92 sub PackRecord
93 {
94 3 ▶ my $self = shift;
Subroutine PackRecord: called CC=1 SCAR=0.0
Pod documented
95 3 my $record = shift;
96  
97 3 return $record->{data};
98 }
99  
100 sub PackResource
101 {
102 0 ▶ my $self = shift;
Subroutine PackResource: not called CC=1 SCAR=6.9
Pod documented
103 0 my $resource = shift;
104  
105 0 return $resource->{data};
106 }
107  
108 3 1;
109  
110 __END__
« PDB.pm ↑ Summary