« blib/lib/XML/Pastor/Schema/SimpleType.pm
↑ Summary
test/out/lib/XML/Pastor/Test/Type/Country_currency.pm »
| 1 | 10 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 10 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 10 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 10 | ▶ | no warnings qw(uninitialized); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | #====================================================================== | ||
| 8 | package XML::Pastor::Builtin::base64Binary; | ||
| 9 | 10 | ▶ | use XML::Pastor::Builtin::Scalar; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 10 | ▶ | use MIME::Base64 (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 10 | our @ISA = qw(XML::Pastor::Builtin::Scalar); | |
| 13 | |||
| 14 | 10 | XML::Pastor::Builtin::base64Binary->XmlSchemaType( bless( { | |
| 15 | 'class' => 'XML::Pastor::Builtin::base64Binary', | ||
| 16 | 'contentType' => 'simple', | ||
| 17 | 'derivedBy' => 'restriction', | ||
| 18 | 'name' => 'base64Binary|http://www.w3.org/2001/XMLSchema', | ||
| 19 | |||
| 20 | 'regex' => qr /^([0-9a-zA-Z\+\\\=][0-9a-zA-Z\+\\\=])+$/, # Regex shamelessly copied from XML::Validator::Schema by Sam Tregar | ||
| 21 | }, 'XML::Pastor::Schema::SimpleType' ) ); | ||
| 22 | |||
| 23 | |||
| 24 | #----------------------------------------------------------------- | ||
| 25 | 0 | ▶ | sub toBinary { |
|
Subroutine
toBinary: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | 0 | my $self = shift; | |
| 27 | 0 | my $value = $self->__value() . ""; | |
| 28 | 0 | return MIME::Base64::decode($value) | |
| 29 | } | ||
| 30 | |||
| 31 | #----------------------------------------------------------------- | ||
| 32 | 0 | ▶ | sub setFromBinary($$) { |
|
Subroutine
setFromBinary: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | 0 | my $self = shift; | |
| 34 | 0 | return $self->__value(MIME::Base64::encode($_[0], '')); | |
| 35 | } | ||
| 36 | |||
| 37 | #----------------------------------------------------------------- | ||
| 38 | # A CONSTRUCTOR | ||
| 39 | #----------------------------------------------------------------- | ||
| 40 | 0 | ▶ | sub fromBinary($$) { |
|
Subroutine
fromBinary: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 41 | 0 | my $self = shift->new(); | |
| 42 | 0 | return $self->setFromBinary(@_); | |
| 43 | } | ||
| 44 | |||
| 45 | |||
| 46 | 10 | 1; | |
| 47 | |||
| 48 | __END__ | ||