| 1 | package Finnigan::FileHeader; | ||||||||||
| 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 | 2 | ▶ | use overload ('""' => 'stringify'); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 2 | ▶ | sub decode { | ||||||||
|
Subroutine
decode: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 13 | 2 | my ($class, $stream) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 2 | my $fields = [ | |||||||||
| 16 | magic => ['v', 'UInt16'], | ||||||||||
| 17 | signature => ['U0C18', 'UTF16LE'], | ||||||||||
| 18 | "unknown_long[1]" => ['V', 'UInt32'], | ||||||||||
| 19 | "unknown_long[2]" => ['V', 'UInt32'], | ||||||||||
| 20 | "unknown_long[3]" => ['V', 'UInt32'], | ||||||||||
| 21 | "unknown_long[4]" => ['V', 'UInt32'], | ||||||||||
| 22 | version => ['V', 'UInt32'], | ||||||||||
| 23 | audit_start => ['object', 'Finnigan::AuditTag'], | ||||||||||
| 24 | audit_end => ['object', 'Finnigan::AuditTag'], | ||||||||||
| 25 | "unknown_long[5]" => ['V', 'UInt32'], | ||||||||||
| 26 | unknown_area => ['C60', 'RawBytes'], | ||||||||||
| 27 | tag => ['U0C1028', 'UTF16LE'], | ||||||||||
| 28 | ]; | ||||||||||
| 29 | |||||||||||
| 30 | 2 | my $self = Finnigan::Decoder->read($stream, $fields); | |||||||||
| 31 | |||||||||||
| 32 | # make sure we're reading the right file | ||||||||||
| 33 | 2 | my $magic = sprintf "%4x", $self->{data}->{magic}->{value}; | |||||||||
| 34 | 2 | ▶ | die "unrecognized magic number $magic" unless $self->{data}->{magic}->{value} == 0xa101; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | |||||||||||
| 36 | 2 | return bless $self, $class; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 74 | ▶ | sub version { | ||||||||
|
Subroutine
version: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 40 | 74 | my ( $self ) = @_; | |||||||||
| 41 | 74 | $self->{data}->{version}->{value}; | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | sub audit_start { | ||||||||
|
Subroutine
audit_start: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 45 | 1 | my ( $self ) = @_; | |||||||||
| 46 | 1 | $self->{data}->{audit_start}->{value}; | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 0 | ▶ | sub audit_end { | ||||||||
|
Subroutine
audit_end: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 50 | 0 | my ( $self ) = @_; | |||||||||
| 51 | 0 | $self->{data}->{audit_end}->{value}; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 0 | ▶ | sub tag { | ||||||||
|
Subroutine
tag: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 55 | 0 | my ( $self ) = @_; | |||||||||
| 56 | 0 | $self->{data}->{tag}->{value}; | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 0 | ▶ | sub stringify { | ||||||||
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 60 | 0 | my $self = shift; | |||||||||
| 61 | |||||||||||
| 62 | 0 | my $version = $self->version; | |||||||||
| 63 | 0 | my $audit_tag = $self->audit_start; | |||||||||
| 64 | 0 | return "V.$version; $audit_tag"; | |||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | 2 | 1; | |||||||||
| 68 | |||||||||||
| 69 | __END__ | ||||||||||