| 1 | package Biblio::ILL::ISO::Extension; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 4 | ▶ | use Biblio::ILL::ISO::ILLASNtype; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 4 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 4 | our $VERSION = '0.01'; | |||||||||||||||||||
| 8 | #--------------------------------------------------------------------------- | ||||||||||||||||||||
| 9 | # Mods | ||||||||||||||||||||
| 10 | # 0.01 - 2003.08.11 - original version | ||||||||||||||||||||
| 11 | #--------------------------------------------------------------------------- | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 4 | ▶ | BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | # From the ASN | ||||||||||||||||||||
| 16 | # | ||||||||||||||||||||
| 17 | #Extension ::= SEQUENCE { | ||||||||||||||||||||
| 18 | # --identifier [0] IMPLICIT INTEGER, | ||||||||||||||||||||
| 19 | # identifier [0] OBJECT IDENTIFIER, | ||||||||||||||||||||
| 20 | # critical [1] IMPLICIT BOOLEAN, -- DEFAULT FALSE, | ||||||||||||||||||||
| 21 | # item [2] ANY DEFINED BY identifier | ||||||||||||||||||||
| 22 | # --item [2] APDU-Delivery-Info | ||||||||||||||||||||
| 23 | # } | ||||||||||||||||||||
| 24 | # | ||||||||||||||||||||
| 25 | # | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 28 | # | ||||||||||||||||||||
| 29 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 30 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||
| 31 | 0 | my $class = shift; | |||||||||||||||||||
| 32 | 0 | my $self = {}; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | ▶ | if (@_) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 35 | 0 | my ($identifier, $critical, $item) = @_; | |||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | ▶ | croak "missing identifier" unless ($identifier); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | 0 | ▶ | croak "missing critical" unless ($critical); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 39 | 0 | ▶ | croak "missing item" unless ($item); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 0 | $self->{"identifier"} = $identifier; | |||||||||||||||||||
| 42 | 0 | $self->{"critical"} = $critical; | |||||||||||||||||||
| 43 | 0 | $self->{"item"} = $item; | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 0 | ▶ | bless($self, ref($class) || $class); | ||||||||||||||||||
|
Condition0%0/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 47 | 0 | return ($self); | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 52 | # | ||||||||||||||||||||
| 53 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 54 | 0 | ▶ | sub set { | ||||||||||||||||||
|
Subroutine
set: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 55 | 0 | my $self = shift; | |||||||||||||||||||
| 56 | 0 | my ($identifier, $critical, $item) = @_; | |||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 0 | ▶ | croak "missing identifier" unless ($identifier); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 59 | 0 | ▶ | croak "missing critical" unless ($critical); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 60 | 0 | ▶ | croak "missing item" unless ($item); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 0 | $self->{"identifier"} = $identifier; | |||||||||||||||||||
| 63 | 0 | $self->{"critical"} = $critical; | |||||||||||||||||||
| 64 | 0 | $self->{"item"} = $item; | |||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | return; | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 70 | # | ||||||||||||||||||||
| 71 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 72 | 0 | ▶ | sub from_asn { | ||||||||||||||||||
|
Subroutine
from_asn: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||
| 73 | 0 | my $self = shift; | |||||||||||||||||||
| 74 | 0 | my $href = shift; | |||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 0 | foreach my $k (keys %$href) { | |||||||||||||||||||
| 77 | #print ref($self) . "...$k\n"; | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 0 | ▶ | if ($k =~ /^identifier$/) { | ||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||
| 80 | 0 | $self->{$k} = $href->{$k}; | |||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | } elsif ($k =~ /^critical$/) { | ||||||||||||||||||||
| 83 | 0 | $self->{$k} = $href->{$k}; | |||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | } elsif ($k =~ /^item$/) { | ||||||||||||||||||||
| 86 | 0 | ▶ | croak "need identifier!" unless ($self->{identifier}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 87 | 0 | $self->{$k} = SelectExtensionType($self->{identifier}); | |||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | } else { | ||||||||||||||||||||
| 90 | 0 | croak "invalid " . ref($self) . " element: [$k]"; | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | } | ||||||||||||||||||||
| 94 | 0 | return $self; | |||||||||||||||||||
| 95 | } | ||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 98 | # | ||||||||||||||||||||
| 99 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 100 | 0 | ▶ | sub SelectExtensionType { | ||||||||||||||||||
|
Subroutine
SelectExtensionType: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 101 | 0 | my $id = shift; | |||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | 0 | print "+----------------------\n"; | |||||||||||||||||||
| 104 | 0 | print "| id: $id\n"; | |||||||||||||||||||
| 105 | 0 | print "+----------------------\n"; | |||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | # depending on the $id, create the appropriate type | ||||||||||||||||||||
| 108 | # and return it. | ||||||||||||||||||||
| 109 | |||||||||||||||||||||
| 110 | 0 | return 1; | |||||||||||||||||||
| 111 | } | ||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 4 | 1; | |||||||||||||||||||