/[suikacvs]/messaging/manakai/lib/Message/DOM/DOMImplementation.pm
Suika

Contents of /messaging/manakai/lib/Message/DOM/DOMImplementation.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Sat Aug 11 13:06:39 2007 UTC (17 years, 3 months ago) by wakaba
Branch: MAIN
CVS Tags: manakai-release-0-4-0
Changes since 1.11: +8 -2 lines
++ manakai/lib/Message/CGI/ChangeLog	11 Aug 2007 13:05:16 -0000
2007-08-11  Wakaba  <wakaba@suika.fam.cx>

	* ChangeLog: New file.

	* HTTP.pm: New Perl module (a copy of
	SuikaWiki |lib/SuikaWiki/Input/HTTP.pm|).

1 package Message::DOM::DOMImplementation;
2 use strict;
3 our $VERSION=do{my @r=(q$Revision: 1.11 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
4 push our @ISA, 'Message::IF::DOMImplementation',
5 'Message::IF::AtomDOMImplementation';
6
7 sub ____new ($) {
8 my $self = bless {}, shift;
9 return $self;
10 } # ____new
11 *new = \&____new;
12
13 sub AUTOLOAD {
14 my $method_name = our $AUTOLOAD;
15 $method_name =~ s/.*:://;
16 return if $method_name eq 'DESTROY';
17
18 my $module_name = {
19 create_atom_entry_document => 'Message::DOM::Atom::AtomElement',
20 create_atom_feed_document => 'Message::DOM::Atom::AtomElement',
21 create_document => 'Message::DOM::Document',
22 create_document_type => 'Message::DOM::DocumentType',
23 create_uri_reference => 'Message::URI::URIReference',
24 }->{$method_name};
25 if ($module_name) {
26 eval qq{ require $module_name } or die $@;
27 no strict 'refs';
28 goto &{ $AUTOLOAD };
29 } else {
30 require Carp;
31 Carp::croak (qq<Can't locate method "$AUTOLOAD">);
32 }
33 } # AUTOLOAD
34
35 ## URIImplementation
36 sub create_uri_reference ($$);
37
38 our $HasFeature;
39 $HasFeature->{core}->{''} = 1;
40 $HasFeature->{core}->{'1.0'} = 1;
41 $HasFeature->{core}->{'2.0'} = 1;
42 $HasFeature->{core}->{'3.0'} = 1;
43 $HasFeature->{html}->{''} = 1;
44 $HasFeature->{html}->{'5.0'} = 1; ## TODO: 1.0, 2.0
45 $HasFeature->{xhtml}->{''} = 1;
46 $HasFeature->{xhtml}->{'5.0'} = 1; ## TODO: 2.0
47 $HasFeature->{traversal}->{''} = 1;
48 $HasFeature->{traversal}->{'2.0'} = 1;
49 $HasFeature->{xml}->{''} = 1;
50 $HasFeature->{xml}->{'1.0'} = 1;
51 $HasFeature->{xml}->{'2.0'} = 1;
52 $HasFeature->{xml}->{'3.0'} = 1;
53 $HasFeature->{xmlversion}->{''} = 1;
54 $HasFeature->{xmlversion}->{'1.0'} = 1;
55 $HasFeature->{xmlversion}->{'1.1'} = 1;
56 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/atom>}->{''} = 1;
57 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/atom>}->{'1.0'} = 1;
58 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/atomthreading>}->{''} = 1;
59 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/atomthreading>}->{'1.0'} = 1;
60 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/min>}->{''} = 1;
61 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/min>}->{'3.0'} = 1;
62 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/uri>}->{''} = 1;
63 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/uri>}->{'4.0'} = 1;
64 $HasFeature->{q<http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#minimum>}->{''} = 1;
65 $HasFeature->{q<http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#minimum>}->{'3.0'} = 1;
66 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/xdoctype>}->{''} = 1;
67 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/xdoctype>}->{'3.0'} = 1;
68 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/xdoctypedeclaration>}->{''} = 1;
69 $HasFeature->{q<http://suika.fam.cx/www/2006/feature/xdoctypedeclaration>}->{'3.0'} = 1;
70
71 sub ___report_error { $_[1]->throw }
72
73 ## |DOMImplementation| methods
74
75 sub create_document ($;$$$);
76
77 sub create_document_type ($$$$);
78
79 sub get_feature ($$;$) {
80 my $feature = lc $_[1]; ## TODO: What |lc|?
81 $feature =~ s/^\+//;
82
83 if ($HasFeature->{$feature}->{defined $_[2] ? $_[2] : ''}) {
84 return $_[0];
85 } else {
86 return undef;
87 }
88 } # get_feature
89
90 sub has_feature ($$;$) {
91 my $feature = lc $_[1];
92 my $plus = $feature =~ s/^\+// ? 1 : 0;
93 return $HasFeature->{$feature}->{defined $_[2] ? $_[2] : ''};
94 } # has_feature
95
96 ## |AtomDOMImplementation| methods
97
98 sub create_atom_entry_document ($$;$$);
99
100 sub create_atom_feed_document ($$;$$);
101
102 package Message::IF::DOMImplementation;
103 package Message::IF::AtomDOMImplementation;
104
105 =head1 LICENSE
106
107 Copyright 2007 Wakaba <w@suika.fam.cx>
108
109 This program is free software; you can redistribute it and/or
110 modify it under the same terms as Perl itself.
111
112 =cut
113
114 1;
115 ## $Date: 2007/07/29 08:31:14 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24