dbertoni 2005/04/21 18:27:49
Modified: c/src/xalanc/XSLT XSLTInputSource.cpp XSLTInputSource.hpp
Log:
Patch for Jira issue XALANC-488.
Revision Changes Path
1.6 +59 -36 xml-xalan/c/src/xalanc/XSLT/XSLTInputSource.cpp
Index: XSLTInputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTInputSource.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XSLTInputSource.cpp 8 Nov 2004 18:18:56 -0000 1.5
+++ XSLTInputSource.cpp 22 Apr 2005 01:27:49 -0000 1.6
@@ -36,8 +36,8 @@
-XSLTInputSource::XSLTInputSource() :
- InputSource(),
+XSLTInputSource::XSLTInputSource(MemoryManager& theMemoryManager) :
+ InputSource(&theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -47,16 +47,13 @@
// $$$ ToDo: Xerces' InputSource class does not yet have a copy
// constructor or assignment operator. See bug #7944.
-XSLTInputSource::XSLTInputSource(const XSLTInputSource&
theSource) :
-#if 1
- InputSource(),
-#else
- InputSource(theSource)
-#endif
+XSLTInputSource::XSLTInputSource(
+ const XSLTInputSource& theSource,
+ MemoryManager& theMemoryManager) :
+ InputSource(&theMemoryManager),
m_stream(theSource.m_stream),
m_node(theSource.m_node)
{
-#if 1
setIssueFatalErrorIfNotFound(theSource.getIssueFatalErrorIfNotFound());
const XMLCh* theValue = theSource.getSystemId();
@@ -79,7 +76,6 @@
{
setEncoding(theValue);
}
-#endif
}
@@ -91,7 +87,7 @@
{
m_stream = theRHS.m_stream;
m_node = theRHS.m_node;
-#if 1
+
setIssueFatalErrorIfNotFound(theRHS.getIssueFatalErrorIfNotFound());
const XMLCh* theValue = theRHS.getSystemId();
@@ -114,20 +110,20 @@
{
setEncoding(theValue);
}
-#endif
+
}
-#if 1
return *this;
-#else
- return InputSource::operator=(theRHS);
-#endif
}
-XSLTInputSource::XSLTInputSource(const XMLCh* systemId) :
- InputSource(systemId),
+XSLTInputSource::XSLTInputSource(
+ const XMLCh* systemId,
+ MemoryManager& theMemoryManager) :
+ InputSource(
+ systemId,
+ &theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -135,8 +131,12 @@
-XSLTInputSource::XSLTInputSource(const XalanDOMString& systemId) :
- InputSource(systemId.c_str()),
+XSLTInputSource::XSLTInputSource(
+ const XalanDOMString& systemId,
+ MemoryManager& theMemoryManager) :
+ InputSource(
+ systemId.c_str(),
+ &theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -146,8 +146,12 @@
XSLTInputSource::XSLTInputSource(
const XMLCh* systemId,
- const XMLCh* publicId) :
- InputSource(systemId, publicId),
+ const XMLCh* publicId,
+ MemoryManager& theMemoryManager) :
+ InputSource(
+ systemId,
+ publicId,
+ &theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -157,8 +161,12 @@
XSLTInputSource::XSLTInputSource(
const XalanDOMString& systemId,
- const XalanDOMString& publicId) :
- InputSource(systemId.c_str(), publicId.c_str()),
+ const XalanDOMString& publicId,
+ MemoryManager& theMemoryManager) :
+ InputSource(
+ systemId.c_str(),
+ publicId.c_str(),
+ &theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -166,8 +174,12 @@
-XSLTInputSource::XSLTInputSource(const char* systemId) :
- InputSource(systemId),
+XSLTInputSource::XSLTInputSource(
+ const char* systemId,
+ MemoryManager& theMemoryManager) :
+ InputSource(
+ systemId,
+ &theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -177,9 +189,12 @@
XSLTInputSource::XSLTInputSource(
const char* systemId,
- const char* publicId) :
- InputSource(systemId,
- publicId),
+ const char* publicId,
+ MemoryManager& theMemoryManager) :
+ InputSource(
+ systemId,
+ publicId,
+ &theMemoryManager),
m_stream(0),
m_node(0)
{
@@ -187,8 +202,10 @@
-XSLTInputSource::XSLTInputSource(XalanNode* node) :
- InputSource(),
+XSLTInputSource::XSLTInputSource(
+ XalanNode* node,
+ MemoryManager& theMemoryManager) :
+ InputSource(&theMemoryManager),
m_stream(0),
m_node(node)
{
@@ -196,8 +213,10 @@
-XSLTInputSource::XSLTInputSource(StreamType* stream) :
- InputSource(),
+XSLTInputSource::XSLTInputSource(
+ StreamType* stream,
+ MemoryManager& theMemoryManager) :
+ InputSource(&theMemoryManager),
m_stream(stream),
m_node(0)
{
@@ -205,8 +224,10 @@
-XSLTInputSource::XSLTInputSource(StreamType& stream) :
- InputSource(),
+XSLTInputSource::XSLTInputSource(
+ StreamType& stream,
+ MemoryManager& theMemoryManager) :
+ InputSource(&theMemoryManager),
m_stream(&stream),
m_node(0)
{
@@ -234,7 +255,9 @@
if (theSystemId != 0)
{
- XERCES_CPP_NAMESPACE_QUALIFIER XMLURL theURL;
+ XALAN_USING_XERCES(XMLURL)
+
+ XMLURL theURL(theManager);
URISupport::getURLFromString(theSystemId, theURL,
*theManager);
1.5 +43 -13 xml-xalan/c/src/xalanc/XSLT/XSLTInputSource.hpp
Index: XSLTInputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XSLT/XSLTInputSource.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XSLTInputSource.hpp 26 Feb 2004 22:58:58 -0000 1.4
+++ XSLTInputSource.hpp 22 Apr 2005 01:27:49 -0000 1.5
@@ -32,7 +32,11 @@
-#include <xercesc/sax/InputSource.hpp>
+#include "xercesc/sax/InputSource.hpp"
+
+
+
+#include "xalanc/Include/XalanMemoryManagement.hpp"
@@ -46,7 +50,7 @@
typedef XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream
BinInputStreamType;
typedef XERCES_CPP_NAMESPACE_QUALIFIER InputSource InputSourceType;
-
+XALAN_USING_XERCES(MemoryManager)
class XalanDOMString;
@@ -65,12 +69,14 @@
#endif
explicit
- XSLTInputSource();
+ XSLTInputSource(MemoryManager& theMemoryManager =
XalanMemMgrs::getDefault());
/**
* Copy constructor.
*/
- XSLTInputSource(const XSLTInputSource& theSource);
+ XSLTInputSource(
+ const XSLTInputSource& theSource,
+ MemoryManager& theMemoryManager =
XalanMemMgrs::getDefault());
/**
* Assignment operator.
@@ -87,8 +93,11 @@
* <p>If the system identifier is a URL, it must be full resolved.</p>
*
* @param systemId system identifier (URI)
+ * @param theMemoryManager The MemoryManager instance to use.
*/
- XSLTInputSource(const XMLCh* systemId);
+ XSLTInputSource(
+ const XMLCh* systemId,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Create a new input source with a system identifier.
@@ -99,8 +108,11 @@
* <p>If the system identifier is a URL, it must be full resolved.</p>
*
* @param systemId system identifier (URI)
+ * @param theMemoryManager The MemoryManager instance to use.
*/
- XSLTInputSource(const XalanDOMString& systemId);
+ XSLTInputSource(
+ const XalanDOMString& systemId,
+ MemoryManager& theMemoryManager =
XalanMemMgrs::getDefault());
/**
* Create a new input source with a system identifier.
@@ -111,8 +123,11 @@
* <p>If the system identifier is a URL, it must be full resolved.</p>
*
* @param systemId system identifier (URI)
+ * @param theMemoryManager The MemoryManager instance to use.
*/
- XSLTInputSource(const char* systemId);
+ XSLTInputSource(
+ const char* systemId,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Create a new input source with a system identifier and a public
@@ -122,10 +137,12 @@
*
* @param systemId system identifier (URI)
* @param publicId public identifier
+ * @param theMemoryManager The MemoryManager instance to use.
*/
XSLTInputSource(
const char* systemId,
- const char* publicId);
+ const char* publicId,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Create a new input source with a system identifier and a public
@@ -135,10 +152,12 @@
*
* @param systemId system identifier (URI)
* @param publicId public identifier
+ * @param theMemoryManager The MemoryManager instance to use.
*/
XSLTInputSource(
const XMLCh* systemId,
- const XMLCh* publicId);
+ const XMLCh* publicId,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Create a new input source with a system identifier and a public
@@ -148,10 +167,12 @@
*
* @param systemId system identifier (URI)
* @param publicId public identifier
+ * @param theMemoryManager The MemoryManager instance to use.
*/
XSLTInputSource(
const XalanDOMString& systemId,
- const XalanDOMString& publicId);
+ const XalanDOMString& publicId,
+ MemoryManager& theMemoryManager =
XalanMemMgrs::getDefault());
/**
* Create a new input source with a DOM node.
@@ -161,8 +182,11 @@
* identifier.</p>
*
* @param node DOM node that is root of the document
+ * @param theMemoryManager The MemoryManager instance to use.
*/
- XSLTInputSource(XalanNode* node);
+ XSLTInputSource(
+ XalanNode* node,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Create a new input source with std stream.
@@ -172,8 +196,11 @@
* identifier.</p>
*
* @param stream the input stream...
+ * @param theMemoryManager The MemoryManager instance to use.
*/
- XSLTInputSource(StreamType* stream);
+ XSLTInputSource(
+ StreamType* stream,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Create a new input source with std stream.
@@ -183,8 +210,11 @@
* identifier.</p>
*
* @param stream the input stream...
+ * @param theMemoryManager The MemoryManager instance to use.
*/
- XSLTInputSource(StreamType& stream);
+ XSLTInputSource(
+ StreamType& stream,
+ MemoryManager& theMemoryManager = XalanMemMgrs::getDefault());
/**
* Makes the byte stream for this input source.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]