1 | /*
|
---|
2 | * Copyright 1999-2002,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Id: DOM_Entity.hpp,v 1.5 2004/09/08 13:55:42 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef DOM_Entity_HEADER_GUARD_
|
---|
22 | #define DOM_Entity_HEADER_GUARD_
|
---|
23 |
|
---|
24 | #include <xercesc/util/XercesDefs.hpp>
|
---|
25 | #include "DOM_Node.hpp"
|
---|
26 |
|
---|
27 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
28 |
|
---|
29 |
|
---|
30 | class EntityImpl;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * This interface represents an entity, either parsed or unparsed, in an XML
|
---|
34 | * document.
|
---|
35 | *
|
---|
36 | * Note that this models the entity itself not the entity
|
---|
37 | * declaration. <code>Entity</code> declaration modeling has been left for a
|
---|
38 | * later Level of the DOM specification.
|
---|
39 | * <p>The <code>nodeName</code> attribute that is inherited from
|
---|
40 | * <code>Node</code> contains the name of the entity.
|
---|
41 | * <p>An XML processor may choose to completely expand entities before the
|
---|
42 | * structure model is passed to the DOM; in this case there will be no
|
---|
43 | * <code>EntityReference</code> nodes in the document tree.
|
---|
44 | *
|
---|
45 | * <p>Note: the first release of this parser does not create entity
|
---|
46 | * nodes when reading an XML document. Entities may be
|
---|
47 | * programatically created using DOM_Document::createEntity().
|
---|
48 | */
|
---|
49 | class DEPRECATED_DOM_EXPORT DOM_Entity: public DOM_Node {
|
---|
50 | public:
|
---|
51 | /** @name Constructors and assignment operator */
|
---|
52 | //@{
|
---|
53 | /**
|
---|
54 | * Default constructor for DOM_Entity.
|
---|
55 | *
|
---|
56 | */
|
---|
57 | DOM_Entity();
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * Copy constructor.
|
---|
61 | *
|
---|
62 | * @param other The object to be copied.
|
---|
63 | */
|
---|
64 | DOM_Entity(const DOM_Entity &other);
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Assignment operator.
|
---|
68 | *
|
---|
69 | * @param other The object to be copied.
|
---|
70 | */
|
---|
71 | DOM_Entity & operator = (const DOM_Entity &other);
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Assignment operator. This overloaded variant is provided for
|
---|
75 | * the sole purpose of setting a DOM_Node reference variable to
|
---|
76 | * zero. Nulling out a reference variable in this way will decrement
|
---|
77 | * the reference count on the underlying Node object that the variable
|
---|
78 | * formerly referenced. This effect is normally obtained when reference
|
---|
79 | * variable goes out of scope, but zeroing them can be useful for
|
---|
80 | * global instances, or for local instances that will remain in scope
|
---|
81 | * for an extended time, when the storage belonging to the underlying
|
---|
82 | * node needs to be reclaimed.
|
---|
83 | *
|
---|
84 | * @param val Only a value of 0, or null, is allowed.
|
---|
85 | */
|
---|
86 | DOM_Entity & operator = (const DOM_NullPtr *val);
|
---|
87 |
|
---|
88 | //@}
|
---|
89 | /** @name Destructor. */
|
---|
90 | //@{
|
---|
91 | /**
|
---|
92 | * Destructor for DOM_Entity.
|
---|
93 | *
|
---|
94 | */
|
---|
95 | ~DOM_Entity();
|
---|
96 |
|
---|
97 | //@}
|
---|
98 | /** @name Get functions. */
|
---|
99 | //@{
|
---|
100 | /**
|
---|
101 | * The public identifier associated with the entity, if specified.
|
---|
102 | *
|
---|
103 | * If the public identifier was not specified, this is <code>null</code>.
|
---|
104 | */
|
---|
105 | DOMString getPublicId() const;
|
---|
106 |
|
---|
107 | /**
|
---|
108 | * The system identifier associated with the entity, if specified.
|
---|
109 | *
|
---|
110 | * If the system identifier was not specified, this is <code>null</code>.
|
---|
111 | */
|
---|
112 | DOMString getSystemId() const;
|
---|
113 |
|
---|
114 | /**
|
---|
115 | * For unparsed entities, the name of the notation for the entity.
|
---|
116 | *
|
---|
117 | * For parsed entities, this is <code>null</code>.
|
---|
118 | */
|
---|
119 | DOMString getNotationName() const;
|
---|
120 |
|
---|
121 | DOM_Node getFirstChild() const;
|
---|
122 | DOM_Node getLastChild() const;
|
---|
123 | DOM_NodeList getChildNodes() const;
|
---|
124 | bool hasChildNodes() const;
|
---|
125 | DOM_Node getPreviousSibling() const;
|
---|
126 | DOM_Node getNextSibling() const;
|
---|
127 | //@}
|
---|
128 |
|
---|
129 | protected:
|
---|
130 | DOM_Entity(EntityImpl *impl);
|
---|
131 |
|
---|
132 | friend class DOM_Document;
|
---|
133 | };
|
---|
134 |
|
---|
135 | XERCES_CPP_NAMESPACE_END
|
---|
136 |
|
---|
137 | #endif
|
---|
138 |
|
---|