| 1 | package XML::ASX::File; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION $AUTOLOAD @ISA %ASX_SLOTS); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | @ISA = qw(XML::ASX); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use XML::ASX::Entry; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use XML::ASX::Repeat; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use XML::ASX::Event; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use overload '""' => \&xml; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | $VERSION = '0.01'; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 1 | my %RW_SLOTS = ( | |||||||||||||||||||||||||||
| 17 | title => '', | ||||||||||||||||||||||||||||
| 18 | moreinfo => '', | ||||||||||||||||||||||||||||
| 19 | target => '', | ||||||||||||||||||||||||||||
| 20 | copyright => '', | ||||||||||||||||||||||||||||
| 21 | base => '', | ||||||||||||||||||||||||||||
| 22 | author => '', | ||||||||||||||||||||||||||||
| 23 | abstract => '', | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | version => '3.0', | ||||||||||||||||||||||||||||
| 26 | previewmode => 'YES', | ||||||||||||||||||||||||||||
| 27 | bannerbar => 'AUTO', | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | banner => '', | ||||||||||||||||||||||||||||
| 30 | logo_icon => '', | ||||||||||||||||||||||||||||
| 31 | logo_mark => '', | ||||||||||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 24 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||
| 35 | 24 | my $self = shift; | |||||||||||||||||||||||||||
| 36 | 24 | my $param = $AUTOLOAD; | |||||||||||||||||||||||||||
| 37 | 24 | $param =~ s/.*:://; | |||||||||||||||||||||||||||
| 38 | 24 | ▶ | die(__PACKAGE__." doesn't implement $param") unless defined($RW_SLOTS{$param}) or defined($ASX_SLOTS{$param}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $RW_SLOTS{$param} or defined $XML::ASX::File::ASX_SLOTS{$param}
MC/DC50%1/2
defined $RW_SLOTS{$param} or defined $XML::ASX::File::ASX_SLOTS{$param}
defined $RW_SLOTS{$param}
defined $XML::ASX::File::ASX_SLOTS{$param}
Truth table66%2/3
A or B
A= defined $RW_SLOTS{$param}B= defined $XML::ASX::File::ASX_SLOTS{$param}
| |||||||||||||||||||||||||||||
| 39 | 23 | ▶ | $self->{$param} = shift if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 23 | return $self->{$param}; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 44 | 1 | my $class = shift; | |||||||||||||||||||||||||||
| 45 | 1 | my %param = @_; | |||||||||||||||||||||||||||
| 46 | 1 | my $self = bless {}, $class; | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 1 | $self->$_($ASX_SLOTS{$_}) foreach keys %ASX_SLOTS; | |||||||||||||||||||||||||||
| 49 | 1 | $self->$_($RW_SLOTS{$_}) foreach keys %RW_SLOTS; | |||||||||||||||||||||||||||
| 50 | 1 | $self->$_($param{$_}) foreach keys %param; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 1 | return $self; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 1 | ▶ | sub add_repeat { | ||||||||||||||||||||||||||
|
Subroutine
add_repeat: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 56 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 57 | 1 | ▶ | my $repeat = shift || XML::ASX::Repeat->new; | ||||||||||||||||||||||||||
|
Condition33%1/3
shift() || 'XML::ASX::Repeat'->new
MC/DC0%0/2
shift() || 'XML::ASX::Repeat'->new
shift()
'XML::ASX::Repeat'->new
Truth table33%1/3
A || B
A= shift()B= 'XML::ASX::Repeat'->new
| |||||||||||||||||||||||||||||
| 58 | 1 | push @{$self->{queue}}, $repeat; | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 1 | return $self->{queue}->[scalar @{$self->{queue}} - 1]; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 1 | ▶ | sub add_entry { | ||||||||||||||||||||||||||
|
Subroutine
add_entry: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 64 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 65 | 1 | ▶ | my $entry = shift || XML::ASX::Entry->new; | ||||||||||||||||||||||||||
|
Condition33%1/3
shift() || 'XML::ASX::Entry'->new
MC/DC0%0/2
shift() || 'XML::ASX::Entry'->new
shift()
'XML::ASX::Entry'->new
Truth table33%1/3
A || B
A= shift()B= 'XML::ASX::Entry'->new
| |||||||||||||||||||||||||||||
| 66 | 1 | push @{$self->{queue}}, $entry; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 1 | return $self->{queue}->[scalar @{$self->{queue}} - 1]; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 1 | ▶ | sub add_event { | ||||||||||||||||||||||||||
|
Subroutine
add_event: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 72 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 73 | 1 | ▶ | my $event = shift || XML::ASX::Event->new; | ||||||||||||||||||||||||||
|
Condition33%1/3
shift() || 'XML::ASX::Event'->new
MC/DC0%0/2
shift() || 'XML::ASX::Event'->new
shift()
'XML::ASX::Event'->new
Truth table33%1/3
A || B
A= shift()B= 'XML::ASX::Event'->new
| |||||||||||||||||||||||||||||
| 74 | 1 | push @{$self->{queue}}, $event; | |||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 1 | return $self->{queue}->[scalar @{$self->{queue}} - 1]; | |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 0 | ▶ | sub xml { | ||||||||||||||||||||||||||
|
Subroutine
xml: not called CC=13 SCAR=52.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 80 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 0 | my $paramstr = ''; | |||||||||||||||||||||||||||
| 83 | 0 | my %param = $self->each_param; | |||||||||||||||||||||||||||
| 84 | 0 | foreach my $key (keys %param){ | |||||||||||||||||||||||||||
| 85 | 0 | $paramstr .= $self->entag('PARAM','',{NAME=>$key,VALUE=>$param{$key}},1); | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 0 | my $bannercontent = ''; | |||||||||||||||||||||||||||
| 89 | 0 | ▶ | $bannercontent .= $self->entag('MoreInfo','',{href=>$self->moreinfo,target=>$self->target},1) if $self->moreinfo; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 90 | 0 | ▶ | $bannercontent .= $self->entag('Abstract',$self->abstract) if $self->abstract; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 0 | my $content = ''; | |||||||||||||||||||||||||||
| 93 | 0 | ▶ | $content .= $self->entag('ABSTRACT',$self->abstract) if $self->abstract; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 94 | 0 | ▶ | $content .= $self->entag('TITLE',$self->title) if $self->title; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $content .= $self->entag('AUTHOR',$self->author) if $self->author; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 96 | 0 | ▶ | $content .= $self->entag('BASE','',{href=>$self->base}) if $self->base; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 97 | 0 | ▶ | $content .= $self->entag('COPYRIGHT',$self->copyright) if $self->copyright; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 98 | 0 | ▶ | $content .= $self->entag('Logo','',{href=>$self->logo_icon,style=>'ICON'},1) if $self->logo_icon; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 99 | 0 | ▶ | $content .= $self->entag('Logo','',{href=>$self->logo_mark,style=>'MARK'},1) if $self->logo_mark; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | $content .= $self->entag('Banner',$bannercontent,{href=>$self->banner}) if $self->banner; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | $content .= $self->entag('MoreInfo','',{href=>$self->moreinfo,target=>$self->target},1) if $self->moreinfo; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 102 | 0 | $content .= $paramstr; | |||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 0 | $content .= join "", ($self->each_in_queue); | |||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 0 | return $self->entag('ASX',$content,{previewmode => $self->previewmode, version => $self->version, BannerBar => $self->bannerbar},0); | |||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 1 | 1; | |||||||||||||||||||||||||||
| 110 | __END__ | ||||||||||||||||||||||||||||