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_Entity.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef DOM_Entity_HEADER_GUARD_ |
---|
23 | #define DOM_Entity_HEADER_GUARD_ |
---|
24 | |
---|
25 | #include <xercesc/util/XercesDefs.hpp> |
---|
26 | #include "DOM_Node.hpp" |
---|
27 | |
---|
28 | XERCES_CPP_NAMESPACE_BEGIN |
---|
29 | |
---|
30 | |
---|
31 | class EntityImpl; |
---|
32 | |
---|
33 | /** |
---|
34 | * This interface represents an entity, either parsed or unparsed, in an XML |
---|
35 | * document. |
---|
36 | * |
---|
37 | * Note that this models the entity itself not the entity |
---|
38 | * declaration. <code>Entity</code> declaration modeling has been left for a |
---|
39 | * later Level of the DOM specification. |
---|
40 | * <p>The <code>nodeName</code> attribute that is inherited from |
---|
41 | * <code>Node</code> contains the name of the entity. |
---|
42 | * <p>An XML processor may choose to completely expand entities before the |
---|
43 | * structure model is passed to the DOM; in this case there will be no |
---|
44 | * <code>EntityReference</code> nodes in the document tree. |
---|
45 | * |
---|
46 | * <p>Note: the first release of this parser does not create entity |
---|
47 | * nodes when reading an XML document. Entities may be |
---|
48 | * programatically created using DOM_Document::createEntity(). |
---|
49 | */ |
---|
50 | class DEPRECATED_DOM_EXPORT DOM_Entity: public DOM_Node { |
---|
51 | public: |
---|
52 | /** @name Constructors and assignment operator */ |
---|
53 | //@{ |
---|
54 | /** |
---|
55 | * Default constructor for DOM_Entity. |
---|
56 | * |
---|
57 | */ |
---|
58 | DOM_Entity(); |
---|
59 | |
---|
60 | /** |
---|
61 | * Copy constructor. |
---|
62 | * |
---|
63 | * @param other The object to be copied. |
---|
64 | */ |
---|
65 | DOM_Entity(const DOM_Entity &other); |
---|
66 | |
---|
67 | /** |
---|
68 | * Assignment operator. |
---|
69 | * |
---|
70 | * @param other The object to be copied. |
---|
71 | */ |
---|
72 | DOM_Entity & operator = (const DOM_Entity &other); |
---|
73 | |
---|
74 | /** |
---|
75 | * Assignment operator. This overloaded variant is provided for |
---|
76 | * the sole purpose of setting a DOM_Node reference variable to |
---|
77 | * zero. Nulling out a reference variable in this way will decrement |
---|
78 | * the reference count on the underlying Node object that the variable |
---|
79 | * formerly referenced. This effect is normally obtained when reference |
---|
80 | * variable goes out of scope, but zeroing them can be useful for |
---|
81 | * global instances, or for local instances that will remain in scope |
---|
82 | * for an extended time, when the storage belonging to the underlying |
---|
83 | * node needs to be reclaimed. |
---|
84 | * |
---|
85 | * @param val Only a value of 0, or null, is allowed. |
---|
86 | */ |
---|
87 | DOM_Entity & operator = (const DOM_NullPtr *val); |
---|
88 | |
---|
89 | //@} |
---|
90 | /** @name Destructor. */ |
---|
91 | //@{ |
---|
92 | /** |
---|
93 | * Destructor for DOM_Entity. |
---|
94 | * |
---|
95 | */ |
---|
96 | ~DOM_Entity(); |
---|
97 | |
---|
98 | //@} |
---|
99 | /** @name Get functions. */ |
---|
100 | //@{ |
---|
101 | /** |
---|
102 | * The public identifier associated with the entity, if specified. |
---|
103 | * |
---|
104 | * If the public identifier was not specified, this is <code>null</code>. |
---|
105 | */ |
---|
106 | DOMString getPublicId() const; |
---|
107 | |
---|
108 | /** |
---|
109 | * The system identifier associated with the entity, if specified. |
---|
110 | * |
---|
111 | * If the system identifier was not specified, this is <code>null</code>. |
---|
112 | */ |
---|
113 | DOMString getSystemId() const; |
---|
114 | |
---|
115 | /** |
---|
116 | * For unparsed entities, the name of the notation for the entity. |
---|
117 | * |
---|
118 | * For parsed entities, this is <code>null</code>. |
---|
119 | */ |
---|
120 | DOMString getNotationName() const; |
---|
121 | |
---|
122 | DOM_Node getFirstChild() const; |
---|
123 | DOM_Node getLastChild() const; |
---|
124 | DOM_NodeList getChildNodes() const; |
---|
125 | bool hasChildNodes() const; |
---|
126 | DOM_Node getPreviousSibling() const; |
---|
127 | DOM_Node getNextSibling() const; |
---|
128 | //@} |
---|
129 | |
---|
130 | protected: |
---|
131 | DOM_Entity(EntityImpl *impl); |
---|
132 | |
---|
133 | friend class DOM_Document; |
---|
134 | }; |
---|
135 | |
---|
136 | XERCES_CPP_NAMESPACE_END |
---|
137 | |
---|
138 | #endif |
---|
139 | |
---|