source: NonGTP/Xerces/xerces/include/xercesc/dom/deprecated/DOM_DocumentType.hpp @ 358

Revision 358, 5.5 KB checked in by bittner, 19 years ago (diff)

xerces added

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