Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:51

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATION_HPP
0024 
0025 #include <xercesc/dom/DOMImplementationLS.hpp>
0026 #include <xercesc/dom/DOMException.hpp>
0027 #include <xercesc/dom/DOMLSException.hpp>
0028 #include <xercesc/dom/DOMRangeException.hpp>
0029 #include <xercesc/util/PlatformUtils.hpp>
0030 
0031 XERCES_CPP_NAMESPACE_BEGIN
0032 
0033 
0034 class DOMDocument;
0035 class DOMDocumentType;
0036 
0037 /**
0038  * The <code>DOMImplementation</code> interface provides a number of methods
0039  * for performing operations that are independent of any particular instance
0040  * of the document object model.
0041  */
0042 
0043 class CDOM_EXPORT DOMImplementation : public DOMImplementationLS
0044 {
0045 protected:
0046     // -----------------------------------------------------------------------
0047     //  Hidden constructors
0048     // -----------------------------------------------------------------------
0049     /** @name Hidden constructors */
0050     //@{
0051         DOMImplementation() {};                                      // no plain constructor
0052     //@}
0053 
0054 private:
0055     // -----------------------------------------------------------------------
0056     // Unimplemented constructors and operators
0057     // -----------------------------------------------------------------------
0058     /** @name Unimplemented constructors and operators */
0059     //@{
0060         DOMImplementation(const DOMImplementation &);   // no copy constructor.
0061         DOMImplementation & operator = (const DOMImplementation &);  // No Assignment
0062     //@}
0063 
0064 
0065 public:
0066     // -----------------------------------------------------------------------
0067     //  All constructors are hidden, just the destructor is available
0068     // -----------------------------------------------------------------------
0069     /** @name Destructor */
0070     //@{
0071     /**
0072      * Destructor
0073      *
0074      */
0075     virtual ~DOMImplementation() {};
0076     //@}
0077 
0078     // -----------------------------------------------------------------------
0079     // Virtual DOMImplementation interface
0080     // -----------------------------------------------------------------------
0081     /** @name Functions introduced in DOM Level 1 */
0082     //@{
0083     /**
0084      * Test if the DOM implementation implements a specific feature.
0085      * @param feature The name of the feature to test (case-insensitive). The
0086      *   values used by DOM features are defined throughout the DOM Level 2
0087      *   specifications and listed in the  section. The name must be an XML
0088      *   name. To avoid possible conflicts, as a convention, names referring
0089      *   to features defined outside the DOM specification should be made
0090      *   unique.
0091      * @param version This is the version number of the feature to test. In
0092      *   Level 2, the string can be either "2.0" or "1.0". If the version is
0093      *   not specified, supporting any version of the feature causes the
0094      *   method to return <code>true</code>.
0095      * @return <code>true</code> if the feature is implemented in the
0096      *   specified version, <code>false</code> otherwise.
0097      * @since DOM Level 1
0098      */
0099     virtual bool  hasFeature(const XMLCh *feature,  const XMLCh *version) const = 0;
0100     //@}
0101 
0102     // -----------------------------------------------------------------------
0103     // Functions introduced in DOM Level 2
0104     // -----------------------------------------------------------------------
0105     /** @name Functions introduced in DOM Level 2 */
0106     //@{
0107     /**
0108      * Creates an empty <code>DOMDocumentType</code> node. Entity declarations
0109      * and notations are not made available. Entity reference expansions and
0110      * default attribute additions do not occur. It is expected that a
0111      * future version of the DOM will provide a way for populating a
0112      * <code>DOMDocumentType</code>.
0113      * @param qualifiedName The qualified name of the document type to be
0114      *   created.
0115      * @param publicId The external subset public identifier.
0116      * @param systemId The external subset system identifier.
0117      * @return A new <code>DOMDocumentType</code> node with
0118      *   <code>ownerDocument</code> set to <code>null</code>.
0119      * @exception DOMException
0120      *   INVALID_CHARACTER_ERR: Raised if the specified qualified name
0121      *   contains an illegal character.
0122      *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
0123      *   malformed.
0124      *   <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
0125      *   not support the <code>"XML"</code> feature, if they choose not to
0126      *   support this method. Other features introduced in the future, by
0127      *   the DOM WG or in extensions defined by other groups, may also
0128      *   demand support for this method; please consult the definition of
0129      *   the feature to see if it requires this method.
0130      * @since DOM Level 2
0131      */
0132     virtual  DOMDocumentType *createDocumentType(const XMLCh *qualifiedName,
0133                                                  const XMLCh *publicId,
0134                                                  const XMLCh *systemId) = 0;
0135 
0136     /**
0137      * Creates a DOMDocument object of the specified type with its document
0138      * element.
0139      * @param namespaceURI The namespace URI of the document element to
0140      *   create.
0141      * @param qualifiedName The qualified name of the document element to be
0142      *   created.
0143      * @param doctype The type of document to be created or <code>null</code>.
0144      *   When <code>doctype</code> is not <code>null</code>, its
0145      *   <code>ownerDocument</code> attribute is set to the document
0146      *   being created.
0147      * @param manager    Pointer to the memory manager to be used to
0148      *                   allocate objects.
0149      * @return A new <code>DOMDocument</code> object.
0150      * @exception DOMException
0151      *   INVALID_CHARACTER_ERR: Raised if the specified qualified name
0152      *   contains an illegal character.
0153      *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is
0154      *   malformed, if the <code>qualifiedName</code> has a prefix and the
0155      *   <code>namespaceURI</code> is <code>null</code>, or if the
0156      *   <code>qualifiedName</code> has a prefix that is "xml" and the
0157      *   <code>namespaceURI</code> is different from "
0158      *   http://www.w3.org/XML/1998/namespace" , or if the DOM
0159      *   implementation does not support the <code>"XML"</code> feature but
0160      *   a non-null namespace URI was provided, since namespaces were
0161      *   defined by XML.
0162      *   <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
0163      *   been used with a different document or was created from a different
0164      *   implementation.
0165      *   <br>NOT_SUPPORTED_ERR: May be raised by DOM implementations which do
0166      *   not support the "XML" feature, if they choose not to support this
0167      *   method. Other features introduced in the future, by the DOM WG or
0168      *   in extensions defined by other groups, may also demand support for
0169      *   this method; please consult the definition of the feature to see if
0170      *   it requires this method.
0171      * @since DOM Level 2
0172      */
0173 
0174     virtual DOMDocument *createDocument(const XMLCh *namespaceURI,
0175                                         const XMLCh *qualifiedName,
0176                                         DOMDocumentType *doctype,
0177                                         MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
0178 
0179     //@}
0180     // -----------------------------------------------------------------------
0181     // Functions introduced in DOM Level 3
0182     // -----------------------------------------------------------------------
0183     /** @name Functions introduced in DOM Level 3 */
0184     //@{
0185     /**
0186      * This method returns a specialized object which implements the specialized APIs
0187      * of the specified feature and version, as specified in DOM Features.
0188      * This method also allow the implementation to provide specialized objects which
0189      * do not support the <code>DOMImplementation</code> interface.
0190      *
0191      * @param feature The name of the feature requested (case-insensitive).
0192      *        Note that any plus sign "+" prepended to the name of the feature will
0193      *        be ignored since it is not significant in the context of this method.
0194      * @param version This is the version number of the feature to test.
0195      * @return Returns an object which implements the specialized APIs of the specified
0196      *         feature and version, if any, or null if there is no object which implements
0197      *         interfaces associated with that feature.
0198      * @since DOM Level 3
0199      */
0200     virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const = 0;
0201 
0202     //@}
0203 
0204     // -----------------------------------------------------------------------
0205     // Non-standard extension
0206     // -----------------------------------------------------------------------
0207     /** @name Non-standard extension */
0208     //@{
0209     /**
0210      * Non-standard extension
0211      *
0212      * Create a completely empty document that has neither a root element or a doctype node.
0213      */
0214     virtual DOMDocument *createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0;
0215 
0216     /**
0217      * Non-standard extension
0218      *
0219      *  Factory method for getting a DOMImplementation object.
0220      *     The DOM implementation retains ownership of the returned object.
0221      *     Application code should NOT delete it.
0222      */
0223     static DOMImplementation *getImplementation();
0224 
0225     /**
0226      * Non-standard extension
0227      *
0228      * Load the default error text message for DOMException.
0229      * @param msgToLoad The DOM ExceptionCode id to be processed
0230      * @param toFill    The buffer that will hold the output on return. The
0231      *         size of this buffer should at least be 'maxChars + 1'.
0232      * @param maxChars  The maximum number of output characters that can be
0233      *         accepted. If the result will not fit, it is an error.
0234      * @return <code>true</code> if the message is successfully loaded
0235      */
0236     static bool loadDOMExceptionMsg
0237     (
0238           const   short  msgToLoad
0239         ,       XMLCh* const                 toFill
0240         , const XMLSize_t                    maxChars
0241     );
0242 
0243     //@}
0244 
0245 };
0246 
0247 XERCES_CPP_NAMESPACE_END
0248 
0249 #endif