File Coverage

lib/Parse/AFP/PTX.pm
Criterion Covered Total %
statement 6 12 50.0
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod n/a
total 8 17 47.0


line stmt bran cond sub pod time code
1             package Parse::AFP::PTX;
2 1     1   775 use base 'Parse::AFP::Record';
  1         3  
  1         90  
3              
4 1         208 use constant SUBFORMAT => (
5             EscapeSequence => 'H4', # 2BD3
6             'PTX::ControlSequence' => ['C/a* X', '*'],
7 1     1   5 );
  1         2  
8              
9             sub _refresh {
10 0     0     my ($self) = @_;
11              
12 0           foreach my $member ($self->members) {
13 0           $member->SetControlCode(
14             unpack('H2', pack('H2', $member->ControlCode) | "\x01")
15             );
16             }
17              
18 0 0         if (my $last_member = ($self->members)[-1]) {
19 0           $last_member->SetControlCode(
20             unpack('H2', pack('H2', $last_member->ControlCode) ^ "\x01")
21             );
22             }
23              
24 0           $self->SUPER::refresh;
25             }
26              
27             # sub load_struct {
28             # XXX - first get the header, then split with 2BD3,
29             # then do a step-by-step tokenization to make sure
30             # raw text fields get respected
31             # }
32              
33             1;