1 | /*
|
---|
2 | * The Apache Software License, Version 1.1
|
---|
3 | *
|
---|
4 | * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
|
---|
5 | * reserved.
|
---|
6 | *
|
---|
7 | * Redistribution and use in source and binary forms, with or without
|
---|
8 | * modification, are permitted provided that the following conditions
|
---|
9 | * are met:
|
---|
10 | *
|
---|
11 | * 1. Redistributions of source code must retain the above copyright
|
---|
12 | * notice, this list of conditions and the following disclaimer.
|
---|
13 | *
|
---|
14 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
15 | * notice, this list of conditions and the following disclaimer in
|
---|
16 | * the documentation and/or other materials provided with the
|
---|
17 | * distribution.
|
---|
18 | *
|
---|
19 | * 3. The end-user documentation included with the redistribution,
|
---|
20 | * if any, must include the following acknowledgment:
|
---|
21 | * "This product includes software developed by the
|
---|
22 | * Apache Software Foundation (http://www.apache.org/)."
|
---|
23 | * Alternately, this acknowledgment may appear in the software itself,
|
---|
24 | * if and wherever such third-party acknowledgments normally appear.
|
---|
25 | *
|
---|
26 | * 4. The names "Xerces" and "Apache Software Foundation" must
|
---|
27 | * not be used to endorse or promote products derived from this
|
---|
28 | * software without prior written permission. For written
|
---|
29 | * permission, please contact apache\@apache.org.
|
---|
30 | *
|
---|
31 | * 5. Products derived from this software may not be called "Apache",
|
---|
32 | * nor may "Apache" appear in their name, without prior written
|
---|
33 | * permission of the Apache Software Foundation.
|
---|
34 | *
|
---|
35 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
---|
36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
37 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
38 | * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
---|
39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
---|
40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
---|
41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
---|
42 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
43 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
---|
44 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
---|
45 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
46 | * SUCH DAMAGE.
|
---|
47 | * ====================================================================
|
---|
48 | *
|
---|
49 | * This software consists of voluntary contributions made by many
|
---|
50 | * individuals on behalf of the Apache Software Foundation, and was
|
---|
51 | * originally based on software copyright (c) 1999, International
|
---|
52 | * Business Machines, Inc., http://www.ibm.com . For more information
|
---|
53 | * on the Apache Software Foundation, please see
|
---|
54 | * <http://www.apache.org/>.
|
---|
55 | */
|
---|
56 |
|
---|
57 | /*
|
---|
58 | * $Id: DOM_Entity.hpp,v 1.3 2002/11/04 15:04:44 tng Exp $
|
---|
59 | */
|
---|
60 |
|
---|
61 | #ifndef DOM_Entity_HEADER_GUARD_
|
---|
62 | #define DOM_Entity_HEADER_GUARD_
|
---|
63 |
|
---|
64 | #include <xercesc/util/XercesDefs.hpp>
|
---|
65 | #include "DOM_Node.hpp"
|
---|
66 |
|
---|
67 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
68 |
|
---|
69 |
|
---|
70 | class EntityImpl;
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * This interface represents an entity, either parsed or unparsed, in an XML
|
---|
74 | * document.
|
---|
75 | *
|
---|
76 | * Note that this models the entity itself not the entity
|
---|
77 | * declaration. <code>Entity</code> declaration modeling has been left for a
|
---|
78 | * later Level of the DOM specification.
|
---|
79 | * <p>The <code>nodeName</code> attribute that is inherited from
|
---|
80 | * <code>Node</code> contains the name of the entity.
|
---|
81 | * <p>An XML processor may choose to completely expand entities before the
|
---|
82 | * structure model is passed to the DOM; in this case there will be no
|
---|
83 | * <code>EntityReference</code> nodes in the document tree.
|
---|
84 | *
|
---|
85 | * <p>Note: the first release of this parser does not create entity
|
---|
86 | * nodes when reading an XML document. Entities may be
|
---|
87 | * programatically created using DOM_Document::createEntity().
|
---|
88 | */
|
---|
89 | class CDOM_EXPORT DOM_Entity: public DOM_Node {
|
---|
90 | public:
|
---|
91 | /** @name Constructors and assignment operator */
|
---|
92 | //@{
|
---|
93 | /**
|
---|
94 | * Default constructor for DOM_Entity.
|
---|
95 | *
|
---|
96 | */
|
---|
97 | DOM_Entity();
|
---|
98 |
|
---|
99 | /**
|
---|
100 | * Copy constructor.
|
---|
101 | *
|
---|
102 | * @param other The object to be copied.
|
---|
103 | */
|
---|
104 | DOM_Entity(const DOM_Entity &other);
|
---|
105 |
|
---|
106 | /**
|
---|
107 | * Assignment operator.
|
---|
108 | *
|
---|
109 | * @param other The object to be copied.
|
---|
110 | */
|
---|
111 | DOM_Entity & operator = (const DOM_Entity &other);
|
---|
112 |
|
---|
113 | /**
|
---|
114 | * Assignment operator. This overloaded variant is provided for
|
---|
115 | * the sole purpose of setting a DOM_Node reference variable to
|
---|
116 | * zero. Nulling out a reference variable in this way will decrement
|
---|
117 | * the reference count on the underlying Node object that the variable
|
---|
118 | * formerly referenced. This effect is normally obtained when reference
|
---|
119 | * variable goes out of scope, but zeroing them can be useful for
|
---|
120 | * global instances, or for local instances that will remain in scope
|
---|
121 | * for an extended time, when the storage belonging to the underlying
|
---|
122 | * node needs to be reclaimed.
|
---|
123 | *
|
---|
124 | * @param val Only a value of 0, or null, is allowed.
|
---|
125 | */
|
---|
126 | DOM_Entity & operator = (const DOM_NullPtr *val);
|
---|
127 |
|
---|
128 | //@}
|
---|
129 | /** @name Destructor. */
|
---|
130 | //@{
|
---|
131 | /**
|
---|
132 | * Destructor for DOM_Entity.
|
---|
133 | *
|
---|
134 | */
|
---|
135 | ~DOM_Entity();
|
---|
136 |
|
---|
137 | //@}
|
---|
138 | /** @name Get functions. */
|
---|
139 | //@{
|
---|
140 | /**
|
---|
141 | * The public identifier associated with the entity, if specified.
|
---|
142 | *
|
---|
143 | * If the public identifier was not specified, this is <code>null</code>.
|
---|
144 | */
|
---|
145 | DOMString getPublicId() const;
|
---|
146 |
|
---|
147 | /**
|
---|
148 | * The system identifier associated with the entity, if specified.
|
---|
149 | *
|
---|
150 | * If the system identifier was not specified, this is <code>null</code>.
|
---|
151 | */
|
---|
152 | DOMString getSystemId() const;
|
---|
153 |
|
---|
154 | /**
|
---|
155 | * For unparsed entities, the name of the notation for the entity.
|
---|
156 | *
|
---|
157 | * For parsed entities, this is <code>null</code>.
|
---|
158 | */
|
---|
159 | DOMString getNotationName() const;
|
---|
160 |
|
---|
161 | DOM_Node getFirstChild() const;
|
---|
162 | DOM_Node getLastChild() const;
|
---|
163 | DOM_NodeList getChildNodes() const;
|
---|
164 | bool hasChildNodes() const;
|
---|
165 | DOM_Node getPreviousSibling() const;
|
---|
166 | DOM_Node getNextSibling() const;
|
---|
167 | //@}
|
---|
168 |
|
---|
169 | protected:
|
---|
170 | DOM_Entity(EntityImpl *impl);
|
---|
171 |
|
---|
172 | friend class DOM_Document;
|
---|
173 | };
|
---|
174 |
|
---|
175 | XERCES_CPP_NAMESPACE_END
|
---|
176 |
|
---|
177 | #endif
|
---|
178 |
|
---|