AnyData/Storage/PassThru.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 14 totaltotal 0.0% 0 / 68 CC 1 SCAR 6.9
CC
1
Cov
0%
file2str
2.0
push_row
2.0
seek_first_record
2.0
CRAP 2.0
1 #########################################################################
2 package AnyData::Storage::PassThru;
3 #########################################################################
4 # This module is copyright (c), 2000 by Jeff Zucker
5 # All rights reserved.
6 #########################################################################
7 # Nothing of interest here, it just passes the storage duties to the
8 # parser for formats like XML that do both format and storage
9 #########################################################################
10 use strict;
11 use warnings;
12 use vars qw($VERSION @ISA);
13  
14 $VERSION = '0.12';
15  
16 use AnyData::Storage::File;
17 @ISA = qw( AnyData::Storage::File);
18 sub file2str { 1 }
19 sub push_row { my($s,$f)=@_;$s->{parser}->push_row(@$f) }
20 sub seek_first_record { shift->{parser}->seek_first_record }
21 sub get_col_names { shift->{col_names} }
22 sub delete_record { shift->{parser}->delete_record }
23 sub truncate { shift->{parser}->truncate(@_) }
24 sub drop { shift->{parser}->drop(@_)}
25 sub close_table { shift->{parser}->close_table(@_)}
26 sub get_pos { shift->{parser}->get_pos(@_)}
27 sub go_pos { shift->{parser}->go_pos(@_)}
28 sub seek { shift->{parser}->seek(@_)}
29 sub export { shift->{parser}->export(@_)}
30  
31 sub DESTROY {
32 #print "PASSTHRU DESTROYED";
33 }
34  
35 #####################################
36 # push_names()
37 #####################################
38 sub print_col_names {
39 my($self, $parser, $names) = @_;
40 $names = $parser->push_names($names);
41 $self->{col_names} = $names;
42 my($col_nums) = {};
43 for (my $i = 0; $i < @$names; $i++) {
44 $col_nums->{$names->[$i]} = $i;
45 }
46 $self->{col_nums} = $col_nums;
47 }
48  
49 1;