1 | /* |
---|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
3 | * contributor license agreements. See the NOTICE file distributed with |
---|
4 | * this work for additional information regarding copyright ownership. |
---|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
6 | * (the "License"); you may not use this file except in compliance with |
---|
7 | * the License. You may obtain a copy of the License at |
---|
8 | * |
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
10 | * |
---|
11 | * Unless required by applicable law or agreed to in writing, software |
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
14 | * See the License for the specific language governing permissions and |
---|
15 | * limitations under the License. |
---|
16 | */ |
---|
17 | |
---|
18 | /* |
---|
19 | * $Id: DOM_DocumentType.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef DOM_DocumentType_HEADER_GUARD_ |
---|
23 | #define DOM_DocumentType_HEADER_GUARD_ |
---|
24 | |
---|
25 | #include <xercesc/util/XercesDefs.hpp> |
---|
26 | #include "DOM_Node.hpp" |
---|
27 | |
---|
28 | XERCES_CPP_NAMESPACE_BEGIN |
---|
29 | |
---|
30 | |
---|
31 | class DOM_NamedNodeMap; |
---|
32 | class DocumentTypeImpl; |
---|
33 | |
---|
34 | /** |
---|
35 | * Each <code>Document</code> has a <code>doctype</code> whose value |
---|
36 | * is either <code>null</code> or a <code>DocumentType</code> object. |
---|
37 | * |
---|
38 | * The <code>DOM_DocumentType</code> class provides access |
---|
39 | * to the list of entities and notations that are defined for the document. |
---|
40 | * <p>The DOM Level 1 doesn't support editing <code>DocumentType</code> nodes. |
---|
41 | */ |
---|
42 | class DEPRECATED_DOM_EXPORT DOM_DocumentType: public DOM_Node { |
---|
43 | |
---|
44 | public: |
---|
45 | /** @name Constructors and assignment operator */ |
---|
46 | //@{ |
---|
47 | /** |
---|
48 | * Default constructor for DOM_DocumentType. The resulting object does not |
---|
49 | * refer to an actual DocumentType node; it will compare == to 0, and is similar |
---|
50 | * to a null object reference variable in Java. It may subsequently be |
---|
51 | * assigned to refer to the actual DocumentType node. |
---|
52 | * <p> |
---|
53 | * A new DocumentType node for a document that does not already have one |
---|
54 | * can be created by DOM_Document::createDocumentType(). |
---|
55 | * |
---|
56 | */ |
---|
57 | DOM_DocumentType(); |
---|
58 | |
---|
59 | /** |
---|
60 | * Constructor for a null DOM_DocumentType. |
---|
61 | * This allows passing 0 directly as a null DOM_DocumentType to |
---|
62 | * function calls that take DOM_DocumentType as parameters. |
---|
63 | * |
---|
64 | * @param nullPointer Must be 0. |
---|
65 | */ |
---|
66 | DOM_DocumentType(int nullPointer); |
---|
67 | |
---|
68 | /** |
---|
69 | * Copy constructor. Creates a new <code>DOM_Comment</code> that refers to the |
---|
70 | * same underlying node as the original. |
---|
71 | * |
---|
72 | * |
---|
73 | * @param other The object to be copied. |
---|
74 | */ |
---|
75 | DOM_DocumentType(const DOM_DocumentType &other); |
---|
76 | |
---|
77 | |
---|
78 | /** |
---|
79 | * Assignment operator. |
---|
80 | * |
---|
81 | * @param other The object to be copied. |
---|
82 | */ |
---|
83 | DOM_DocumentType & operator = (const DOM_DocumentType &other); |
---|
84 | |
---|
85 | /** |
---|
86 | * Assignment operator. This overloaded variant is provided for |
---|
87 | * the sole purpose of setting a DOM_Node reference variable to |
---|
88 | * zero. Nulling out a reference variable in this way will decrement |
---|
89 | * the reference count on the underlying Node object that the variable |
---|
90 | * formerly referenced. This effect is normally obtained when reference |
---|
91 | * variable goes out of scope, but zeroing them can be useful for |
---|
92 | * global instances, or for local instances that will remain in scope |
---|
93 | * for an extended time, when the storage belonging to the underlying |
---|
94 | * node needs to be reclaimed. |
---|
95 | * |
---|
96 | * @param val Only a value of 0, or null, is allowed. |
---|
97 | */ |
---|
98 | DOM_DocumentType & operator = (const DOM_NullPtr *val); |
---|
99 | |
---|
100 | //@} |
---|
101 | /** @name Destructor. */ |
---|
102 | //@{ |
---|
103 | /** |
---|
104 | * Destructor for DOM_DocumentType. The object being destroyed is the reference |
---|
105 | * object, not the underlying DocumentType node itself. |
---|
106 | * |
---|
107 | */ |
---|
108 | ~DOM_DocumentType(); |
---|
109 | //@} |
---|
110 | |
---|
111 | /** @name Getter functions. */ |
---|
112 | //@{ |
---|
113 | /** |
---|
114 | * The name of DTD; i.e., the name immediately following the |
---|
115 | * <code>DOCTYPE</code> keyword in an XML source document. |
---|
116 | */ |
---|
117 | DOMString getName() const; |
---|
118 | |
---|
119 | /** |
---|
120 | * This function returns a <code>NamedNodeMap</code> containing the general entities, both |
---|
121 | * external and internal, declared in the DTD. Parameter entities are not contained. |
---|
122 | * Duplicates are discarded. |
---|
123 | * <p> |
---|
124 | * Note: this functionality is not implemented in the initial release |
---|
125 | * of the parser, and the returned NamedNodeMap will be empty. |
---|
126 | */ |
---|
127 | DOM_NamedNodeMap getEntities() const; |
---|
128 | |
---|
129 | |
---|
130 | /** |
---|
131 | * This function returns a named node map containing an entry for |
---|
132 | * each notation declared in a document's DTD. Duplicates are discarded. |
---|
133 | * |
---|
134 | * <p> |
---|
135 | * Note: this functionality is not implemented in the initial release |
---|
136 | * of the parser, and the returned NamedNodeMap will be empty. |
---|
137 | */ |
---|
138 | DOM_NamedNodeMap getNotations() const; |
---|
139 | //@} |
---|
140 | |
---|
141 | /** @name Functions introduced in DOM Level 2. */ |
---|
142 | //@{ |
---|
143 | /** |
---|
144 | * Get the public identifier of the external subset. |
---|
145 | * |
---|
146 | * @return The public identifier of the external subset. |
---|
147 | */ |
---|
148 | DOMString getPublicId() const; |
---|
149 | |
---|
150 | /** |
---|
151 | * Get the system identifier of the external subset. |
---|
152 | * |
---|
153 | * @return The system identifier of the external subset. |
---|
154 | */ |
---|
155 | DOMString getSystemId() const; |
---|
156 | |
---|
157 | /** |
---|
158 | * Get the internal subset as a string. |
---|
159 | * |
---|
160 | * @return The internal subset as a string. |
---|
161 | */ |
---|
162 | DOMString getInternalSubset() const; |
---|
163 | //@} |
---|
164 | |
---|
165 | protected: |
---|
166 | DOM_DocumentType(DocumentTypeImpl *); |
---|
167 | |
---|
168 | friend class DOM_Document; |
---|
169 | friend class DOM_DOMImplementation; |
---|
170 | }; |
---|
171 | |
---|
172 | XERCES_CPP_NAMESPACE_END |
---|
173 | |
---|
174 | #endif |
---|
175 | |
---|
176 | |
---|