You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2002/07/19 16:57:29 UTC
cvs commit: xml-xerces/c/src/xercesc/framework Wrapper4InputSource.hpp Wrapper4InputSource.cpp Wrapper4DOMInputSource.hpp Wrapper4DOMInputSource.cpp
knoaman 2002/07/19 07:57:29
Modified: c/src/xercesc/framework Wrapper4InputSource.hpp
Wrapper4InputSource.cpp Wrapper4DOMInputSource.hpp
Wrapper4DOMInputSource.cpp
Log:
Add an adoptFlag parameter to the constructor and remove the setter method.
Documentation update.
Revision Changes Path
1.3 +50 -50 xml-xerces/c/src/xercesc/framework/Wrapper4InputSource.hpp
Index: Wrapper4InputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/Wrapper4InputSource.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Wrapper4InputSource.hpp 15 Jul 2002 18:26:46 -0000 1.2
+++ Wrapper4InputSource.hpp 19 Jul 2002 14:57:28 -0000 1.3
@@ -78,8 +78,16 @@
/**
* Constructor
+ *
+ * Wrap a SAX InputSource and pretend it to be a DOMInputSource.
+ * By default, the wrapper will adopt the SAX InputSource that is wrapped.
+ *
+ * @param inputSource The SAX InputSource to be wrapped
+ * @param adoptFlag Indicates if the wrapper should adopt the wrapped
+ * SAX InputSource. Default is true.
*/
- Wrapper4InputSource(InputSource* const inputSource);
+ Wrapper4InputSource(InputSource* const inputSource,
+ const bool adoptFlag = true);
/**
* Destructor
@@ -97,10 +105,8 @@
*
* 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>The function will call the makeStream of the wrapped input source.
+ * The returned stream becomes the parser's property.</p>
*
* @see BinInputStream
*/
@@ -116,8 +122,9 @@
*
* 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.
+ * method. This method will delegate to the wrapped input source to return
+ * name of the encoding that is to be forced. If the encoding has never
+ * been forced, it returns a null pointer.
*
* @return The forced encoding, or null if none was supplied.
* @see #setEncoding
@@ -128,7 +135,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Get the public identifier for this input source.
+ * Get the public identifier for this input source. Delegated to the
+ * wrapped input source object.
*
* @return The public identifier, or null if none was supplied.
* @see #setPublicId
@@ -139,7 +147,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Get the system identifier for this input source.
+ * Get the system identifier for this input source. Delegated to the
+ * wrapped input source object.
*
* <p>If the system ID is a URL, it will be fully resolved.</p>
*
@@ -151,7 +160,8 @@
/**
* 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.
+ * implementation dependent. Delegated to the wrapped intput source
+ * object.
*
* <p><b>"Experimental - subject to change"</b></p>
*
@@ -165,7 +175,7 @@
* <p><b>"Experimental - subject to change"</b></p>
*
* Get the flag that indicates if the parser should issue fatal error if this input source
- * is not found.
+ * is not found. Delegated to the wrapped input source object.
*
* @return True if the parser should issue fatal error if this input source is not found.
* False if the parser issue warning message instead.
@@ -184,7 +194,8 @@
* <p><b>"Experimental - subject to change"</b></p>
*
* Set the encoding which will be required for use with the XML text read
- * via a stream opened by this input source.
+ * via a stream opened by this input source. This will update the wrapped
+ * input source object.
*
* <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
@@ -199,7 +210,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Set the public identifier for this input source.
+ * Set the public identifier for this input source. This will update the
+ * wrapped input source object.
*
* <p>The public identifier is always optional: if the application writer
* includes one, it will be provided as part of the location information.</p>
@@ -214,7 +226,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Set the system identifier for this input source.
+ * Set the system identifier for this input source. This will update the
+ * wrapped input source object.
*
* <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
@@ -230,50 +243,42 @@
void setSystemId(const XMLCh* const systemId);
/**
- * 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
- */
+ * 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. This will update the wrapped input source
+ * object.
+ *
+ * <p><b>"Experimental - subject to change"</b></p>
+ *
+ * @param baseURI The base URI.
+ * @see #getBaseURI
+ * @since DOM Level 3
+ */
void setBaseURI(const XMLCh* const baseURI);
/**
* <p><b>"Experimental - subject to change"</b></p>
*
* 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.
+ * is not found. If set to false, the parser issue warning message
+ * instead. This will update the wrapped input source object.
*
- * @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)
+ * @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
*/
void setIssueFatalErrorIfNotFound(const bool flag);
- /**
- * Called to indicate that this DOMInputSource 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.
- */
- void release();
-
- /**
- * <p><b>"Experimental - subject to change"</b></p>
- *
- * Indicates if the parser should own the input source.
- * If set to true, the parser will delete the input source.
- *
- * @param flag if the parser should delete the input source or not.
- * (Default: true)
+ /**
+ * Called to indicate that this DOMInputSource 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.
*/
- void setAdoptInputSource(const bool flag);
+ void release();
//@}
@@ -304,11 +309,6 @@
// ---------------------------------------------------------------------------
// Wrapper4InputSource: Setter methods
// ---------------------------------------------------------------------------
-inline void Wrapper4InputSource::setAdoptInputSource(const bool flag)
-{
- fAdoptInputSource = flag;
-}
-
inline void Wrapper4InputSource::setBaseURI(const XMLCh* const baseURI)
{
}
1.3 +6 -2 xml-xerces/c/src/xercesc/framework/Wrapper4InputSource.cpp
Index: Wrapper4InputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/Wrapper4InputSource.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Wrapper4InputSource.cpp 15 Jul 2002 18:26:46 -0000 1.2
+++ Wrapper4InputSource.cpp 19 Jul 2002 14:57:28 -0000 1.3
@@ -56,6 +56,10 @@
/*
* $Log$
+ * Revision 1.3 2002/07/19 14:57:28 knoaman
+ * Add an adoptFlag parameter to the constructor and remove the setter method.
+ * Documentation update.
+ *
* Revision 1.2 2002/07/15 18:26:46 tng
* DOM L3: For consistency, add release() to DOMInputSource and thus Wrapper4InputSource.
*
@@ -76,8 +80,9 @@
// ---------------------------------------------------------------------------
// Wrapper4InputSource: Constructor and Destructor
// ---------------------------------------------------------------------------
-Wrapper4InputSource::Wrapper4InputSource(InputSource* const inputSource) :
- fAdoptInputSource(true)
+Wrapper4InputSource::Wrapper4InputSource(InputSource* const inputSource,
+ const bool adoptFlag) :
+ fAdoptInputSource(adoptFlag)
, fInputSource(inputSource)
{
if (!inputSource)
1.2 +31 -36 xml-xerces/c/src/xercesc/framework/Wrapper4DOMInputSource.hpp
Index: Wrapper4DOMInputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/Wrapper4DOMInputSource.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Wrapper4DOMInputSource.hpp 18 Jun 2002 20:00:22 -0000 1.1
+++ Wrapper4DOMInputSource.hpp 19 Jul 2002 14:57:28 -0000 1.2
@@ -78,8 +78,16 @@
/**
* Constructor
+ *
+ * Wrap a DOMInputSource and pretend it to be a SAX InputSource.
+ * By default, the wrapper will adopt the DOMInputSource that is wrapped.
+ *
+ * @param inputSource The DOMInputSource to be wrapped
+ * @param adoptFlag Indicates if the wrapper should adopt the wrapped
+ * DOMInputSource. Default is true.
*/
- Wrapper4DOMInputSource(DOMInputSource* const inputSource);
+ Wrapper4DOMInputSource(DOMInputSource* const inputSource,
+ const bool adoptFlag = true);
/**
* Destructor
@@ -97,10 +105,8 @@
*
* 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>The function will call the makeStream of the wrapped input source.
+ * The returned stream becomes the parser's property.</p>
*
* @see BinInputStream
*/
@@ -116,8 +122,9 @@
*
* 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.
+ * method. This method will delegate to the wrapped input source to return
+ * name of the encoding that is to be forced. If the encoding has never
+ * been forced, it returns a null pointer.
*
* @return The forced encoding, or null if none was supplied.
* @see #setEncoding
@@ -128,7 +135,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Get the public identifier for this input source.
+ * Get the public identifier for this input source. Delegated to the
+ * wrapped input source object.
*
* @return The public identifier, or null if none was supplied.
* @see #setPublicId
@@ -139,7 +147,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Get the system identifier for this input source.
+ * Get the system identifier for this input source. Delegated to the
+ * wrapped input source object.
*
* <p>If the system ID is a URL, it will be fully resolved.</p>
*
@@ -151,10 +160,12 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Get the flag that indicates if the parser should issue fatal error if this input source
- * is not found.
+ * Get the flag that indicates if the parser should issue fatal error if
+ * this input source is not found. Delegated to the wrapped input source
+ * object.
*
- * @return True if the parser should issue fatal error if this input source is not found.
+ * @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
*/
@@ -171,7 +182,8 @@
* <p><b>"Experimental - subject to change"</b></p>
*
* Set the encoding which will be required for use with the XML text read
- * via a stream opened by this input source.
+ * via a stream opened by this input source. This will update the wrapped
+ * input source object.
*
* <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
@@ -186,7 +198,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Set the public identifier for this input source.
+ * Set the public identifier for this input source. This will update the
+ * wrapped input source object.
*
* <p>The public identifier is always optional: if the application writer
* includes one, it will be provided as part of the location information.</p>
@@ -201,7 +214,8 @@
/**
* <p><b>"Experimental - subject to change"</b></p>
*
- * Set the system identifier for this input source.
+ * Set the system identifier for this input source. This will update the
+ * wrapped input source object.
*
* <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
@@ -221,6 +235,7 @@
*
* 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.
+ * This will update the wrapped input source object.
*
* @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)
@@ -229,18 +244,6 @@
*/
void setIssueFatalErrorIfNotFound(const bool flag);
- /**
- * <p><b>"Experimental - subject to change"</b></p>
- *
- * Indicates if the parser should own the input source.
- * If set to true, the parser will delete the input source.
- *
- * @param flag if the parser should delete the input source or not.
- * (Default: true)
- *
- */
- void setAdoptInputSource(const bool flag);
-
//@}
@@ -258,13 +261,5 @@
DOMInputSource* fInputSource;
};
-
-// ---------------------------------------------------------------------------
-// Wrapper4DOMInputSource: Setter methods
-// ---------------------------------------------------------------------------
-inline void Wrapper4DOMInputSource::setAdoptInputSource(const bool flag)
-{
- fAdoptInputSource = flag;
-}
#endif
1.2 +7 -3 xml-xerces/c/src/xercesc/framework/Wrapper4DOMInputSource.cpp
Index: Wrapper4DOMInputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/Wrapper4DOMInputSource.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Wrapper4DOMInputSource.cpp 18 Jun 2002 20:00:22 -0000 1.1
+++ Wrapper4DOMInputSource.cpp 19 Jul 2002 14:57:28 -0000 1.2
@@ -56,6 +56,10 @@
/*
* $Log$
+ * Revision 1.2 2002/07/19 14:57:28 knoaman
+ * Add an adoptFlag parameter to the constructor and remove the setter method.
+ * Documentation update.
+ *
* Revision 1.1 2002/06/18 20:00:22 knoaman
* Initial checkin.
*
@@ -73,8 +77,9 @@
// ---------------------------------------------------------------------------
// Wrapper4DOMInputSource: Constructor and Destructor
// ---------------------------------------------------------------------------
-Wrapper4DOMInputSource::Wrapper4DOMInputSource(DOMInputSource* const inputSource) :
- fAdoptInputSource(true)
+Wrapper4DOMInputSource::Wrapper4DOMInputSource(DOMInputSource* const inputSource,
+ const bool adoptFlag) :
+ fAdoptInputSource(adoptFlag)
, fInputSource(inputSource)
{
if (!inputSource)
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org