| 1 | package Finnigan::MethodFile; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings FATAL => qw( all ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | our $VERSION = 0.0206; | |||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use Finnigan; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use base 'Finnigan::Decoder'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | sub decode { | ||||||||
|
Subroutine
decode: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 12 | 1 | my ($class, $stream, $version) = @_; | |||||||||
| 13 | |||||||||||
| 14 | 1 | my @fields = ( | |||||||||
| 15 | "header" => ['object', 'Finnigan::FileHeader'], | ||||||||||
| 16 | "file size" => ['V', 'UInt32'], | ||||||||||
| 17 | "orig file name" => ['varstr', 'PascalStringWin32'], | ||||||||||
| 18 | "n" => ['V', 'UInt32'], | ||||||||||
| 19 | ); | ||||||||||
| 20 | |||||||||||
| 21 | 1 | my $self = Finnigan::Decoder->read($stream, \@fields, $version); | |||||||||
| 22 | 1 | bless $self, $class; | |||||||||
| 23 | |||||||||||
| 24 | 1 | ▶ | if ( $self->n ) { # this is a hack, because I don't have an iterate_hash() method | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | # the tags come in pairs, so retreive them later with a method | ||||||||||
| 26 | 1 | $self->iterate_scalar($stream, 2*$self->n, "name trans" => ['varstr', 'PascalStringWin32']); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 1 | $self->SUPER::decode($stream, ["container" => ['object', 'Finnigan::OLE2File']]); | |||||||||
| 30 | |||||||||||
| 31 | 1 | return $self; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 4 | ▶ | sub n { | ||||||||
|
Subroutine
n: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 35 | 4 | shift->{data}->{n}->{value}; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 1 | ▶ | sub file_size { | ||||||||
|
Subroutine
file_size: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 39 | 1 | shift->{data}->{"file size"}->{value}; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 11 | ▶ | sub container { | ||||||||
|
Subroutine
container: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 43 | 11 | shift->{data}->{"container"}->{value}; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 0 | ▶ | sub header { | ||||||||
|
Subroutine
header: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 47 | 0 | shift->{data}->{"header"}->{value}; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 4 | ▶ | sub translation_table { | ||||||||
|
Subroutine
translation_table: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 51 | 4 | shift->{data}->{"name trans"}->{value}; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 2 | ▶ | sub instrument_name { | ||||||||
|
Subroutine
instrument_name: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||
| 55 | 2 | my ($self, $i) = @_; | |||||||||
| 56 | 2 | my $n = $self->n; | |||||||||
| 57 | 2 | ▶ | die "instrument index cannot be 0" if $i == 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | 2 | ▶ | die "instrument index cannot be greater than $n" if $i > $n; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 2 | $i--; | |||||||||
| 60 | 2 | return @{$self->translation_table}[2*$i .. 2*$i + 1]; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 2 | 1; | |||||||||
| 64 | __END__ | ||||||||||