File Coverage

blib/lib/Finnigan/SeqRow.pm
Criterion Covered Total %
statement 28 28 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 4 4 100.0
total 41 42 97.6


line stmt bran cond sub pod time code
1             package Finnigan::SeqRow;
2              
3 2     2   9 use strict;
  2         4  
  2         73  
4 2     2   9 use warnings FATAL => qw( all );
  2         4  
  2         88  
5             our $VERSION = 0.0206;
6              
7 2     2   10 use Finnigan;
  2         4  
  2         37  
8 2     2   10 use base 'Finnigan::Decoder';
  2         3  
  2         1038  
9              
10             sub decode {
11 1     1 1 2 my ($class, $stream, $version) = @_;
12              
13 1         12 my @common_fields = (
14             injection => ['object', 'Finnigan::InjectionData'],
15             "unknown text[a]" => ['varstr', 'PascalStringWin32'],
16             "unknown text[b]" => ['varstr', 'PascalStringWin32'],
17             "id" => ['varstr', 'PascalStringWin32'],
18             "comment" => ['varstr', 'PascalStringWin32'],
19             "user label[1]" => ['varstr', 'PascalStringWin32'],
20             "user label[2]" => ['varstr', 'PascalStringWin32'],
21             "user label[3]" => ['varstr', 'PascalStringWin32'],
22             "user label[4]" => ['varstr', 'PascalStringWin32'],
23             "user label[5]" => ['varstr', 'PascalStringWin32'],
24             "inst method" => ['varstr', 'PascalStringWin32'],
25             "proc method" => ['varstr', 'PascalStringWin32'],
26             "file name" => ['varstr', 'PascalStringWin32'],
27             "path" => ['varstr', 'PascalStringWin32'],
28             );
29              
30 1         3 my %specific_fields;
31 1         6 $specific_fields{8} = [],
32             $specific_fields{57} = [
33             "vial" => ['varstr', 'PascalStringWin32'],
34             "unknown text[c]" => ['varstr', 'PascalStringWin32'],
35             "unknown text[d]" => ['varstr', 'PascalStringWin32'],
36             "unknown long" => ['V', 'UInt32'],
37             ];
38              
39 1         16 $specific_fields{60} = [
40             "vial" => ['varstr', 'PascalStringWin32'],
41             "unknown text[c]" => ['varstr', 'PascalStringWin32'],
42             "unknown text[d]" => ['varstr', 'PascalStringWin32'],
43             "unknown long" => ['V', 'UInt32'],
44             "unknown text[e]" => ['varstr', 'PascalStringWin32'],
45             "unknown text[f]" => ['varstr', 'PascalStringWin32'],
46             "unknown text[g]" => ['varstr', 'PascalStringWin32'],
47             "unknown text[h]" => ['varstr', 'PascalStringWin32'],
48             "unknown text[i]" => ['varstr', 'PascalStringWin32'],
49             "unknown text[j]" => ['varstr', 'PascalStringWin32'],
50             "unknown text[k]" => ['varstr', 'PascalStringWin32'],
51             "unknown text[l]" => ['varstr', 'PascalStringWin32'],
52             "unknown text[m]" => ['varstr', 'PascalStringWin32'],
53             "unknown text[n]" => ['varstr', 'PascalStringWin32'],
54             "unknown text[o]" => ['varstr', 'PascalStringWin32'],
55             "unknown text[p]" => ['varstr', 'PascalStringWin32'],
56             "unknown text[q]" => ['varstr', 'PascalStringWin32'],
57             "unknown text[r]" => ['varstr', 'PascalStringWin32'],
58             "unknown text[s]" => ['varstr', 'PascalStringWin32'],
59             ];
60 1         3 $specific_fields{62} = $specific_fields{60};
61 1         2 $specific_fields{63} = $specific_fields{60};
62 1         3 $specific_fields{64} = $specific_fields{60};
63 1         2 $specific_fields{66} = $specific_fields{60};
64              
65 1 50       4 die "don't know how to parse version $version" unless $specific_fields{$version};
66 1         3 my $self = Finnigan::Decoder->read($stream, [@common_fields, @{$specific_fields{$version}}]);
  1         8  
67              
68 1         24 return bless $self, $class;
69             }
70              
71             sub injection {
72 2     2 1 18 shift->{data}->{injection}->{value};
73             }
74              
75             sub file_name {
76 1     1 1 6 shift->{data}->{"file name"}->{value};
77             }
78              
79             sub path {
80 1     1 1 5 shift->{data}->{path}->{value};
81             }
82              
83             1;
84              
85             __END__