Modified: xerces/c/trunk/src/xercesc/dom/DOMEntityResolver.hpp URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMEntityResolver.hpp?rev=224543&r1=224542&r2=224543&view=diff ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMEntityResolver.hpp (original) +++ xerces/c/trunk/src/xercesc/dom/DOMEntityResolver.hpp Sat Jul 23 14:11:41 2005 @@ -27,7 +27,7 @@ XERCES_CPP_NAMESPACE_BEGIN -class DOMInputSource; +class DOMLSInput; /** * DOMEntityResolver provides a way for applications to redirect references @@ -47,7 +47,7 @@ * URNs.</p> * * @see DOMBuilder#setEntityResolver - * @see DOMInputSource#DOMInputSource + * @see DOMLSInput#DOMLSInput * @since DOM Level 3 */ class CDOM_EXPORT DOMEntityResolver @@ -87,12 +87,12 @@ // ----------------------------------------------------------------------- // Virtual DOMEntityResolver interface // ----------------------------------------------------------------------- - /** @name Functions introduced in DOM Level 2 */ + /** @name Functions introduced in DOM Level 3 */ //@{ /** * Allow the application to resolve external entities. * - * <p>The DOMBuilder will call this method before opening any external + * <p>The DOMLSParser will call this method before opening any external * entity except the top-level document entity (including the * external DTD subset, external entities referenced within the * DTD, and external entities referenced within the document @@ -109,30 +109,30 @@ * <p>If the system identifier is a URL, the DOMBuilder parser must * resolve it fully before reporting it to the application.</p> * - * <p> The returned DOMInputSource is owned by the DOMBuilder which is + * <p> The returned DOMLSInput is owned by the DOMBuilder which is * responsible to clean up the memory. * - * <p><b>"Experimental - subject to change"</b></p> - * * @param publicId The public identifier of the external entity * being referenced, or null if none was supplied. * @param systemId The system identifier of the external entity * being referenced. * @param baseURI The absolute base URI of the resource being parsed, or * <code>null</code> if there is no base URI. - * @return A DOMInputSource object describing the new input source, + * @return A DOMLSInput object describing the new input source, * or <code>null</code> to request that the parser open a regular * URI connection to the system identifier. - * The returned DOMInputSource is owned by the DOMBuilder which is + * The returned DOMLSInput is owned by the DOMBuilder which is * responsible to clean up the memory. * @exception DOMSystemException Any DOMSystemException exception, possibly * wrapping another exception. - * @see DOMInputSource#DOMInputSource + * @see DOMLSInput#DOMLSInput * @since DOM Level 3 */ - virtual DOMInputSource* resolveEntity + virtual DOMLSInput* resolveEntity ( - const XMLCh* const publicId + const XMLCh* const resourceType + , const XMLCh* const namespaceUri + , const XMLCh* const publicId , const XMLCh* const systemId , const XMLCh* const baseURI ) = 0;
Modified: xerces/c/trunk/src/xercesc/dom/DOMImplementation.hpp URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMImplementation.hpp?rev=224543&r1=224542&r2=224543&view=diff ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMImplementation.hpp (original) +++ xerces/c/trunk/src/xercesc/dom/DOMImplementation.hpp Sat Jul 23 14:11:41 2005 @@ -23,6 +23,7 @@ #include <xercesc/dom/DOMImplementationLS.hpp> #include <xercesc/dom/DOMException.hpp> +#include <xercesc/dom/DOMLSException.hpp> #include <xercesc/dom/DOMRangeException.hpp> #include <xercesc/util/PlatformUtils.hpp> @@ -226,13 +227,13 @@ /** * Non-standard extension * - * Load the default error text message for DOMException. - * @param msgToLoad The DOM ExceptionCode id to be processed - * @param toFill The buffer that will hold the output on return. The - * size of this buffer should at least be 'maxChars + 1'. - * @param maxChars The maximum number of output characters that can be - * accepted. If the result will not fit, it is an error. - * @return <code>true</code> if the message is successfully loaded + * Load the default error text message for DOMException. + * @param msgToLoad The DOM ExceptionCode id to be processed + * @param toFill The buffer that will hold the output on return. The + * size of this buffer should at least be 'maxChars + 1'. + * @param maxChars The maximum number of output characters that can be + * accepted. If the result will not fit, it is an error. + * @return <code>true</code> if the message is successfully loaded */ static bool loadDOMExceptionMsg ( @@ -244,13 +245,31 @@ /** * Non-standard extension * - * Load the default error text message for DOMRangeException. - * @param msgToLoad The DOM RangeExceptionCode id to be processed - * @param toFill The buffer that will hold the output on return. The - * size of this buffer should at least be 'maxChars + 1'. - * @param maxChars The maximum number of output characters that can be - * accepted. If the result will not fit, it is an error. - * @return <code>true</code> if the message is successfully loaded + * Load the default error text message for DOMLSException. + * @param msgToLoad The DOM LSExceptionCode id to be processed + * @param toFill The buffer that will hold the output on return. The + * size of this buffer should at least be 'maxChars + 1'. + * @param maxChars The maximum number of output characters that can be + * accepted. If the result will not fit, it is an error. + * @return <code>true</code> if the message is successfully loaded + */ + static bool loadDOMExceptionMsg + ( + const DOMLSException::LSExceptionCode msgToLoad + , XMLCh* const toFill + , const unsigned int maxChars + ); + + /** + * Non-standard extension + * + * Load the default error text message for DOMRangeException. + * @param msgToLoad The DOM RangeExceptionCode id to be processed + * @param toFill The buffer that will hold the output on return. The + * size of this buffer should at least be 'maxChars + 1'. + * @param maxChars The maximum number of output characters that can be + * accepted. If the result will not fit, it is an error. + * @return <code>true</code> if the message is successfully loaded */ static bool loadDOMExceptionMsg ( Modified: xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp?rev=224543&r1=224542&r2=224543&view=diff ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp (original) +++ xerces/c/trunk/src/xercesc/dom/DOMImplementationLS.hpp Sat Jul 23 14:11:41 2005 @@ -27,16 +27,16 @@ XERCES_CPP_NAMESPACE_BEGIN -class DOMBuilder; -class DOMWriter; -class DOMInputSource; +class DOMLSParser; +class DOMLSSerializer; +class DOMLSInput; +class DOMLSOutput; class MemoryManager; class XMLGrammarPool; /** * <p><code>DOMImplementationLS</code> contains the factory methods for - * creating objects that implement the <code>DOMBuilder</code> (parser) and - * <code>DOMWriter</code> (serializer) interfaces.</p> + * creating Load and Save objects.</p> * * <p>An object that implements DOMImplementationLS is obtained by doing a * binding specific cast from DOMImplementation to DOMImplementationLS. @@ -86,12 +86,12 @@ /** @name Public constants */ //@{ /** - * Create a synchronous or an asynchronous <code>DOMBuilder</code>. - * @see createDOMBuilder(const short mode, const XMLCh* const schemaType) + * Create a synchronous or an asynchronous <code>DOMLSParser</code>. + * @see createLSParser(const unsigned short mode, const XMLCh* const schemaType) * @since DOM Level 3 * */ - enum + enum DOMImplementationLSMode { MODE_SYNCHRONOUS = 1, MODE_ASYNCHRONOUS = 2 @@ -99,7 +99,7 @@ //@} // ----------------------------------------------------------------------- - // Virtual DOMImplementation LS interface + // Virtual DOMImplementationLS interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ @@ -107,69 +107,73 @@ // Factory create methods // ----------------------------------------------------------------------- /** - * Create a new DOMBuilder. The newly constructed parser may then be - * configured by means of its setFeature method, and used to parse - * documents by means of its parse method. - * - * <p><b>"Experimental - subject to change"</b></p> - * - * @param mode The mode argument is either <code>MODE_SYNCHRONOUS</code> or - * <code>MODE_ASYNCHRONOUS</code>, if mode is <code>MODE_SYNCHRONOUS</code> - * then the <code>DOMBuilder</code> that is created will operate in - * synchronous mode, if it's <code>MODE_ASYNCHRONOUS</code> then the - * <code>DOMBuilder</code> that is created will operate in asynchronous - * mode. - * @param schemaType An absolute URI representing the type of the schema - * language used during the load of a DOMDocument using the newly created - * <code>DOMBuilder</code>. Note that no lexical checking is done on the - * absolute URI. In order to create a DOMBuilder for any kind of schema - * types (i.e. the DOMBuilder will be free to use any schema found), use - * the value <code>null</code>. - * @param manager Pointer to the memory manager to be used to - * allocate objects. + * Create a new DOMLSParser. The newly constructed parser may then be configured + * by means of its DOMConfiguration object, and used to parse documents by + * means of its parse method. + * + * @param mode The mode argument is either <code>MODE_SYNCHRONOUS</code> + * or <code>MODE_ASYNCHRONOUS</code>, if mode is <code>MODE_SYNCHRONOUS</code> + * then the <code>DOMLSParser</code> that is created will operate in synchronous + * mode, if it's <code>MODE_ASYNCHRONOUS</code> then the <code>DOMLSParser</code> + * that is created will operate in asynchronous mode. + * @param schemaType An absolute URI representing the type of the schema + * language used during the load of a <code>DOMDocument</code> using the newly + * created <code>DOMLSParser</code>. Note that no lexical checking is done on + * the absolute URI. In order to create a <code>DOMLSParser</code> for any kind + * of schema types (i.e. the <code>DOMLSParser</code> will be free to use any + * schema found), use the value <code>NULL</code>. + * <b>Note</b>: For W3C XML Schema [XML Schema Part 1], applications must use + * the value "http://www.w3.org/2001/XMLSchema". For XML DTD [XML 1.0], + * applications must use the value "http://www.w3.org/TR/REC-xml". + * Other Schema languages are outside the scope of the W3C and therefore should + * recommend an absolute URI in order to use this method. + * @param manager Pointer to the memory manager to be used to allocate objects. * @param gramPool The collection of cached grammers. - * @return The newly created <code>DOMBuilder</code> object. This - * <code>DOMBuilder</code> is either synchronous or asynchronous depending + * @return The newly created <code>DOMLSParser</code> object. This + * <code>DOMLSParser</code> is either synchronous or asynchronous depending * on the value of the <code>mode</code> argument. * @exception DOMException NOT_SUPPORTED_ERR: Raised if the requested mode * or schema type is not supported. * - * @see DOMBuilder + * @see DOMLSParser * @since DOM Level 3 */ - virtual DOMBuilder* createDOMBuilder(const short mode, - const XMLCh* const schemaType, - MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager, - XMLGrammarPool* const gramPool = 0) = 0; + virtual DOMLSParser* createLSParser(const unsigned short mode, + const XMLCh* const schemaType, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager, + XMLGrammarPool* const gramPool = 0) = 0; /** - * Create a new DOMWriter. DOMWriters are used to serialize a DOM tree + * Create a new DOMLSSerializer. DOMLSSerializer is used to serialize a DOM tree * back into an XML document. * - * <p><b>"Experimental - subject to change"</b></p> + * @return The newly created <code>DOMLSSerializer</code> object. * - * @return The newly created <code>DOMWriter</code> object. - * - * @see DOMWriter + * @see DOMLSSerializer * @since DOM Level 3 */ - virtual DOMWriter* createDOMWriter(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; + virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; /** - * Create a new "empty" DOMInputSource. - * - * <p><b>"Experimental - subject to change"</b></p> + * Create a new "empty" DOMLSInput. * - * @return The newly created <code>DOMInputSource</code> object. - * @exception DOMException NOT_SUPPORTED_ERR: Raised if this function is not - * supported by implementation + * @return The newly created <code>DOMLSInput</code> object. * - * @see DOMInputSource + * @see DOMLSInput * @since DOM Level 3 */ - virtual DOMInputSource* createDOMInputSource() = 0; + virtual DOMLSInput* createLSInput() = 0; + /** + * Create a new "empty" LSOutput. + * + * @return The newly created <code>LSOutput</code> object. + * + * @see LSOutput + * @since DOM Level 3 + */ + virtual DOMLSOutput* createLSOutput() = 0; //@} }; Added: xerces/c/trunk/src/xercesc/dom/DOMLSException.cpp URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSException.cpp?rev=224543&view=auto ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMLSException.cpp (added) +++ xerces/c/trunk/src/xercesc/dom/DOMLSException.cpp Sat Jul 23 14:11:41 2005 @@ -0,0 +1,80 @@ +/* + * Copyright 2001-2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + +#include <xercesc/dom/DOMImplementation.hpp> +#include <xercesc/util/XMLString.hpp> +#include <xercesc/framework/MemoryManager.hpp> + +#include "DOMLSException.hpp" + +XERCES_CPP_NAMESPACE_BEGIN + +// --------------------------------------------------------------------------- +// Destructor and Constructor +// --------------------------------------------------------------------------- +DOMLSException::~DOMLSException() +{ + if (msg && fMsgOwned) + fMemoryManager->deallocate((void*)msg); +} + +DOMLSException::DOMLSException() +:code((LSExceptionCode) 0) +,msg(0) +,fMemoryManager(0) +,fMsgOwned(false) +{ +} + +DOMLSException::DOMLSException( short exCode + , const XMLCh* message + , MemoryManager* const memoryManager) +:code((LSExceptionCode) exCode) +,msg(message) +,fMemoryManager(memoryManager) +,fMsgOwned(false) +{ + if (!message) + { + const unsigned int msgSize = 2047; + XMLCh errText[msgSize + 1]; + fMsgOwned = true; + + // load the text + msg = XMLString::replicate + ( + DOMImplementation::loadDOMExceptionMsg(code, errText, msgSize) ? errText : XMLUni::fgDefErrMsg + , fMemoryManager + ); + + } +} + +DOMLSException::DOMLSException(const DOMLSException &other) +:code(other.code) +,msg(0) +,fMemoryManager(other.fMemoryManager) +,fMsgOwned(other.fMsgOwned) +{ + msg = other.fMsgOwned? XMLString::replicate(other.msg, other.fMemoryManager) : other.msg; +} + +XERCES_CPP_NAMESPACE_END + Propchange: xerces/c/trunk/src/xercesc/dom/DOMLSException.cpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: xerces/c/trunk/src/xercesc/dom/DOMLSException.cpp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: xerces/c/trunk/src/xercesc/dom/DOMLSException.hpp URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSException.hpp?rev=224543&view=auto ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMLSException.hpp (added) +++ xerces/c/trunk/src/xercesc/dom/DOMLSException.hpp Sat Jul 23 14:11:41 2005 @@ -0,0 +1,168 @@ +#ifndef DOMLSException_HEADER_GUARD_ +#define DOMLSException_HEADER_GUARD_ + +/* + * Copyright 2001-2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + +#include <xercesc/util/XercesDefs.hpp> +#include <xercesc/util/PlatformUtils.hpp> + +XERCES_CPP_NAMESPACE_BEGIN + + +/** + * Parser or write operations may throw an LSException if the processing is stopped. + * The processing can be stopped due to a <code>DOMError</code> with a severity of + * DOMError::DOM_SEVERITY_FATAL_ERROR or a non recovered DOMError::DOM_SEVERITY_ERROR, + * or if <code>DOMErrorHandler::handleError()</code> returned <code>false</code>. + * <p><b>Note</b>: As suggested in the definition of the constants in the <code>DOMError</code> + * interface, a DOM implementation may choose to continue after a fatal error, but the + * resulting DOM tree is then implementation dependent. + * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/DOM3-LS.html'> + * Document Object Model (DOM) Level 3 Load and Save Specification</a>. + * @since DOM Level 3 + */ + +class MemoryManager; + +class CDOM_EXPORT DOMLSException { +public: + // ----------------------------------------------------------------------- + // Constructors + // ----------------------------------------------------------------------- + /** @name Constructors */ + //@{ + /** + * Default constructor for DOMLSException. + * + */ + DOMLSException(); + + /** + * Constructor which takes an error code and a message. + * + * @param code The error code which indicates the exception + * @param message The string containing the error message + * @param memoryManager The memory manager used to (de)allocate memory + */ + DOMLSException( short code + , const XMLCh* message + , MemoryManager* const memoryManager); + + /** + * Copy constructor. + * + * @param other The object to be copied. + */ + DOMLSException(const DOMLSException &other); + + //@} + + // ----------------------------------------------------------------------- + // Destructors + // ----------------------------------------------------------------------- + /** @name Destructor. */ + //@{ + /** + * Destructor for DOMLSException. + * + */ + virtual ~DOMLSException(); + //@} + +public: + // ----------------------------------------------------------------------- + // Class Types + // ----------------------------------------------------------------------- + /** @name Public Contants */ + //@{ + /** + * ExceptionCode + * + * <p><code>PARSE_ERR:</code> + * If an attempt was made to load a document, or an XML Fragment, using DOMLSParser + * and the processing has been stopped.</p> + * + * <p><code>SERIALIZE_ERR:</code> + * If an attempt was made to serialize a Node using LSSerializer and the processing + * has been stopped.</p> + * + * @since DOM Level 3 + */ + enum LSExceptionCode { + PARSE_ERR = 81, + SERIALIZE_ERR = 82 + }; + //@} + + // ----------------------------------------------------------------------- + // Getter + // ----------------------------------------------------------------------- + inline const XMLCh* getMessage() const; + + // ----------------------------------------------------------------------- + // Class Types + // ----------------------------------------------------------------------- + /** @name Public variables */ + //@{ + /** + * A code value, from the set defined by the LSExceptionCode enum, + * indicating the type of error that occured. + */ + LSExceptionCode code; + + /** + * A string value. Applications may use this field to hold an error + * message. The field value is not set by the DOM implementation, + * meaning that the string will be empty when an exception is first + * thrown. + */ + const XMLCh *msg; + //@} + +protected: + + MemoryManager* fMemoryManager; + +private: + + /** + * A boolean value. + * If the message is provided by the applications, it is not adopted. + * If the message is resolved by the DOM implementation, it is owned. + */ + bool fMsgOwned; + +private: + // ----------------------------------------------------------------------- + // Unimplemented constructors and operators + // ----------------------------------------------------------------------- + DOMLSException & operator = (const DOMLSException &); +}; + +inline const XMLCh* DOMLSException::getMessage() const +{ + return msg; +} + +XERCES_CPP_NAMESPACE_END + +#endif + Propchange: xerces/c/trunk/src/xercesc/dom/DOMLSException.hpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: xerces/c/trunk/src/xercesc/dom/DOMLSException.hpp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Copied: xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp (from r201963, xerces/c/trunk/src/xercesc/dom/DOMInputSource.hpp) URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp?p2=xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp&p1=xerces/c/trunk/src/xercesc/dom/DOMInputSource.hpp&r1=201963&r2=224543&rev=224543&view=diff ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMInputSource.hpp (original) +++ xerces/c/trunk/src/xercesc/dom/DOMLSInput.hpp Sat Jul 23 14:11:41 2005 @@ -1,5 +1,5 @@ -#ifndef DOMInputSource_HEADER_GUARD_ -#define DOMInputSource_HEADER_GUARD_ +#ifndef DOMLSInput_HEADER_GUARD_ +#define DOMLSInput_HEADER_GUARD_ /* * Copyright 2002,2004 The Apache Software Foundation. @@ -42,21 +42,21 @@ * to the parser: as the argument to the parse method, or as the return value * of the DOMEntityResolver.resolveEntity method.</p> * - * <p>The DOMBuilder will use the DOMInputSource object to determine how to + * <p>The DOMBuilder will use the DOMLSInput object to determine how to * read XML input. If there is a character stream available, the parser will * read that stream directly; if not, the parser will use a byte stream, if * available; if neither a character stream nor a byte stream is available, * the parser will attempt to open a URI connection to the resource identified * by the system identifier.</p> * - * <p>A DOMInputSource object belongs to the application: the parser shall + * <p>A DOMLSInput object belongs to the application: the parser shall * never modify it in any way (it may modify a copy if necessary).</p> * * @see DOMBuilder#parse * @see DOMEntityResolver#resolveEntity * @since DOM Level 3 */ -class CDOM_EXPORT DOMInputSource +class CDOM_EXPORT DOMLSInput { protected: // ----------------------------------------------------------------------- @@ -64,7 +64,7 @@ // ----------------------------------------------------------------------- /** @name Hidden constructors */ //@{ - DOMInputSource() {}; + DOMLSInput() {}; //@} private: @@ -73,8 +73,8 @@ // ----------------------------------------------------------------------- /** @name Unimplemented constructors and operators */ //@{ - DOMInputSource(const DOMInputSource &); - DOMInputSource & operator = (const DOMInputSource &); + DOMLSInput(const DOMLSInput &); + DOMLSInput & operator = (const DOMLSInput &); //@} public: @@ -87,11 +87,11 @@ * Destructor * */ - virtual ~DOMInputSource() {}; + virtual ~DOMLSInput() {}; //@} // ----------------------------------------------------------------------- - // Virtual DOMInputSource interface + // Virtual DOMLSInput interface // ----------------------------------------------------------------------- /** @name Functions introduced in DOM Level 3 */ //@{ @@ -99,13 +99,23 @@ // Getter methods // ----------------------------------------------------------------------- /** + * Makes the byte stream for this input source. + * + * <p>The derived class must create and return a binary input stream of an + * appropriate type for its kind of data source. The returned stream must + * be dynamically allocated and becomes the parser's property. + * </p> + * + * @see BinInputStream + */ + virtual BinInputStream* getByteStream() const = 0; + + /** * An input source can be set to force the parser to assume a particular * encoding for the data that input source reprsents, via the setEncoding() * method. This method returns name of the encoding that is to be forced. * If the encoding has never been forced, it returns a null pointer. * - * <p><b>"Experimental - subject to change"</b></p> - * * @return The forced encoding, or null if none was supplied. * @see #setEncoding * @since DOM Level 3 @@ -116,8 +126,6 @@ /** * Get the public identifier for this input source. * - * <p><b>"Experimental - subject to change"</b></p> - * * @return The public identifier, or null if none was supplied. * @see #setPublicId * @since DOM Level 3 @@ -128,8 +136,6 @@ /** * Get the system identifier for this input source. * - * <p><b>"Experimental - subject to change"</b></p> - * * <p>If the system ID is a URL, it will be fully resolved.</p> * * @return The system identifier. @@ -144,8 +150,6 @@ * URIs. If the baseURI is itself a relative URI, the behavior is * implementation dependent. * - * <p><b>"Experimental - subject to change"</b></p> - * * @return The base URI. * @see #setBaseURI * @since DOM Level 3 @@ -164,8 +168,6 @@ * to be incorrect because of intermediate transcoding, for instance * encapsulation within a MIME document. * - * <p><b>"Experimental - subject to change"</b></p> - * * @param encodingStr The name of the encoding to force. * @since DOM Level 3 */ @@ -178,8 +180,6 @@ * <p>The public identifier is always optional: if the application writer * includes one, it will be provided as part of the location information.</p> * - * <p><b>"Experimental - subject to change"</b></p> - * * @param publicId The public identifier as a string. * @see #getPublicId * @since DOM Level 3 @@ -195,8 +195,6 @@ * * <p>If the system ID is a URL, it must be fully resolved.</p> * - * <p><b>"Experimental - subject to change"</b></p> - * * @param systemId The system identifier as a string. * @see #getSystemId * @since DOM Level 3 @@ -208,8 +206,6 @@ * URIs. If the baseURI is itself a relative URI, the behavior is * implementation dependent. * - * <p><b>"Experimental - subject to change"</b></p> - * * @param baseURI The base URI. * @see #getBaseURI * @since DOM Level 3 @@ -224,25 +220,9 @@ //@{ /** - * Makes the byte stream for this input source. - * - * <p>The derived class must create and return a binary input stream of an - * appropriate type for its kind of data source. The returned stream must - * be dynamically allocated and becomes the parser's property. - * </p> - * - * <p><b>"Experimental - subject to change"</b></p> - * - * @see BinInputStream - */ - virtual BinInputStream* makeStream() const = 0; - - /** * Indicates if the parser should issue fatal error if this input source * is not found. If set to false, the parser issue warning message instead. * - * <p><b>"Experimental - subject to change"</b></p> - * * @param flag True if the parser should issue fatal error if this input source is not found. * If set to false, the parser issue warning message instead. (Default: true) * @@ -255,8 +235,6 @@ * Get the flag that indicates if the parser should issue fatal error if this input source * is not found. * - * <p><b>"Experimental - subject to change"</b></p> - * * @return True if the parser should issue fatal error if this input source is not found. * False if the parser issue warning message instead. * @see #setIssueFatalErrorIfNotFound @@ -264,7 +242,7 @@ virtual bool getIssueFatalErrorIfNotFound() const = 0; /** - * Called to indicate that this DOMInputSource is no longer in use + * Called to indicate that this DOMLSInput is no longer in use * and that the implementation may relinquish any resources associated with it. * * Access to a released object will lead to unexpected result. Added: xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp?rev=224543&view=auto ============================================================================== --- xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp (added) +++ xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp Sat Jul 23 14:11:41 2005 @@ -0,0 +1,279 @@ +#ifndef DOMLSInput_HEADER_GUARD_ +#define DOMLSInput_HEADER_GUARD_ + +/* + * Copyright 2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * $Id$ + */ + + +#include <xercesc/util/XercesDefs.hpp> + +XERCES_CPP_NAMESPACE_BEGIN + + +class BinInputStream; + + +/** + * This interface represents a single input source for an XML entity. + * + * <p>This interface allows an application to encapsulate information about + * an input source in a single object, which may include a public identifier, + * a system identifier, a byte stream (possibly with a specified encoding), + * and/or a character stream.</p> + * + * <p>There are two places that the application will deliver this input source + * to the parser: as the argument to the parse method, or as the return value + * of the DOMEntityResolver.resolveEntity method.</p> + * + * <p>The DOMBuilder will use the DOMLSOutput object to determine how to + * read XML input. If there is a character stream available, the parser will + * read that stream directly; if not, the parser will use a byte stream, if + * available; if neither a character stream nor a byte stream is available, + * the parser will attempt to open a URI connection to the resource identified + * by the system identifier.</p> + * + * <p>A DOMLSOutput object belongs to the application: the parser shall + * never modify it in any way (it may modify a copy if necessary).</p> + * + * @see DOMBuilder#parse + * @see DOMEntityResolver#resolveEntity + * @since DOM Level 3 + */ +class CDOM_EXPORT DOMLSOutput +{ +protected: + // ----------------------------------------------------------------------- + // Hidden constructors + // ----------------------------------------------------------------------- + /** @name Hidden constructors */ + //@{ + DOMLSOutput() {}; + //@} + +private: + // ----------------------------------------------------------------------- + // Unimplemented constructors and operators + // ----------------------------------------------------------------------- + /** @name Unimplemented constructors and operators */ + //@{ + DOMLSOutput(const DOMLSOutput &); + DOMLSOutput & operator = (const DOMLSOutput &); + //@} + +public: + // ----------------------------------------------------------------------- + // All constructors are hidden, just the destructor is available + // ----------------------------------------------------------------------- + /** @name Destructor */ + //@{ + /** + * Destructor + * + */ + virtual ~DOMLSOutput() {}; + //@} + + // ----------------------------------------------------------------------- + // Virtual DOMLSOutput interface + // ----------------------------------------------------------------------- + /** @name Functions introduced in DOM Level 3 */ + //@{ + // ----------------------------------------------------------------------- + // Getter methods + // ----------------------------------------------------------------------- + /** + * An input source can be set to force the parser to assume a particular + * encoding for the data that input source reprsents, via the setEncoding() + * method. This method returns name of the encoding that is to be forced. + * If the encoding has never been forced, it returns a null pointer. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @return The forced encoding, or null if none was supplied. + * @see #setEncoding + * @since DOM Level 3 + */ + virtual const XMLCh* getEncoding() const = 0; + + + /** + * Get the public identifier for this input source. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @return The public identifier, or null if none was supplied. + * @see #setPublicId + * @since DOM Level 3 + */ + virtual const XMLCh* getPublicId() const = 0; + + + /** + * Get the system identifier for this input source. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * <p>If the system ID is a URL, it will be fully resolved.</p> + * + * @return The system identifier. + * @see #setSystemId + * @since DOM Level 3 + */ + virtual const XMLCh* getSystemId() const = 0; + + + /** + * Get the base URI to be used for resolving relative URIs to absolute + * URIs. If the baseURI is itself a relative URI, the behavior is + * implementation dependent. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @return The base URI. + * @see #setBaseURI + * @since DOM Level 3 + */ + virtual const XMLCh* getBaseURI() const = 0; + + // ----------------------------------------------------------------------- + // Setter methods + // ----------------------------------------------------------------------- + /** + * Set the encoding which will be required for use with the XML text read + * via a stream opened by this input source. + * + * <p>This is usually not set, allowing the encoding to be sensed in the + * usual XML way. However, in some cases, the encoding in the file is known + * to be incorrect because of intermediate transcoding, for instance + * encapsulation within a MIME document. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @param encodingStr The name of the encoding to force. + * @since DOM Level 3 + */ + virtual void setEncoding(const XMLCh* const encodingStr) = 0; + + + /** + * Set the public identifier for this input source. + * + * <p>The public identifier is always optional: if the application writer + * includes one, it will be provided as part of the location information.</p> + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @param publicId The public identifier as a string. + * @see #getPublicId + * @since DOM Level 3 + */ + virtual void setPublicId(const XMLCh* const publicId) = 0; + + /** + * Set the system identifier for this input source. + * + * <p>The system id is always required. The public id may be used to map + * to another system id, but the system id must always be present as a fall + * back.</p> + * + * <p>If the system ID is a URL, it must be fully resolved.</p> + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @param systemId The system identifier as a string. + * @see #getSystemId + * @since DOM Level 3 + */ + virtual void setSystemId(const XMLCh* const systemId) = 0; + + /** + * Set the base URI to be used for resolving relative URIs to absolute + * URIs. If the baseURI is itself a relative URI, the behavior is + * implementation dependent. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @param baseURI The base URI. + * @see #getBaseURI + * @since DOM Level 3 + */ + virtual void setBaseURI(const XMLCh* const baseURI) = 0; + //@} + + // ----------------------------------------------------------------------- + // Non-standard Extension + // ----------------------------------------------------------------------- + /** @name Non-standard Extension */ + //@{ + + /** + * Makes the byte stream for this input source. + * + * <p>The derived class must create and return a binary input stream of an + * appropriate type for its kind of data source. The returned stream must + * be dynamically allocated and becomes the parser's property. + * </p> + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @see BinInputStream + */ + virtual BinInputStream* makeStream() const = 0; + + /** + * Indicates if the parser should issue fatal error if this input source + * is not found. If set to false, the parser issue warning message instead. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @param flag True if the parser should issue fatal error if this input source is not found. + * If set to false, the parser issue warning message instead. (Default: true) + * + * @see #getIssueFatalErrorIfNotFound + */ + virtual void setIssueFatalErrorIfNotFound(const bool flag) = 0; + + + /** + * Get the flag that indicates if the parser should issue fatal error if this input source + * is not found. + * + * <p><b>"Experimental - subject to change"</b></p> + * + * @return True if the parser should issue fatal error if this input source is not found. + * False if the parser issue warning message instead. + * @see #setIssueFatalErrorIfNotFound + */ + virtual bool getIssueFatalErrorIfNotFound() const = 0; + + /** + * Called to indicate that this DOMLSOutput is no longer in use + * and that the implementation may relinquish any resources associated with it. + * + * Access to a released object will lead to unexpected result. + */ + virtual void release() = 0; + //@} +}; + + +XERCES_CPP_NAMESPACE_END + +#endif Propchange: xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: xerces/c/trunk/src/xercesc/dom/DOMLSOutput.hpp ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
