1 |
#!/usr/bin/perl |
package Message::URI::URIReference; |
|
## This file is automatically generated |
|
|
## at 2006-12-30T11:56:30+00:00, |
|
|
## from file "../URI/Generic.dis", |
|
|
## module <http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic>, |
|
|
## for <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#all>. |
|
|
## Don't edit by hand! |
|
2 |
use strict; |
use strict; |
3 |
require Message::DOM::DOMCore; |
our $VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; |
|
require Message::Util::Error::DOMException; |
|
|
package Message::URI::Generic; |
|
|
our $VERSION = 20061230.1156; |
|
|
package Message::URI::IF::URIImplementation; |
|
|
our $VERSION = 20061230.1156; |
|
|
package Message::URI::Generic::ManakaiURIImplementation; |
|
|
our $VERSION = 20061230.1156; |
|
|
push our @ISA, 'Message::DOM::IF::DOMImplementation', |
|
|
'Message::DOM::IF::DOMImplementation', |
|
|
'Message::URI::IF::URIImplementation'; |
|
|
push @Message::DOM::DOMCore::ManakaiDOMImplementation::ISA, q<Message::URI::Generic::ManakaiURIImplementation> unless Message::DOM::DOMCore::ManakaiDOMImplementation->isa (q<Message::URI::Generic::ManakaiURIImplementation>); |
|
|
sub create_uri_reference ($$) { |
|
|
my ($self, $uri) = @_; |
|
|
my $r; |
|
|
|
|
|
{ |
|
|
|
|
|
if |
|
|
(UNIVERSAL::isa ($uri, |
|
|
'Message::URI::IF::URIReference' |
|
|
)) { |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
local $Error::Depth = $Error::Depth + 1; |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
$r = $uri-> |
|
|
clone_uri_reference |
|
|
; |
|
|
|
|
4 |
|
|
5 |
|
require Message::Util::Error::DOMException; |
6 |
|
|
7 |
} |
package Message::DOM::IF::URIImplementation; |
8 |
|
package Message::DOM::DOMImplementation; |
9 |
|
push our @ISA, 'Message::DOM::IF::URIImplementation'; |
|
;} |
|
|
|
|
|
; |
|
|
} elsif (ref $uri eq 'SCALAR') { |
|
|
$r = bless $uri, |
|
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
|
} else { |
|
|
my $v = "$uri"; |
|
|
$r = bless \$v, |
|
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
$r} |
|
|
$Message::DOM::ImplFeature{q<Message::URI::Generic::ManakaiURIImplementation>}->{q<http://suika.fam.cx/www/2006/feature/uri>}->{q<4.0>} ||= 1; |
|
|
$Message::DOM::ImplFeature{q<Message::URI::Generic::ManakaiURIImplementation>}->{q<http://suika.fam.cx/www/2006/feature/uri>}->{q<>} = 1; |
|
|
$Message::DOM::DOMFeature::ClassInfo->{q<Message::URI::Generic::ManakaiURIImplementation>}->{has_feature} = {'', |
|
|
{'', |
|
|
'1'}, |
|
|
'http://suika.fam.cx/www/2006/feature/min', |
|
|
{'', |
|
|
'1', |
|
|
'3.0', |
|
|
'1'}, |
|
|
'http://suika.fam.cx/www/2006/feature/uri', |
|
|
{'', |
|
|
'1', |
|
|
'4.0', |
|
|
'1'}, |
|
|
'http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#minimum', |
|
|
{'', |
|
|
'1', |
|
|
'3.0', |
|
|
'1'}, |
|
|
'xml', |
|
|
{'', |
|
|
'1', |
|
|
'1.0', |
|
|
'1', |
|
|
'2.0', |
|
|
'1', |
|
|
'3.0', |
|
|
'1'}, |
|
|
'xmlversion', |
|
|
{'', |
|
|
'1', |
|
|
'1.0', |
|
|
'1', |
|
|
'1.1', |
|
|
'1'}}; |
|
|
$Message::DOM::ClassPoint{q<Message::URI::Generic::ManakaiURIImplementation>} = 15.1; |
|
|
package Message::URI::IF::URIReference; |
|
|
our $VERSION = 20061230.1156; |
|
|
package Message::URI::Generic::ManakaiURIReference; |
|
|
our $VERSION = 20061230.1156; |
|
|
push our @ISA, 'Message::URI::IF::URIReference'; |
|
|
sub _new ($$) { |
|
|
my ($self, $uri) = @_; |
|
|
my $r; |
|
|
|
|
|
{ |
|
10 |
|
|
11 |
my |
sub create_uri_reference ($$) { |
12 |
$v; |
if (UNIVERSAL::isa ($_[1], 'Message::DOM::IF::URIReference')) { |
13 |
if (ref $uri) { |
local $Error::Depth = $Error::Depth + 1; |
14 |
if (UNIVERSAL::isa ($uri, |
return $_[1]->clone_uri_reference; |
15 |
'Message::URI::IF::URIReference' |
} elsif (ref $_[1] eq 'SCALAR') { |
16 |
)) { |
my $uri = $_[1]; |
17 |
my $w = $$uri; |
return bless $uri, 'Message::URI::URIReference'; |
|
$v = \$w; |
|
|
} elsif (ref $uri eq 'SCALAR') { |
|
|
$v = $uri; |
|
18 |
} else { |
} else { |
19 |
$v = \$uri; |
my $v = "$_[1]"; |
20 |
|
return bless \$v, 'Message::URI::URIReference'; |
21 |
} |
} |
|
} else { |
|
|
$v = \$uri; |
|
22 |
} |
} |
|
$r = bless $v, |
|
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
23 |
|
|
24 |
|
our $HasFeature; |
25 |
|
$HasFeature->{'http://suika.fam.cx/www/2006/feature/uri'}->{''} = 1; |
26 |
|
$HasFeature->{'http://suika.fam.cx/www/2006/feature/uri'}->{'4.0'} = 1; |
27 |
|
|
28 |
|
package Message::DOM::IF::URIReference; |
29 |
|
package Message::URI::URIReference; |
30 |
|
push our @ISA, 'Message::DOM::IF::URIReference'; |
31 |
|
|
|
} |
|
|
$r} |
|
32 |
sub uri_reference ($;$) { |
sub uri_reference ($;$) { |
33 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
34 |
my $r = ''; |
my $r = ''; |
762 |
|
|
763 |
} |
} |
764 |
} |
} |
765 |
|
|
766 |
|
## TODO: An attribute that returns the number of path segments is necessary. |
767 |
|
|
768 |
sub is_uri ($;$) { |
sub is_uri ($;$) { |
769 |
if (@_ == 1) {my ($self) = @_; |
if (@_ == 1) {my ($self) = @_; |
770 |
my $r = 0; |
my $r = 0; |
1676 |
Encode; |
Encode; |
1677 |
my $v = Encode::encode ('utf8', $$self); |
my $v = Encode::encode ('utf8', $$self); |
1678 |
$v =~ s/([<>"{}|\\\^`\x00-\x20\x7E-\xFF])/sprintf '%%%02X', ord $1/ge; |
$v =~ s/([<>"{}|\\\^`\x00-\x20\x7E-\xFF])/sprintf '%%%02X', ord $1/ge; |
1679 |
$r = bless \$v, |
$r = bless \$v, 'Message::URI::URIReference'; |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
|
|
|
|
|
|
|
|
|
1680 |
} |
} |
1681 |
|
|
1682 |
|
|
2019 |
# PERCENT SIGN, reserved, not-allowed in ASCII |
# PERCENT SIGN, reserved, not-allowed in ASCII |
2020 |
'%'.$1; |
'%'.$1; |
2021 |
} else { |
} else { |
2022 |
chr $ch; |
pack 'C', $ch; |
2023 |
} |
} |
2024 |
}ge; |
}ge; |
2025 |
$v =~ s{( |
$v =~ s{( |
2049 |
}gex; |
}gex; |
2050 |
$v =~ s/([<>"{}|\\\^`\x00-\x20\x7F])/sprintf '%%%02X', ord $1/ge; |
$v =~ s/([<>"{}|\\\^`\x00-\x20\x7F])/sprintf '%%%02X', ord $1/ge; |
2051 |
$v = Encode::decode ('utf8', $v); |
$v = Encode::decode ('utf8', $v); |
2052 |
$r = bless \$v, |
$r = bless \$v, 'Message::URI::URIReference'; |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
|
|
|
|
|
|
|
|
|
2053 |
} |
} |
2054 |
|
|
2055 |
|
|
2128 |
} |
} |
2129 |
my $ba = ref $base eq 'SCALAR' |
my $ba = ref $base eq 'SCALAR' |
2130 |
? $base |
? $base |
2131 |
: ref $base eq |
: ref $base eq 'Message::URI::URIReference' |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
|
|
2132 |
? $base |
? $base |
2133 |
: ref $base |
: ref $base |
2134 |
? \"$base" |
? \"$base" |
2222 |
$result .= '?' . $t_query if defined $t_query ; |
$result .= '?' . $t_query if defined $t_query ; |
2223 |
$result .= '#' . $t_frag if defined $t_frag ; |
$result .= '#' . $t_frag if defined $t_frag ; |
2224 |
|
|
2225 |
$r = bless \$result, |
$r = bless \$result, 'Message::URI::URIReference'; |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
|
|
|
|
|
|
2226 |
|
|
2227 |
} |
} |
2228 |
|
|
2327 |
$target =~ s/#.*\z//; |
$target =~ s/#.*\z//; |
2328 |
my $ba = ref $base eq 'SCALAR' |
my $ba = ref $base eq 'SCALAR' |
2329 |
? $$base |
? $$base |
2330 |
: ref $base eq |
: ref $base eq 'Message::URI::URIReference' |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
|
|
2331 |
? $$base |
? $$base |
2332 |
: ref $base |
: ref $base |
2333 |
? "$base" |
? "$base" |
2366 |
@base; |
@base; |
2367 |
my $ba = ref $base eq 'SCALAR' |
my $ba = ref $base eq 'SCALAR' |
2368 |
? $base |
? $base |
2369 |
: ref $base eq |
: ref $base eq 'Message::URI::URIReference' |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
|
|
2370 |
? $base |
? $base |
2371 |
: ref $base |
: ref $base |
2372 |
? \"$base" |
? \"$base" |
2481 |
$result .= '?' . $ref[3] if defined $ref[3]; # query |
$result .= '?' . $ref[3] if defined $ref[3]; # query |
2482 |
$result .= '#' . $ref[4] if defined $ref[4]; # fragment |
$result .= '#' . $ref[4] if defined $ref[4]; # fragment |
2483 |
|
|
2484 |
$r = bless \$result, |
$r = bless \$result, 'Message::URI::URIReference'; |
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
2485 |
|
|
2486 |
|
|
2487 |
|
|
2495 |
|
|
2496 |
} |
} |
2497 |
$r} |
$r} |
|
sub clone ($) { |
|
|
my ($self) = @_; |
|
|
my $r; |
|
|
|
|
|
{ |
|
|
|
|
|
my |
|
|
$v = $$self; |
|
|
$r = bless \$v, |
|
|
'Message::URI::Generic::ManakaiURIReference' |
|
|
; |
|
2498 |
|
|
2499 |
|
sub clone ($) { |
2500 |
|
my $self = shift; |
2501 |
|
my $v = $$self; |
2502 |
|
return bless \$v, ref $self; |
2503 |
|
} # clone |
2504 |
|
|
|
} |
|
|
$r} |
|
2505 |
*clone_uri_reference = \&clone; |
*clone_uri_reference = \&clone; |
2506 |
|
|
2507 |
use overload |
use overload |
2508 |
bool => sub () {1}, |
bool => sub () {1}, |
2509 |
'""' => 'stringify', |
'""' => 'stringify', |
2542 |
$r} |
$r} |
2543 |
, |
, |
2544 |
fallback => 1; |
fallback => 1; |
2545 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::URI::Generic::ManakaiURIReference>}->{has_feature} = {'http://suika.fam.cx/www/2006/feature/uri', |
|
|
{'', |
|
|
'1', |
|
|
'4.0', |
|
|
'1'}}; |
|
|
$Message::DOM::ClassPoint{q<Message::URI::Generic::ManakaiURIReference>} = 4; |
|
|
for ($Message::DOM::IF::DOMImplementation::){} |
|
|
## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL> |
|
2546 |
1; |
1; |
2547 |
|
## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL> |
2548 |
|
## $Date$ |