source: icXML/icXML-devel/src/xercesc/dom/DOMImplementation.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 10.8 KB
Line 
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: DOMImplementation.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP
24
25#include <xercesc/dom/DOMImplementationLS.hpp>
26#include <xercesc/dom/DOMException.hpp>
27#include <xercesc/dom/DOMLSException.hpp>
28#include <xercesc/dom/DOMRangeException.hpp>
29#include <icxercesc/util/PlatformUtils.hpp>
30
31XERCES_CPP_NAMESPACE_BEGIN
32
33
34class DOMDocument;
35class DOMDocumentType;
36
37/**
38 * The <code>DOMImplementation</code> interface provides a number of methods
39 * for performing operations that are independent of any particular instance
40 * of the document object model.
41 */
42
43class CDOM_EXPORT DOMImplementation : public DOMImplementationLS
44{
45protected:
46    // -----------------------------------------------------------------------
47    //  Hidden constructors
48    // -----------------------------------------------------------------------
49    /** @name Hidden constructors */
50    //@{
51        DOMImplementation() {};                                      // no plain constructor
52    //@}
53
54private:
55    // -----------------------------------------------------------------------
56    // Unimplemented constructors and operators
57    // -----------------------------------------------------------------------
58    /** @name Unimplemented constructors and operators */
59    //@{
60        DOMImplementation(const DOMImplementation &);   // no copy constructor.
61        DOMImplementation & operator = (const DOMImplementation &);  // No Assignment
62    //@}
63
64
65public:
66    // -----------------------------------------------------------------------
67    //  All constructors are hidden, just the destructor is available
68    // -----------------------------------------------------------------------
69    /** @name Destructor */
70    //@{
71    /**
72     * Destructor
73     *
74     */
75    virtual ~DOMImplementation() {};
76    //@}
77
78    // -----------------------------------------------------------------------
79    // Virtual DOMImplementation interface
80    // -----------------------------------------------------------------------
81    /** @name Functions introduced in DOM Level 1 */
82    //@{
83    /**
84     * Test if the DOM implementation implements a specific feature.
85     * @param feature The name of the feature to test (case-insensitive). The
86     *   values used by DOM features are defined throughout the DOM Level 2
87     *   specifications and listed in the  section. The name must be an XML
88     *   name. To avoid possible conflicts, as a convention, names referring
89     *   to features defined outside the DOM specification should be made
90     *   unique.
91     * @param version This is the version number of the feature to test. In
92     *   Level 2, the string can be either "2.0" or "1.0". If the version is
93     *   not specified, supporting any version of the feature causes the
94     *   method to return <code>true</code>.
95     * @return <code>true</code> if the feature is implemented in the
96     *   specified version, <code>false</code> otherwise.
97     * @since DOM Level 1
98     */
99    virtual bool  hasFeature(const XMLCh *feature,  const XMLCh *version) const = 0;
100    //@}
101
102    // -----------------------------------------------------------------------
103    // Functions introduced in DOM Level 2
104    // -----------------------------------------------------------------------
105    /** @name Functions introduced in DOM Level 2 */
106    //@{
107    /**
108     * Creates an empty <code>DOMDocumentType</code> node. Entity declarations
109     * and notations are not made available. Entity reference expansions and
110     * default attribute additions do not occur. It is expected that a
111     * future version of the DOM will provide a way for populating a
112     * <code>DOMDocumentType</code>.
113     * @param qualifiedName The qualified name of the document type to be
114     *   created.
115     * @param publicId The external subset public identifier.
116     * @param systemId The external subset system identifier.
117     * @return A new <code>DOMDocumentType</code> node with
118     *   <code>ownerDocument</code> set to <code>null</code>.
119     * @exception DOMException
120     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name
121     *   contains an illegal character.
122     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
123     *   malformed.
124     *   <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
125     *   not support the <code>"XML"</code> feature, if they choose not to
126     *   support this method. Other features introduced in the future, by
127     *   the DOM WG or in extensions defined by other groups, may also
128     *   demand support for this method; please consult the definition of
129     *   the feature to see if it requires this method.
130     * @since DOM Level 2
131     */
132    virtual  DOMDocumentType *createDocumentType(const XMLCh *qualifiedName,
133                                                 const XMLCh *publicId,
134                                                 const XMLCh *systemId) = 0;
135
136    /**
137     * Creates a DOMDocument object of the specified type with its document
138     * element.
139     * @param namespaceURI The namespace URI of the document element to
140     *   create.
141     * @param qualifiedName The qualified name of the document element to be
142     *   created.
143     * @param doctype The type of document to be created or <code>null</code>.
144     *   When <code>doctype</code> is not <code>null</code>, its
145     *   <code>ownerDocument</code> attribute is set to the document
146     *   being created.
147     * @param manager    Pointer to the memory manager to be used to
148     *                   allocate objects.
149     * @return A new <code>DOMDocument</code> object.
150     * @exception DOMException
151     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name
152     *   contains an illegal character.
153     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
154     *   malformed, if the <code>qualifiedName</code> has a prefix and the
155     *   <code>namespaceURI</code> is <code>null</code>, or if the
156     *   <code>qualifiedName</code> has a prefix that is "xml" and the
157     *   <code>namespaceURI</code> is different from "
158     *   http://www.w3.org/XML/1998/namespace" , or if the DOM
159     *   implementation does not support the <code>"XML"</code> feature but
160     *   a non-null namespace URI was provided, since namespaces were
161     *   defined by XML.
162     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
163     *   been used with a different document or was created from a different
164     *   implementation.
165     *   <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
166     *   not support the "XML" feature, if they choose not to support this
167     *   method. Other features introduced in the future, by the DOM WG or
168     *   in extensions defined by other groups, may also demand support for
169     *   this method; please consult the definition of the feature to see if
170     *   it requires this method.
171     * @since DOM Level 2
172     */
173
174    virtual DOMDocument *createDocument(const XMLCh *namespaceURI,
175                                        const XMLCh *qualifiedName,
176                                        DOMDocumentType *doctype,
177                                        MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
178
179    //@}
180    // -----------------------------------------------------------------------
181    // Functions introduced in DOM Level 3
182    // -----------------------------------------------------------------------
183    /** @name Functions introduced in DOM Level 3 */
184    //@{
185    /**
186     * This method returns a specialized object which implements the specialized APIs
187     * of the specified feature and version, as specified in DOM Features.
188     * This method also allow the implementation to provide specialized objects which
189     * do not support the <code>DOMImplementation</code> interface.
190     *
191     * @param feature The name of the feature requested (case-insensitive).
192     *        Note that any plus sign "+" prepended to the name of the feature will
193     *        be ignored since it is not significant in the context of this method.
194     * @param version This is the version number of the feature to test.
195     * @return Returns an object which implements the specialized APIs of the specified
196     *         feature and version, if any, or null if there is no object which implements
197     *         interfaces associated with that feature.
198     * @since DOM Level 3
199     */
200    virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const = 0;
201
202    //@}
203
204    // -----------------------------------------------------------------------
205    // Non-standard extension
206    // -----------------------------------------------------------------------
207    /** @name Non-standard extension */
208    //@{
209    /**
210     * Non-standard extension
211     *
212     * Create a completely empty document that has neither a root element or a doctype node.
213     */
214    virtual DOMDocument *createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
215
216    /**
217     * Non-standard extension
218     *
219     *  Factory method for getting a DOMImplementation object.
220     *     The DOM implementation retains ownership of the returned object.
221     *     Application code should NOT delete it.
222     */
223    static DOMImplementation *getImplementation();
224
225    /**
226     * Non-standard extension
227     *
228     * Load the default error text message for DOMException.
229     * @param msgToLoad The DOM ExceptionCode id to be processed
230     * @param toFill    The buffer that will hold the output on return. The
231     *         size of this buffer should at least be 'maxChars + 1'.
232     * @param maxChars  The maximum number of output characters that can be
233     *         accepted. If the result will not fit, it is an error.
234     * @return <code>true</code> if the message is successfully loaded
235     */
236    static bool loadDOMExceptionMsg
237    (
238          const   short  msgToLoad
239        ,       XMLCh* const                 toFill
240        , const XMLSize_t                    maxChars
241    );
242
243    //@}
244
245};
246
247XERCES_CPP_NAMESPACE_END
248
249#endif
Note: See TracBrowser for help on using the repository browser.