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 2003/05/16 23:37:01 UTC
cvs commit: xml-xerces/c/src/xercesc/util/regx RangeToken.cpp RangeToken.hpp RegularExpression.cpp StringToken.hpp TokenFactory.cpp TokenFactory.hpp UnionToken.cpp
knoaman 2003/05/16 14:37:01
Modified: c/src/xercesc/dom/deprecated DOMParser.cpp
c/src/xercesc/dom/impl DOMAttrImpl.cpp DOMNormalizer.cpp
DOMNormalizer.hpp DOMRangeImpl.cpp
DOMWriterImpl.cpp
c/src/xercesc/framework LocalFileFormatTarget.cpp
LocalFileFormatTarget.hpp LocalFileInputSource.cpp
LocalFileInputSource.hpp MemBufFormatTarget.cpp
MemBufFormatTarget.hpp MemBufInputSource.cpp
MemBufInputSource.hpp StdInInputSource.hpp
URLInputSource.cpp URLInputSource.hpp
Wrapper4DOMInputSource.cpp
Wrapper4DOMInputSource.hpp XMLAttDef.cpp
XMLAttDef.hpp XMLAttDefList.hpp XMLAttr.hpp
XMLBuffer.hpp XMLBufferMgr.hpp XMLElementDecl.hpp
XMLEntityDecl.cpp XMLEntityDecl.hpp
XMLFormatter.cpp XMLFormatter.hpp
XMLNotationDecl.cpp XMLNotationDecl.hpp
XMLRefInfo.hpp
c/src/xercesc/internal DGXMLScanner.cpp ElemStack.cpp
ElemStack.hpp IGXMLScanner.cpp IGXMLScanner2.cpp
ReaderMgr.cpp ReaderMgr.hpp SGXMLScanner.cpp
SGXMLScanner.hpp VecAttributesImpl.cpp
WFXMLScanner.cpp WFXMLScanner.hpp XMLReader.cpp
XMLReader.hpp XMLScanner.cpp XMLScanner.hpp
XMLScannerResolver.hpp
c/src/xercesc/parsers AbstractDOMParser.hpp
DOMBuilderImpl.cpp SAX2XMLReaderImpl.cpp
SAXParser.cpp
c/src/xercesc/sax InputSource.cpp InputSource.hpp
c/src/xercesc/util BaseRefVectorOf.c BaseRefVectorOf.hpp
QName.hpp RefHashTableOf.c RefHashTableOf.hpp
ValueVectorOf.c ValueVectorOf.hpp
c/src/xercesc/util/Transcoders/ICU ICUTransService.cpp
c/src/xercesc/util/Transcoders/IconvFBSD
IconvFBSDTransService.cpp
c/src/xercesc/util/Transcoders/IconvGNU
IconvGNUTransService.cpp
c/src/xercesc/util/regx RangeToken.cpp RangeToken.hpp
RegularExpression.cpp StringToken.hpp
TokenFactory.cpp TokenFactory.hpp UnionToken.cpp
Log:
Memory manager implementation: Modify constructors to pass in the memory manager.
Revision Changes Path
1.16 +3 -3 xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp
Index: DOMParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DOMParser.cpp 15 May 2003 18:25:53 -0000 1.15
+++ DOMParser.cpp 16 May 2003 21:36:54 -0000 1.16
@@ -744,7 +744,7 @@
DocumentImpl *docImpl = (DocumentImpl *)fDocument.fImpl;
if (fScanner -> getDoNamespaces()) { //DOM Level 2, doNamespaces on
- XMLBuffer buf;
+ XMLBuffer buf(1023, fMemoryManager);
DOMString namespaceURI = 0;
DOMString elemQName = 0;
if (urlId != fScanner->getEmptyNamespaceId()) { //TagName has a prefix
@@ -1146,7 +1146,7 @@
DOMString qualifiedName = attr->getFullName();
int index = DocumentImpl::indexofQualifiedName(qualifiedName);
- XMLBuffer buf;
+ XMLBuffer buf(1023, fMemoryManager);
static const XMLCh XMLNS[] = {
chLatin_x, chLatin_m, chLatin_l, chLatin_n, chLatin_s, chNull};
1.16 +2 -2 xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.cpp
Index: DOMAttrImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DOMAttrImpl.cpp 29 Jan 2003 19:43:08 -0000 1.15
+++ DOMAttrImpl.cpp 16 May 2003 21:36:55 -0000 1.16
@@ -162,7 +162,7 @@
// In such case, we have to visit each child to retrieve the text
//
- XMLBuffer buf;
+ XMLBuffer buf(1023, ((DOMDocumentImpl *)this->getOwnerDocument())->getMemoryManager());
getTextValue(fParent.fFirstChild, buf);
return (XMLCh*) ((DOMDocumentImpl *)this->getOwnerDocument())->getPooledString(buf.getRawBuffer());
1.3 +8 -4 xml-xerces/c/src/xercesc/dom/impl/DOMNormalizer.cpp
Index: DOMNormalizer.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNormalizer.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DOMNormalizer.cpp 15 May 2003 18:21:05 -0000 1.2
+++ DOMNormalizer.cpp 16 May 2003 21:36:55 -0000 1.3
@@ -160,7 +160,11 @@
}
-DOMNormalizer::DOMNormalizer() : fDocument(0), fNewNamespaceCount(1) {
+DOMNormalizer::DOMNormalizer()
+ : fDocument(0)
+ , fNewNamespaceCount(1)
+ , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+{
fNSScope = new InScopeNamespaces();
};
@@ -399,7 +403,7 @@
if (XMLString::equals(prefix, XMLUni::fgZeroLenString)) {
element->setAttributeNS(XMLUni::fgXMLNSURIName, XMLUni::fgXMLNSString, uri);
} else {
- XMLBuffer buf;
+ XMLBuffer buf(1023, fMemoryManager);
buf.set(XMLUni::fgXMLNSString);
buf.append(chColon);
buf.append(prefix);
@@ -408,7 +412,7 @@
}
const XMLCh* DOMNormalizer::addCustomNamespaceDecl(const XMLCh* uri, DOMElementImpl *element) const {
- XMLBuffer preBuf;
+ XMLBuffer preBuf(1023, fMemoryManager);
preBuf.append(chLatin_N);
preBuf.append(chLatin_S);
preBuf.append(integerToXMLCh(fNewNamespaceCount));
@@ -422,7 +426,7 @@
((DOMNormalizer *)this)->fNewNamespaceCount++;
}
- XMLBuffer buf;
+ XMLBuffer buf(1023, fMemoryManager);
buf.set(XMLUni::fgXMLNSString);
buf.append(chColon);
buf.append(preBuf.getRawBuffer());
1.2 +1 -1 xml-xerces/c/src/xercesc/dom/impl/DOMNormalizer.hpp
Index: DOMNormalizer.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNormalizer.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMNormalizer.hpp 14 May 2003 19:17:49 -0000 1.1
+++ DOMNormalizer.hpp 16 May 2003 21:36:55 -0000 1.2
@@ -185,7 +185,7 @@
DOMErrorHandler *fErrorHandler;
InScopeNamespaces *fNSScope;
unsigned int fNewNamespaceCount;
-
+ MemoryManager* fMemoryManager;
};
1.13 +2 -2 xml-xerces/c/src/xercesc/dom/impl/DOMRangeImpl.cpp
Index: DOMRangeImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMRangeImpl.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DOMRangeImpl.cpp 15 May 2003 18:25:54 -0000 1.12
+++ DOMRangeImpl.cpp 16 May 2003 21:36:55 -0000 1.13
@@ -863,7 +863,7 @@
DOMNode* node = fStartContainer;
DOMNode* stopNode = fEndContainer;
- XMLBuffer retStringBuf;
+ XMLBuffer retStringBuf(1023, ((DOMDocumentImpl *)fDocument)->getMemoryManager());
short type = fStartContainer->getNodeType();
if((type == DOMNode::TEXT_NODE
|| type == DOMNode::CDATA_SECTION_NODE
1.38 +5 -2 xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp
Index: DOMWriterImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- DOMWriterImpl.cpp 15 May 2003 18:25:54 -0000 1.37
+++ DOMWriterImpl.cpp 16 May 2003 21:36:55 -0000 1.38
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.38 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.37 2003/05/15 18:25:54 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -657,7 +660,7 @@
//
XMLCh* DOMWriterImpl::writeToString(const DOMNode &nodeToWrite)
{
- MemBufFormatTarget destination;
+ MemBufFormatTarget destination(1023, fMemoryManager);
bool retVal;
// XMLCh is unicode, assume fEncoding as UTF-16
1.7 +10 -5 xml-xerces/c/src/xercesc/framework/LocalFileFormatTarget.cpp
Index: LocalFileFormatTarget.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/LocalFileFormatTarget.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- LocalFileFormatTarget.cpp 15 May 2003 18:26:07 -0000 1.6
+++ LocalFileFormatTarget.cpp 16 May 2003 21:36:55 -0000 1.7
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -85,12 +88,13 @@
XERCES_CPP_NAMESPACE_BEGIN
-LocalFileFormatTarget::LocalFileFormatTarget(const XMLCh* const fileName)
+LocalFileFormatTarget::LocalFileFormatTarget( const XMLCh* const fileName
+ , MemoryManager* const manager)
: fSource(0)
, fDataBuf(0)
, fIndex(0)
, fCapacity(1023)
-, fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+, fMemoryManager(manager)
{
fSource = XMLPlatformUtils::openFileToWrite(fileName);
@@ -108,12 +112,13 @@
}
-LocalFileFormatTarget::LocalFileFormatTarget(const char* const fileName)
+LocalFileFormatTarget::LocalFileFormatTarget( const char* const fileName
+ , MemoryManager* const manager)
: fSource(0)
, fDataBuf(0)
, fIndex(0)
, fCapacity(1023)
-, fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+, fMemoryManager(manager)
{
fSource = XMLPlatformUtils::openFileToWrite(fileName);
1.6 +15 -4 xml-xerces/c/src/xercesc/framework/LocalFileFormatTarget.hpp
Index: LocalFileFormatTarget.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/LocalFileFormatTarget.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LocalFileFormatTarget.hpp 15 May 2003 18:26:07 -0000 1.5
+++ LocalFileFormatTarget.hpp 16 May 2003 21:36:55 -0000 1.6
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.6 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -87,9 +90,17 @@
/** @name constructors and destructor */
//@{
- LocalFileFormatTarget(const XMLCh* const);
-
- LocalFileFormatTarget(const char* const);
+ LocalFileFormatTarget
+ (
+ const XMLCh* const
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ );
+
+ LocalFileFormatTarget
+ (
+ const char* const
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ );
~LocalFileFormatTarget();
//@}
1.6 +6 -2 xml-xerces/c/src/xercesc/framework/LocalFileInputSource.cpp
Index: LocalFileInputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/LocalFileInputSource.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LocalFileInputSource.cpp 15 May 2003 18:26:07 -0000 1.5
+++ LocalFileInputSource.cpp 16 May 2003 21:36:55 -0000 1.6
@@ -120,7 +120,9 @@
// LocalFileInputSource: Constructors and Destructor
// ---------------------------------------------------------------------------
LocalFileInputSource::LocalFileInputSource( const XMLCh* const basePath
- , const XMLCh* const relativePath)
+ , const XMLCh* const relativePath
+ , MemoryManager* const manager)
+ : InputSource(manager)
{
//
// If the relative part is really relative, then weave it together
@@ -143,7 +145,9 @@
}
-LocalFileInputSource::LocalFileInputSource(const XMLCh* const filePath)
+LocalFileInputSource::LocalFileInputSource(const XMLCh* const filePath,
+ MemoryManager* const manager)
+ : InputSource(manager)
{
//
1.3 +8 -3 xml-xerces/c/src/xercesc/framework/LocalFileInputSource.hpp
Index: LocalFileInputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/LocalFileInputSource.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LocalFileInputSource.hpp 4 Nov 2002 15:00:21 -0000 1.2
+++ LocalFileInputSource.hpp 16 May 2003 21:36:55 -0000 1.3
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.3 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.2 2002/11/04 15:00:21 tng
* C++ Namespace Support.
*
@@ -157,8 +160,9 @@
*/
LocalFileInputSource
(
- const XMLCh* const basePath
- , const XMLCh* const relativePath
+ const XMLCh* const basePath
+ , const XMLCh* const relativePath
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -178,7 +182,8 @@
*/
LocalFileInputSource
(
- const XMLCh* const filePath
+ const XMLCh* const filePath
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.7 +7 -3 xml-xerces/c/src/xercesc/framework/MemBufFormatTarget.cpp
Index: MemBufFormatTarget.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/MemBufFormatTarget.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MemBufFormatTarget.cpp 15 May 2003 18:26:07 -0000 1.6
+++ MemBufFormatTarget.cpp 16 May 2003 21:36:55 -0000 1.7
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -84,8 +87,9 @@
XERCES_CPP_NAMESPACE_BEGIN
-MemBufFormatTarget::MemBufFormatTarget(int initCapacity)
- : fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+MemBufFormatTarget::MemBufFormatTarget( int initCapacity
+ , MemoryManager* const manager)
+ : fMemoryManager(manager)
, fDataBuf(0)
, fIndex(0)
, fCapacity(initCapacity)
1.7 +9 -2 xml-xerces/c/src/xercesc/framework/MemBufFormatTarget.hpp
Index: MemBufFormatTarget.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/MemBufFormatTarget.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MemBufFormatTarget.hpp 15 May 2003 18:26:07 -0000 1.6
+++ MemBufFormatTarget.hpp 16 May 2003 21:36:55 -0000 1.7
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -106,7 +109,11 @@
/** @name constructors and destructor */
//@{
- MemBufFormatTarget(int initCapacity = 1023) ;
+ MemBufFormatTarget
+ (
+ int initCapacity = 1023
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ ) ;
~MemBufFormatTarget();
//@}
1.5 +15 -10 xml-xerces/c/src/xercesc/framework/MemBufInputSource.cpp
Index: MemBufInputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/MemBufInputSource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MemBufInputSource.cpp 16 May 2003 03:11:30 -0000 1.4
+++ MemBufInputSource.cpp 16 May 2003 21:36:55 -0000 1.5
@@ -56,6 +56,9 @@
/**
* $Log$
+ * Revision 1.5 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.4 2003/05/16 03:11:30 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -95,11 +98,12 @@
// ---------------------------------------------------------------------------
// MemBufInputSource: Constructors and Destructor
// ---------------------------------------------------------------------------
-MemBufInputSource::MemBufInputSource( const XMLByte* const srcDocBytes
- , const unsigned int byteCount
- , const XMLCh* const bufId
- , const bool adoptBuffer) :
- InputSource(bufId)
+MemBufInputSource::MemBufInputSource( const XMLByte* const srcDocBytes
+ , const unsigned int byteCount
+ , const XMLCh* const bufId
+ , const bool adoptBuffer
+ , MemoryManager* const manager) :
+ InputSource(bufId, manager)
, fAdopted(adoptBuffer)
, fByteCount(byteCount)
, fCopyBufToStream(true)
@@ -107,11 +111,12 @@
{
}
-MemBufInputSource::MemBufInputSource( const XMLByte* const srcDocBytes
- , const unsigned int byteCount
- , const char* const bufId
- , const bool adoptBuffer) :
- InputSource(bufId)
+MemBufInputSource::MemBufInputSource( const XMLByte* const srcDocBytes
+ , const unsigned int byteCount
+ , const char* const bufId
+ , const bool adoptBuffer
+ , MemoryManager* const manager) :
+ InputSource(bufId, manager)
, fAdopted(adoptBuffer)
, fByteCount(byteCount)
, fCopyBufToStream(true)
1.4 +6 -1 xml-xerces/c/src/xercesc/framework/MemBufInputSource.hpp
Index: MemBufInputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/MemBufInputSource.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MemBufInputSource.hpp 4 Nov 2002 15:00:21 -0000 1.3
+++ MemBufInputSource.hpp 16 May 2003 21:36:55 -0000 1.4
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.4 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.3 2002/11/04 15:00:21 tng
* C++ Namespace Support.
*
@@ -165,7 +168,8 @@
const XMLByte* const srcDocBytes
, const unsigned int byteCount
, const XMLCh* const bufId
- , const bool adoptBuffer = false
+ , const bool adoptBuffer// = false
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -178,6 +182,7 @@
, const unsigned int byteCount
, const char* const bufId
, const bool adoptBuffer = false
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.3 +6 -3 xml-xerces/c/src/xercesc/framework/StdInInputSource.hpp
Index: StdInInputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/StdInInputSource.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StdInInputSource.hpp 4 Nov 2002 15:00:21 -0000 1.2
+++ StdInInputSource.hpp 16 May 2003 21:36:55 -0000 1.3
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.3 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.2 2002/11/04 15:00:21 tng
* C++ Namespace Support.
*
@@ -126,7 +129,7 @@
* input source as file, a new handleof which it gives to each new stream
* it creates.
*/
- StdInInputSource();
+ StdInInputSource(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@}
/** @name Destructor */
@@ -155,9 +158,9 @@
//@}
};
-inline StdInInputSource::StdInInputSource() :
+inline StdInInputSource::StdInInputSource(MemoryManager* const manager) :
- InputSource("stdin")
+ InputSource("stdin", manager)
{
}
1.4 +25 -14 xml-xerces/c/src/xercesc/framework/URLInputSource.cpp
Index: URLInputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/URLInputSource.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- URLInputSource.cpp 4 Nov 2002 15:00:21 -0000 1.3
+++ URLInputSource.cpp 16 May 2003 21:36:55 -0000 1.4
@@ -56,6 +56,9 @@
/**
* $Log$
+ * Revision 1.4 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.3 2002/11/04 15:00:21 tng
* C++ Namespace Support.
*
@@ -103,41 +106,49 @@
// ---------------------------------------------------------------------------
// URLInputSource: Constructors and Destructor
// ---------------------------------------------------------------------------
-URLInputSource::URLInputSource(const XMLURL& urlId) :
+URLInputSource::URLInputSource( const XMLURL& urlId
+ , MemoryManager* const manager) :
- fURL(urlId)
+ InputSource(manager)
+ , fURL(urlId)
{
setSystemId(fURL.getURLText());
}
-URLInputSource::URLInputSource( const XMLCh* const baseId
- , const XMLCh* const systemId) :
- fURL(baseId, systemId)
+URLInputSource::URLInputSource( const XMLCh* const baseId
+ , const XMLCh* const systemId
+ , MemoryManager* const manager) :
+ InputSource(manager)
+ , fURL(baseId, systemId)
{
// Create a URL that will build up the full URL and store as the system id
setSystemId(fURL.getURLText());
}
-URLInputSource::URLInputSource( const XMLCh* const baseId
- , const XMLCh* const systemId
- , const XMLCh* const publicId) :
- InputSource(0, publicId)
+URLInputSource::URLInputSource( const XMLCh* const baseId
+ , const XMLCh* const systemId
+ , const XMLCh* const publicId
+ , MemoryManager* const manager) :
+ InputSource(0, publicId, manager)
, fURL(baseId, systemId)
{
setSystemId(fURL.getURLText());
}
-URLInputSource::URLInputSource( const XMLCh* const baseId
- , const char* const systemId) :
- fURL(baseId, systemId)
+URLInputSource::URLInputSource( const XMLCh* const baseId
+ , const char* const systemId
+ , MemoryManager* const manager) :
+ InputSource(manager)
+ , fURL(baseId, systemId)
{
setSystemId(fURL.getURLText());
}
URLInputSource::URLInputSource( const XMLCh* const baseId
, const char* const systemId
- , const char* const publicId) :
- InputSource(0, publicId)
+ , const char* const publicId
+ , MemoryManager* const manager) :
+ InputSource(0, publicId, manager)
, fURL(baseId, systemId)
{
setSystemId(fURL.getURLText());
1.3 +12 -1 xml-xerces/c/src/xercesc/framework/URLInputSource.hpp
Index: URLInputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/URLInputSource.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- URLInputSource.hpp 4 Nov 2002 15:00:21 -0000 1.2
+++ URLInputSource.hpp 16 May 2003 21:36:55 -0000 1.3
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.3 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.2 2002/11/04 15:00:21 tng
* C++ Namespace Support.
*
@@ -144,7 +147,11 @@
* @param urlId The URL which holds the system id of the entity
* to parse.
*/
- URLInputSource(const XMLURL& urlId);
+ URLInputSource
+ (
+ const XMLURL& urlId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ );
/**
@@ -163,6 +170,7 @@
(
const XMLCh* const baseId
, const XMLCh* const systemId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -183,6 +191,7 @@
const XMLCh* const baseId
, const XMLCh* const systemId
, const XMLCh* const publicId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
@@ -201,6 +210,7 @@
(
const XMLCh* const baseId
, const char* const systemId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -223,6 +233,7 @@
const XMLCh* const baseId
, const char* const systemId
, const char* const publicId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.4 +7 -2 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Wrapper4DOMInputSource.cpp 4 Nov 2002 15:00:21 -0000 1.3
+++ Wrapper4DOMInputSource.cpp 16 May 2003 21:36:55 -0000 1.4
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.4 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.3 2002/11/04 15:00:21 tng
* C++ Namespace Support.
*
@@ -82,8 +85,10 @@
// Wrapper4DOMInputSource: Constructor and Destructor
// ---------------------------------------------------------------------------
Wrapper4DOMInputSource::Wrapper4DOMInputSource(DOMInputSource* const inputSource,
- const bool adoptFlag) :
- fAdoptInputSource(adoptFlag)
+ const bool adoptFlag,
+ MemoryManager* const manager) :
+ InputSource(manager)
+ , fAdoptInputSource(adoptFlag)
, fInputSource(inputSource)
{
if (!inputSource)
1.5 +7 -3 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Wrapper4DOMInputSource.hpp 7 Mar 2003 18:08:10 -0000 1.4
+++ Wrapper4DOMInputSource.hpp 16 May 2003 21:36:55 -0000 1.5
@@ -88,8 +88,12 @@
* @param adoptFlag Indicates if the wrapper should adopt the wrapped
* DOMInputSource. Default is true.
*/
- Wrapper4DOMInputSource(DOMInputSource* const inputSource,
- const bool adoptFlag = true);
+ Wrapper4DOMInputSource
+ (
+ DOMInputSource* const inputSource
+ , const bool adoptFlag = true
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ );
/**
* Destructor
1.5 +11 -9 xml-xerces/c/src/xercesc/framework/XMLAttDef.cpp
Index: XMLAttDef.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttDef.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLAttDef.cpp 15 May 2003 18:26:07 -0000 1.4
+++ XMLAttDef.cpp 16 May 2003 21:36:55 -0000 1.5
@@ -151,8 +151,9 @@
// ---------------------------------------------------------------------------
// XMLAttDef: Hidden constructors
// ---------------------------------------------------------------------------
-XMLAttDef::XMLAttDef(const XMLAttDef::AttTypes type
- , const XMLAttDef::DefAttTypes defType) :
+XMLAttDef::XMLAttDef( const XMLAttDef::AttTypes type
+ , const XMLAttDef::DefAttTypes defType
+ , MemoryManager* const manager) :
fDefaultType(defType)
, fType(type)
@@ -162,14 +163,15 @@
, fId(XMLAttDef::fgInvalidAttrId)
, fValue(0)
, fEnumeration(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
}
-XMLAttDef::XMLAttDef(const XMLCh* const attrValue
- , const XMLAttDef::AttTypes type
- , const XMLAttDef::DefAttTypes defType
- , const XMLCh* const enumValues) :
+XMLAttDef::XMLAttDef( const XMLCh* const attrValue
+ , const XMLAttDef::AttTypes type
+ , const XMLAttDef::DefAttTypes defType
+ , const XMLCh* const enumValues
+ , MemoryManager* const manager) :
fDefaultType(defType)
, fType(type)
@@ -179,7 +181,7 @@
, fId(XMLAttDef::fgInvalidAttrId)
, fValue(0)
, fEnumeration(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
try
{
1.9 +7 -2 xml-xerces/c/src/xercesc/framework/XMLAttDef.hpp
Index: XMLAttDef.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttDef.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLAttDef.hpp 15 May 2003 18:26:07 -0000 1.8
+++ XMLAttDef.hpp 16 May 2003 21:36:55 -0000 1.9
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.9 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.8 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -511,8 +514,9 @@
// -----------------------------------------------------------------------
XMLAttDef
(
- const AttTypes type = CData
- , const DefAttTypes defType = Implied
+ const AttTypes type = CData
+ , const DefAttTypes defType= Implied
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XMLAttDef
(
@@ -520,6 +524,7 @@
, const AttTypes type
, const DefAttTypes defType
, const XMLCh* const enumValues = 0
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
1.4 +4 -1 xml-xerces/c/src/xercesc/framework/XMLAttDefList.hpp
Index: XMLAttDefList.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttDefList.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLAttDefList.hpp 15 May 2003 18:26:07 -0000 1.3
+++ XMLAttDefList.hpp 16 May 2003 21:36:55 -0000 1.4
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.4 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.3 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -107,7 +110,7 @@
* there are portability issues with deriving from a template class in a
* DLL. It does though provide a similar enumerator interface.
*/
-class XMLPARSER_EXPORT XMLAttDefList
+class XMLPARSER_EXPORT XMLAttDefList : public XMemory
{
public:
// -----------------------------------------------------------------------
1.6 +9 -6 xml-xerces/c/src/xercesc/framework/XMLAttr.hpp
Index: XMLAttr.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLAttr.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLAttr.hpp 15 May 2003 18:26:07 -0000 1.5
+++ XMLAttr.hpp 16 May 2003 21:36:55 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -188,9 +191,9 @@
, const XMLCh* const attrName
, const XMLCh* const attrPrefix
, const XMLCh* const attrValue
- , const XMLAttDef::AttTypes type// = XMLAttDef::CData
- , const bool specified// = true
- , MemoryManager* const manager //= XMLPlatformUtils::fgMemoryManager
+ , const XMLAttDef::AttTypes type = XMLAttDef::CData
+ , const bool specified = true
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -222,9 +225,9 @@
const unsigned int uriId
, const XMLCh* const rawName
, const XMLCh* const attrValue
- , const XMLAttDef::AttTypes type// = XMLAttDef::CData
- , const bool specified// = true
- , MemoryManager* const manager //= XMLPlatformUtils::fgMemoryManager
+ , const XMLAttDef::AttTypes type = XMLAttDef::CData
+ , const bool specified = true
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.5 +5 -2 xml-xerces/c/src/xercesc/framework/XMLBuffer.hpp
Index: XMLBuffer.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLBuffer.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLBuffer.hpp 15 May 2003 18:26:07 -0000 1.4
+++ XMLBuffer.hpp 16 May 2003 21:36:55 -0000 1.5
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.5 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.4 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -122,8 +125,8 @@
/** @name Constructor */
//@{
- XMLBuffer(int capacity = 1023,
- MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
+ XMLBuffer(int capacity = 1023
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) :
fUsed(false)
, fIndex(0)
1.6 +4 -1 xml-xerces/c/src/xercesc/framework/XMLBufferMgr.hpp
Index: XMLBufferMgr.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLBufferMgr.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLBufferMgr.hpp 15 May 2003 18:26:07 -0000 1.5
+++ XMLBufferMgr.hpp 16 May 2003 21:36:55 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -120,7 +123,7 @@
/** @name Constructor */
//@{
- XMLBufferMgr(MemoryManager* const manager/* = XMLPlatformUtils::fgMemoryManager*/);
+ XMLBufferMgr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@}
/** @name Destructor */
1.7 +4 -1 xml-xerces/c/src/xercesc/framework/XMLElementDecl.hpp
Index: XMLElementDecl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLElementDecl.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLElementDecl.hpp 15 May 2003 18:26:07 -0000 1.6
+++ XMLElementDecl.hpp 16 May 2003 21:36:55 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -589,7 +592,7 @@
// -----------------------------------------------------------------------
// Hidden constructors
// -----------------------------------------------------------------------
- XMLElementDecl(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/);
+ XMLElementDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
private :
// -----------------------------------------------------------------------
1.6 +13 -10 xml-xerces/c/src/xercesc/framework/XMLEntityDecl.cpp
Index: XMLEntityDecl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLEntityDecl.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLEntityDecl.cpp 15 May 2003 18:26:07 -0000 1.5
+++ XMLEntityDecl.cpp 16 May 2003 21:36:55 -0000 1.6
@@ -71,7 +71,7 @@
// ---------------------------------------------------------------------------
// XMLEntityDecl: Constructors and Destructor
// ---------------------------------------------------------------------------
-XMLEntityDecl::XMLEntityDecl() :
+XMLEntityDecl::XMLEntityDecl(MemoryManager* const manager) :
fId(0)
, fValueLen(0)
@@ -81,11 +81,12 @@
, fPublicId(0)
, fSystemId(0)
, fBaseURI(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
}
-XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName) :
+XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName,
+ MemoryManager* const manager) :
fId(0)
, fValueLen(0)
@@ -95,13 +96,14 @@
, fPublicId(0)
, fSystemId(0)
, fBaseURI(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
fName = XMLString::replicate(entName, fMemoryManager);
}
-XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName
- , const XMLCh* const value) :
+XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName
+ , const XMLCh* const value
+ , MemoryManager* const manager) :
fId(0)
, fValueLen(XMLString::stringLen(value))
, fValue(0)
@@ -110,7 +112,7 @@
, fPublicId(0)
, fSystemId(0)
, fBaseURI(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
try
{
@@ -123,8 +125,9 @@
}
}
-XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName
- , const XMLCh value) :
+XMLEntityDecl::XMLEntityDecl(const XMLCh* const entName
+ , const XMLCh value
+ , MemoryManager* const manager) :
fId(0)
, fValueLen(1)
, fValue(0)
1.7 +7 -1 xml-xerces/c/src/xercesc/framework/XMLEntityDecl.hpp
Index: XMLEntityDecl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLEntityDecl.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLEntityDecl.hpp 15 May 2003 18:26:07 -0000 1.6
+++ XMLEntityDecl.hpp 16 May 2003 21:36:55 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -137,7 +140,7 @@
/**
* Deafult Constructor
*/
- XMLEntityDecl();
+ XMLEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
/** Constructor with a const entity name
*
@@ -146,6 +149,7 @@
XMLEntityDecl
(
const XMLCh* const entName
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -158,6 +162,7 @@
(
const XMLCh* const entName
, const XMLCh* const value
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
@@ -170,6 +175,7 @@
(
const XMLCh* const entName
, const XMLCh value
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.12 +7 -5 xml-xerces/c/src/xercesc/framework/XMLFormatter.cpp
Index: XMLFormatter.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLFormatter.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XMLFormatter.cpp 15 May 2003 18:26:07 -0000 1.11
+++ XMLFormatter.cpp 16 May 2003 21:36:55 -0000 1.12
@@ -182,7 +182,8 @@
, const char* const docVersion
, XMLFormatTarget* const target
, const EscapeFlags escapeFlags
- , const UnRepFlags unrepFlags)
+ , const UnRepFlags unrepFlags
+ , MemoryManager* const manager)
: fEscapeFlags(escapeFlags)
, fOutEncoding(0)
, fTarget(target)
@@ -199,7 +200,7 @@
, fQuoteRef(0)
, fQuoteLen(0)
, fIsXML11(false)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
// Transcode the encoding string
fOutEncoding = XMLString::transcode(outEncoding, fMemoryManager);
@@ -235,7 +236,8 @@
, const XMLCh* const docVersion
, XMLFormatTarget* const target
, const EscapeFlags escapeFlags
- , const UnRepFlags unrepFlags)
+ , const UnRepFlags unrepFlags
+ , MemoryManager* const manager)
: fEscapeFlags(escapeFlags)
, fOutEncoding(0)
, fTarget(target)
@@ -252,7 +254,7 @@
, fQuoteRef(0)
, fQuoteLen(0)
, fIsXML11(false)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
// Try to create a transcoder for this encoding
XMLTransService::Codes resCode;
1.14 +5 -0 xml-xerces/c/src/xercesc/framework/XMLFormatter.hpp
Index: XMLFormatter.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLFormatter.hpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- XMLFormatter.hpp 15 May 2003 18:26:07 -0000 1.13
+++ XMLFormatter.hpp 16 May 2003 21:36:55 -0000 1.14
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.14 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.13 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -286,6 +289,7 @@
, XMLFormatTarget* const target
, const EscapeFlags escapeFlags = NoEscapes
, const UnRepFlags unrepFlags = UnRep_Fail
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XMLFormatter
@@ -295,6 +299,7 @@
, XMLFormatTarget* const target
, const EscapeFlags escapeFlags = NoEscapes
, const UnRepFlags unrepFlags = UnRep_Fail
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
~XMLFormatter();
1.6 +11 -7 xml-xerces/c/src/xercesc/framework/XMLNotationDecl.cpp
Index: XMLNotationDecl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLNotationDecl.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLNotationDecl.cpp 15 May 2003 18:26:07 -0000 1.5
+++ XMLNotationDecl.cpp 16 May 2003 21:36:55 -0000 1.6
@@ -56,6 +56,9 @@
/**
* $Log$
+ * Revision 1.6 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -93,27 +96,28 @@
// ---------------------------------------------------------------------------
// XMLNotationDecl: Constructors and operators
// ---------------------------------------------------------------------------
-XMLNotationDecl::XMLNotationDecl() :
+XMLNotationDecl::XMLNotationDecl(MemoryManager* const manager) :
fId(0)
, fName(0)
, fPublicId(0)
, fSystemId(0)
, fBaseURI(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
}
-XMLNotationDecl::XMLNotationDecl( const XMLCh* const notName
- , const XMLCh* const pubId
- , const XMLCh* const sysId
- , const XMLCh* const baseURI) :
+XMLNotationDecl::XMLNotationDecl( const XMLCh* const notName
+ , const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , const XMLCh* const baseURI
+ , MemoryManager* const manager) :
fId(0)
, fName(0)
, fPublicId(0)
, fSystemId(0)
, fBaseURI(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
try
{
1.7 +5 -1 xml-xerces/c/src/xercesc/framework/XMLNotationDecl.hpp
Index: XMLNotationDecl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLNotationDecl.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLNotationDecl.hpp 15 May 2003 18:26:07 -0000 1.6
+++ XMLNotationDecl.hpp 16 May 2003 21:36:55 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -123,13 +126,14 @@
/** @name Constructors */
//@{
- XMLNotationDecl();
+ XMLNotationDecl(MemoryManager* const manager);
XMLNotationDecl
(
const XMLCh* const notName
, const XMLCh* const pubId
, const XMLCh* const sysId
, const XMLCh* const baseURI = 0
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.7 +12 -7 xml-xerces/c/src/xercesc/framework/XMLRefInfo.hpp
Index: XMLRefInfo.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLRefInfo.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLRefInfo.hpp 15 May 2003 18:26:07 -0000 1.6
+++ XMLRefInfo.hpp 16 May 2003 21:36:55 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:36:55 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:07 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -129,9 +132,10 @@
//@{
XMLRefInfo
(
- const XMLCh* const refName
- , const bool fDeclared = false
- , const bool fUsed = false
+ const XMLCh* const refName
+ , const bool fDeclared = false
+ , const bool fUsed = false
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
@@ -190,13 +194,14 @@
// ---------------------------------------------------------------------------
// XMLRefInfo: Constructors and Destructor
// ---------------------------------------------------------------------------
-inline XMLRefInfo::XMLRefInfo( const XMLCh* const refName
- , const bool declared
- , const bool used) :
+inline XMLRefInfo::XMLRefInfo( const XMLCh* const refName
+ , const bool declared
+ , const bool used
+ , MemoryManager* const manager) :
fDeclared(declared)
, fUsed(used)
, fRefName(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
fRefName = XMLString::replicate(refName, fMemoryManager);
}
1.13 +7 -4 xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp
Index: DGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DGXMLScanner.cpp 15 May 2003 18:26:29 -0000 1.12
+++ DGXMLScanner.cpp 16 May 2003 21:36:57 -0000 1.13
@@ -85,6 +85,7 @@
DGXMLScanner::DGXMLScanner(XMLValidator* const valToAdopt, MemoryManager* const manager) :
XMLScanner(valToAdopt, manager)
+ , fElemStack(manager)
, fAttrNSList(0)
, fDTDValidator(0)
, fDTDGrammar(0)
@@ -118,6 +119,7 @@
, MemoryManager* const manager) :
XMLScanner(docHandler, docTypeHandler, entityHandler, errHandler, valToAdopt, manager)
+ , fElemStack(manager)
, fAttrNSList(0)
, fDTDValidator(0)
, fDTDGrammar(0)
@@ -981,7 +983,7 @@
// with an external entity. Put a janitor on it to insure it gets
// cleaned up. The reader manager does not adopt them.
const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull };
- DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr);
+ DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager);
declDTD->setSystemId(sysId);
Janitor<DTDEntityDecl> janDecl(declDTD);
@@ -1723,7 +1725,7 @@
// with an external entity. Put a janitor on it to insure it gets
// cleaned up. The reader manager does not adopt them.
const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull };
- DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr);
+ DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager);
declDTD->setSystemId(src.getSystemId());
Janitor<DTDEntityDecl> janDecl(declDTD);
@@ -2316,7 +2318,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
catch(const MalformedURLException& e)
@@ -2327,6 +2329,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
1.6 +7 -4 xml-xerces/c/src/xercesc/internal/ElemStack.cpp
Index: ElemStack.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/ElemStack.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemStack.cpp 15 May 2003 18:26:29 -0000 1.5
+++ ElemStack.cpp 16 May 2003 21:36:57 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/05/16 21:36:57 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -146,7 +149,7 @@
// ---------------------------------------------------------------------------
// ElemStack: Constructors and Destructor
// ---------------------------------------------------------------------------
-ElemStack::ElemStack() :
+ElemStack::ElemStack(MemoryManager* const manager) :
fEmptyNamespaceId(0)
, fGlobalPoolId(0)
@@ -158,7 +161,7 @@
, fXMLPoolId(0)
, fXMLNSNamespaceId(0)
, fXMLNSPoolId(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
// Do an initial allocation of the stack and zero it out
fStack = (StackElem**) fMemoryManager->allocate
@@ -554,7 +557,7 @@
// ---------------------------------------------------------------------------
// WFElemStack: Constructors and Destructor
// ---------------------------------------------------------------------------
-WFElemStack::WFElemStack() :
+WFElemStack::WFElemStack(MemoryManager* const manager) :
fEmptyNamespaceId(0)
, fGlobalPoolId(0)
@@ -568,7 +571,7 @@
, fMapCapacity(0)
, fMap(0)
, fStack(0)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
// Do an initial allocation of the stack and zero it out
fStack = (StackElem**) fMemoryManager->allocate
1.6 +5 -2 xml-xerces/c/src/xercesc/internal/ElemStack.hpp
Index: ElemStack.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/ElemStack.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ElemStack.hpp 15 May 2003 18:26:29 -0000 1.5
+++ ElemStack.hpp 16 May 2003 21:36:57 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/05/16 21:36:57 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -216,7 +219,7 @@
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
- ElemStack();
+ ElemStack(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~ElemStack();
@@ -402,7 +405,7 @@
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
- WFElemStack();
+ WFElemStack(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~WFElemStack();
1.12 +8 -4 xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp
Index: IGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- IGXMLScanner.cpp 16 May 2003 06:01:50 -0000 1.11
+++ IGXMLScanner.cpp 16 May 2003 21:36:57 -0000 1.12
@@ -94,6 +94,8 @@
, fSeeXsi(false)
, fElemStateSize(16)
, fElemState(0)
+ , fElemStack(manager)
+ , fContent(1023, manager)
, fRawAttrList(0)
, fDTDValidator(0)
, fSchemaValidator(0)
@@ -128,6 +130,8 @@
, fSeeXsi(false)
, fElemStateSize(16)
, fElemState(0)
+ , fElemStack(manager)
+ , fContent(1023, manager)
, fRawAttrList(0)
, fDTDValidator(0)
, fSchemaValidator(0)
@@ -1385,7 +1389,7 @@
// with an external entity. Put a janitor on it to insure it gets
// cleaned up. The reader manager does not adopt them.
const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull };
- DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr);
+ DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager);
declDTD->setSystemId(sysId);
Janitor<DTDEntityDecl> janDecl(declDTD);
@@ -2376,7 +2380,7 @@
if (!XMLString::startsWith(typeName, poundStr)) {
const int comma = XMLString::indexOf(typeName, chComma);
if (comma > 0) {
- XMLBuffer prefixBuf(comma+1);
+ XMLBuffer prefixBuf(comma+1, fMemoryManager);
prefixBuf.append(typeName, comma);
const XMLCh* uriStr = prefixBuf.getRawBuffer();
@@ -2892,7 +2896,7 @@
// with an external entity. Put a janitor on it to insure it gets
// cleaned up. The reader manager does not adopt them.
const XMLCh gDTDStr[] = { chLatin_D, chLatin_T, chLatin_D , chNull };
- DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr);
+ DTDEntityDecl* declDTD = new (fMemoryManager) DTDEntityDecl(gDTDStr, false, fMemoryManager);
declDTD->setSystemId(src.getSystemId());
Janitor<DTDEntityDecl> janDecl(declDTD);
1.19 +7 -5 xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp
Index: IGXMLScanner2.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- IGXMLScanner2.cpp 15 May 2003 18:26:29 -0000 1.18
+++ IGXMLScanner2.cpp 16 May 2003 21:36:57 -0000 1.19
@@ -1026,7 +1026,7 @@
// The normalized data can only be as large as the
// original size, so this will avoid allocating way
// too much or too little memory.
- XMLBuffer toFill(len+1);
+ XMLBuffer toFill(len+1, fMemoryManager);
toFill.set(rawBuf);
if (fNormalizeData) {
@@ -1068,7 +1068,7 @@
// The normalized data can only be as large as the
// original size, so this will avoid allocating way
// too much or too little memory.
- XMLBuffer toFill(len+1);
+ XMLBuffer toFill(len+1, fMemoryManager);
toFill.set(rawBuf);
if (fNormalizeData) {
@@ -1346,7 +1346,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
@@ -1358,6 +1358,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
@@ -1516,7 +1517,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
catch(const MalformedURLException& e)
@@ -1527,6 +1528,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
1.14 +10 -5 xml-xerces/c/src/xercesc/internal/ReaderMgr.cpp
Index: ReaderMgr.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/ReaderMgr.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ReaderMgr.cpp 16 May 2003 06:01:50 -0000 1.13
+++ ReaderMgr.cpp 16 May 2003 21:36:57 -0000 1.14
@@ -454,6 +454,7 @@
, false
, calcSrcOfs
, fXMLVersion
+ , fMemoryManager
);
}
else
@@ -469,6 +470,7 @@
, false
, calcSrcOfs
, fXMLVersion
+ , fMemoryManager
);
}
}
@@ -501,7 +503,7 @@
, const bool calcSrcOfs)
{
// Create a buffer for expanding the system id
- XMLBuffer expSysId;
+ XMLBuffer expSysId(1023, fMemoryManager);
//
// Allow the entity handler to expand the system id if they choose
@@ -551,7 +553,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
@@ -563,6 +565,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
@@ -610,7 +613,7 @@
, const bool calcSrcOfs)
{
// Create a buffer for expanding the system id
- XMLBuffer expSysId;
+ XMLBuffer expSysId(1023, fMemoryManager);
//
// Allow the entity handler to expand the system id if they choose
@@ -661,7 +664,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
@@ -673,6 +676,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
@@ -749,6 +753,7 @@
, false
, calcSrcOfs
, fXMLVersion
+ , fMemoryManager
);
// If it failed for any reason, then return zero.
1.9 +5 -2 xml-xerces/c/src/xercesc/internal/ReaderMgr.hpp
Index: ReaderMgr.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/ReaderMgr.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ReaderMgr.hpp 15 May 2003 18:26:29 -0000 1.8
+++ ReaderMgr.hpp 16 May 2003 21:36:57 -0000 1.9
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.9 2003/05/16 21:36:57 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.8 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -172,7 +175,7 @@
// -----------------------------------------------------------------------
// Class specific types
// -----------------------------------------------------------------------
- struct LastExtEntityInfo
+ struct LastExtEntityInfo : public XMemory
{
const XMLCh* systemId;
const XMLCh* publicId;
@@ -184,7 +187,7 @@
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
- ReaderMgr(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/);
+ ReaderMgr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~ReaderMgr();
1.25 +12 -6 xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
Index: SGXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- SGXMLScanner.cpp 16 May 2003 06:01:50 -0000 1.24
+++ SGXMLScanner.cpp 16 May 2003 21:36:57 -0000 1.25
@@ -95,6 +95,8 @@
, fSeeXsi(false)
, fElemStateSize(16)
, fElemState(0)
+ , fElemStack(manager)
+ , fContent(1023, manager)
, fEntityTable(0)
, fRawAttrList(0)
, fSchemaValidator(0)
@@ -134,6 +136,8 @@
, fSeeXsi(false)
, fElemStateSize(16)
, fElemState(0)
+ , fElemStack(manager)
+ , fContent(1023, manager)
, fEntityTable(0)
, fRawAttrList(0)
, fSchemaValidator(0)
@@ -1463,7 +1467,7 @@
if (!XMLString::startsWith(typeName, poundStr)) {
const int comma = XMLString::indexOf(typeName, chComma);
if (comma > 0) {
- XMLBuffer prefixBuf(comma+1);
+ XMLBuffer prefixBuf(comma+1, fMemoryManager);
prefixBuf.append(typeName, comma);
const XMLCh* uriStr = prefixBuf.getRawBuffer();
@@ -2802,7 +2806,7 @@
// The normalized data can only be as large as the
// original size, so this will avoid allocating way
// too much or too little memory.
- XMLBuffer toFill(len+1);
+ XMLBuffer toFill(len+1, fMemoryManager);
toFill.set(rawBuf);
if (fNormalizeData) {
@@ -2836,7 +2840,7 @@
// The normalized data can only be as large as the
// original size, so this will avoid allocating way
// too much or too little memory.
- XMLBuffer toFill(len+1);
+ XMLBuffer toFill(len+1, fMemoryManager);
toFill.set(rawBuf);
if (fNormalizeData) {
@@ -3109,7 +3113,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
@@ -3121,6 +3125,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
@@ -3256,7 +3261,7 @@
else {
if (fStandardUriConformant && urlTmp.hasInvalidChar())
ThrowXML(MalformedURLException, XMLExcepts::URL_MalformedURL);
- srcToFill = new (fMemoryManager) URLInputSource(urlTmp);
+ srcToFill = new (fMemoryManager) URLInputSource(urlTmp, fMemoryManager);
}
}
catch(const MalformedURLException& e)
@@ -3267,6 +3272,7 @@
(
lastInfo.systemId
, expSysId.getRawBuffer()
+ , fMemoryManager
);
else
throw e;
1.7 +11 -8 xml-xerces/c/src/xercesc/internal/SGXMLScanner.hpp
Index: SGXMLScanner.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SGXMLScanner.hpp 15 May 2003 18:26:29 -0000 1.6
+++ SGXMLScanner.hpp 16 May 2003 21:36:57 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:36:57 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -108,17 +111,17 @@
// -----------------------------------------------------------------------
SGXMLScanner
(
- XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ XMLValidator* const valToAdopt
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
SGXMLScanner
(
- XMLDocumentHandler* const docHandler
- , DocTypeHandler* const docTypeHandler
- , XMLEntityHandler* const entityHandler
- , XMLErrorReporter* const errReporter
- , XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ XMLDocumentHandler* const docHandler
+ , DocTypeHandler* const docTypeHandler
+ , XMLEntityHandler* const entityHandler
+ , XMLErrorReporter* const errReporter
+ , XMLValidator* const valToAdopt
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
virtual ~SGXMLScanner();
1.4 +4 -1 xml-xerces/c/src/xercesc/internal/VecAttributesImpl.cpp
Index: VecAttributesImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/VecAttributesImpl.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VecAttributesImpl.cpp 4 Nov 2002 14:58:18 -0000 1.3
+++ VecAttributesImpl.cpp 16 May 2003 21:36:57 -0000 1.4
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.4 2003/05/16 21:36:57 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.3 2002/11/04 14:58:18 tng
* C++ Namespace Support.
*
@@ -188,7 +191,7 @@
// Search the vector for the attribute with the given name and return
// its type.
//
- XMLBuffer uriBuffer ;
+ XMLBuffer uriBuffer(1023, fVector->getMemoryManager()) ;
for (unsigned int index = 0; index < fCount; index++)
{
const XMLAttr* curElem = fVector->elementAt(index);
1.11 +3 -1 xml-xerces/c/src/xercesc/internal/WFXMLScanner.cpp
Index: WFXMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/WFXMLScanner.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- WFXMLScanner.cpp 15 May 2003 18:26:29 -0000 1.10
+++ WFXMLScanner.cpp 16 May 2003 21:36:57 -0000 1.11
@@ -89,6 +89,7 @@
, fAttrNameHashList(0)
, fAttrNSList(0)
, fElementLookup(0)
+ , fElemStack(manager)
{
try
{
@@ -115,6 +116,7 @@
, fAttrNameHashList(0)
, fAttrNSList(0)
, fElementLookup(0)
+ , fElemStack(manager)
{
try
{
1.6 +11 -8 xml-xerces/c/src/xercesc/internal/WFXMLScanner.hpp
Index: WFXMLScanner.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/WFXMLScanner.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WFXMLScanner.hpp 15 May 2003 18:26:29 -0000 1.5
+++ WFXMLScanner.hpp 16 May 2003 21:36:57 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/05/16 21:36:57 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -96,17 +99,17 @@
// -----------------------------------------------------------------------
WFXMLScanner
(
- XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ XMLValidator* const valToAdopt
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
WFXMLScanner
(
- XMLDocumentHandler* const docHandler
- , DocTypeHandler* const docTypeHandler
- , XMLEntityHandler* const entityHandler
- , XMLErrorReporter* const errReporter
- , XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ XMLDocumentHandler* const docHandler
+ , DocTypeHandler* const docTypeHandler
+ , XMLEntityHandler* const entityHandler
+ , XMLErrorReporter* const errReporter
+ , XMLValidator* const valToAdopt
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
virtual ~WFXMLScanner();
1.15 +36 -33 xml-xerces/c/src/xercesc/internal/XMLReader.cpp
Index: XMLReader.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLReader.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- XMLReader.cpp 15 May 2003 18:26:29 -0000 1.14
+++ XMLReader.cpp 16 May 2003 21:36:57 -0000 1.15
@@ -125,15 +125,16 @@
// ---------------------------------------------------------------------------
// XMLReader: Constructors and Destructor
// ---------------------------------------------------------------------------
-XMLReader::XMLReader(const XMLCh* const pubId
- , const XMLCh* const sysId
- , BinInputStream* const streamToAdopt
- , const RefFrom from
- , const Types type
- , const Sources source
- , const bool throwAtEnd
- , const bool calculateSrcOfs
- , const XMLVersion version) :
+XMLReader::XMLReader(const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , BinInputStream* const streamToAdopt
+ , const RefFrom from
+ , const Types type
+ , const Sources source
+ , const bool throwAtEnd
+ , const bool calculateSrcOfs
+ , const XMLVersion version
+ , MemoryManager* const manager) :
fCharIndex(0)
, fCharsAvail(0)
, fCurCol(1)
@@ -157,7 +158,7 @@
, fThrowAtEnd(throwAtEnd)
, fTranscoder(0)
, fType(type)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
setXMLVersion(version);
@@ -203,16 +204,17 @@
}
-XMLReader::XMLReader(const XMLCh* const pubId
- , const XMLCh* const sysId
- , BinInputStream* const streamToAdopt
- , const XMLCh* const encodingStr
- , const RefFrom from
- , const Types type
- , const Sources source
- , const bool throwAtEnd
- , const bool calculateSrcOfs
- , const XMLVersion version) :
+XMLReader::XMLReader(const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , BinInputStream* const streamToAdopt
+ , const XMLCh* const encodingStr
+ , const RefFrom from
+ , const Types type
+ , const Sources source
+ , const bool throwAtEnd
+ , const bool calculateSrcOfs
+ , const XMLVersion version
+ , MemoryManager* const manager) :
fCharIndex(0)
, fCharsAvail(0)
, fCurCol(1)
@@ -237,7 +239,7 @@
, fThrowAtEnd(throwAtEnd)
, fTranscoder(0)
, fType(type)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
setXMLVersion(version);
@@ -322,16 +324,17 @@
}
-XMLReader::XMLReader(const XMLCh* const pubId
- , const XMLCh* const sysId
- , BinInputStream* const streamToAdopt
- , XMLRecognizer::Encodings encodingEnum
- , const RefFrom from
- , const Types type
- , const Sources source
- , const bool throwAtEnd
- , const bool calculateSrcOfs
- , const XMLVersion version) :
+XMLReader::XMLReader(const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , BinInputStream* const streamToAdopt
+ , XMLRecognizer::Encodings encodingEnum
+ , const RefFrom from
+ , const Types type
+ , const Sources source
+ , const bool throwAtEnd
+ , const bool calculateSrcOfs
+ , const XMLVersion version
+ , MemoryManager* const manager) :
fCharIndex(0)
, fCharsAvail(0)
, fCurCol(1)
@@ -356,7 +359,7 @@
, fThrowAtEnd(throwAtEnd)
, fTranscoder(0)
, fType(type)
- , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ , fMemoryManager(manager)
{
setXMLVersion(version);
1.14 +35 -29 xml-xerces/c/src/xercesc/internal/XMLReader.hpp
Index: XMLReader.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLReader.hpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- XMLReader.hpp 15 May 2003 18:26:29 -0000 1.13
+++ XMLReader.hpp 16 May 2003 21:36:58 -0000 1.14
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.14 2003/05/16 21:36:58 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.13 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -258,43 +261,46 @@
// -----------------------------------------------------------------------
XMLReader
(
- const XMLCh* const pubId
- , const XMLCh* const sysId
- , BinInputStream* const streamToAdopt
- , const RefFrom from
- , const Types type
- , const Sources source
- , const bool throwAtEnd = false
- , const bool calculateSrcOfs = true
- , const XMLVersion xmlVersion = XMLV1_0
+ const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , BinInputStream* const streamToAdopt
+ , const RefFrom from
+ , const Types type
+ , const Sources source
+ , const bool throwAtEnd = false
+ , const bool calculateSrcOfs = true
+ , const XMLVersion xmlVersion = XMLV1_0
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XMLReader
(
- const XMLCh* const pubId
- , const XMLCh* const sysId
- , BinInputStream* const streamToAdopt
- , const XMLCh* const encodingStr
- , const RefFrom from
- , const Types type
- , const Sources source
- , const bool throwAtEnd = false
- , const bool calculateSrcOfs = true
- , const XMLVersion xmlVersion = XMLV1_0
+ const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , BinInputStream* const streamToAdopt
+ , const XMLCh* const encodingStr
+ , const RefFrom from
+ , const Types type
+ , const Sources source
+ , const bool throwAtEnd = false
+ , const bool calculateSrcOfs = true
+ , const XMLVersion xmlVersion = XMLV1_0
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XMLReader
(
- const XMLCh* const pubId
- , const XMLCh* const sysId
- , BinInputStream* const streamToAdopt
- , XMLRecognizer::Encodings encodingEnum
- , const RefFrom from
- , const Types type
- , const Sources source
- , const bool throwAtEnd = false
- , const bool calculateSrcOfs = true
- , const XMLVersion xmlVersion = XMLV1_0
+ const XMLCh* const pubId
+ , const XMLCh* const sysId
+ , BinInputStream* const streamToAdopt
+ , XMLRecognizer::Encodings encodingEnum
+ , const RefFrom from
+ , const Types type
+ , const Sources source
+ , const bool throwAtEnd = false
+ , const bool calculateSrcOfs = true
+ , const XMLVersion xmlVersion = XMLV1_0
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
~XMLReader();
1.44 +10 -10 xml-xerces/c/src/xercesc/internal/XMLScanner.cpp
Index: XMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLScanner.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- XMLScanner.cpp 16 May 2003 06:01:50 -0000 1.43
+++ XMLScanner.cpp 16 May 2003 21:36:58 -0000 1.44
@@ -330,7 +330,7 @@
XMLURL tmpURL(systemId, fMemoryManager);
if (tmpURL.isRelative()) {
if (!fStandardUriConformant)
- srcToUse = new (fMemoryManager) LocalFileInputSource(systemId);
+ srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
else {
// since this is the top of the try/catch, cannot call ThrowXML
// emit the error directly
@@ -358,14 +358,14 @@
);
return;
}
- srcToUse = new (fMemoryManager) URLInputSource(tmpURL);
+ srcToUse = new (fMemoryManager) URLInputSource(tmpURL, fMemoryManager);
}
}
catch(const MalformedURLException& e)
{
if (!fStandardUriConformant)
- srcToUse = new (fMemoryManager) LocalFileInputSource(systemId);
+ srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
else {
// since this is the top of the try/catch, cannot call ThrowXML
// emit the error directly
@@ -447,7 +447,7 @@
XMLURL tmpURL(systemId, fMemoryManager);
if (tmpURL.isRelative()) {
if (!fStandardUriConformant)
- srcToUse = new (fMemoryManager) LocalFileInputSource(systemId);
+ srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
else {
// since this is the top of the try/catch, cannot call ThrowXML
// emit the error directly
@@ -475,13 +475,13 @@
);
return false;
}
- srcToUse = new (fMemoryManager) URLInputSource(tmpURL);
+ srcToUse = new (fMemoryManager) URLInputSource(tmpURL, fMemoryManager);
}
}
catch(const MalformedURLException& e)
{
if (!fStandardUriConformant)
- srcToUse = new (fMemoryManager) LocalFileInputSource(systemId);
+ srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
else {
// since this is the top of the try/catch, cannot call ThrowXML
// emit the error directly
@@ -1575,7 +1575,7 @@
if (tmpURL.isRelative())
{
if (!fStandardUriConformant)
- srcToUse = new (fMemoryManager) LocalFileInputSource(systemId);
+ srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
else {
// since this is the top of the try/catch, cannot call ThrowXML
// emit the error directly
@@ -1603,13 +1603,13 @@
);
return 0;
}
- srcToUse = new (fMemoryManager) URLInputSource(tmpURL);
+ srcToUse = new (fMemoryManager) URLInputSource(tmpURL, fMemoryManager);
}
}
catch(const MalformedURLException& e)
{
if (!fStandardUriConformant)
- srcToUse = new (fMemoryManager) LocalFileInputSource(systemId);
+ srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
else {
// since this is the top of the try/catch, cannot call ThrowXML
// emit the error directly
1.22 +5 -2 xml-xerces/c/src/xercesc/internal/XMLScanner.hpp
Index: XMLScanner.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLScanner.hpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- XMLScanner.hpp 15 May 2003 18:26:29 -0000 1.21
+++ XMLScanner.hpp 16 May 2003 21:36:58 -0000 1.22
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.22 2003/05/16 21:36:58 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.21 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -365,7 +368,7 @@
XMLScanner
(
XMLValidator* const valToAdopt
- , MemoryManager* const manager// = XMLPlatformUtils::fgMemoryManager
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XMLScanner
(
@@ -374,7 +377,7 @@
, XMLEntityHandler* const entityHandler
, XMLErrorReporter* const errReporter
, XMLValidator* const valToAdopt
- , MemoryManager* const manager// = XMLPlatformUtils::fgMemoryManager
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
virtual ~XMLScanner();
1.3 +6 -3 xml-xerces/c/src/xercesc/internal/XMLScannerResolver.hpp
Index: XMLScannerResolver.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLScannerResolver.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLScannerResolver.hpp 15 May 2003 18:26:29 -0000 1.2
+++ XMLScannerResolver.hpp 16 May 2003 21:36:58 -0000 1.3
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.3 2003/05/16 21:36:58 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.2 2003/05/15 18:26:29 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -87,7 +90,7 @@
(
const XMLCh* const scannerName
, XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
static XMLScanner* resolveScanner
@@ -98,13 +101,13 @@
, XMLEntityHandler* const entityHandler
, XMLErrorReporter* const errReporter
, XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
static XMLScanner* getDefaultScanner
(
XMLValidator* const valToAdopt
- , MemoryManager* const manager
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
private :
1.19 +7 -1 xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.hpp
Index: AbstractDOMParser.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/AbstractDOMParser.hpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- AbstractDOMParser.hpp 15 May 2003 18:26:50 -0000 1.18
+++ AbstractDOMParser.hpp 16 May 2003 21:36:59 -0000 1.19
@@ -1347,6 +1347,8 @@
*/
bool getParseInProgress() const;
+ MemoryManager* getMemoryManager() const;
+
//@}
@@ -1560,6 +1562,10 @@
return fCurrentNode;
}
+inline MemoryManager* AbstractDOMParser::getMemoryManager() const
+{
+ return fMemoryManager;
+}
// ---------------------------------------------------------------------------
// AbstractDOMParser: Protected setter methods
1.24 +4 -4 xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp
Index: DOMBuilderImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/DOMBuilderImpl.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- DOMBuilderImpl.cpp 15 May 2003 18:26:50 -0000 1.23
+++ DOMBuilderImpl.cpp 16 May 2003 21:36:59 -0000 1.24
@@ -433,7 +433,7 @@
// ---------------------------------------------------------------------------
DOMDocument* DOMBuilderImpl::parse(const DOMInputSource& source)
{
- Wrapper4DOMInputSource isWrapper((DOMInputSource*) &source, false);
+ Wrapper4DOMInputSource isWrapper((DOMInputSource*) &source, false, getMemoryManager());
AbstractDOMParser::parse(isWrapper);
if (fUserAdoptsDocument)
@@ -520,7 +520,7 @@
DOMInputSource* is = fEntityResolver->resolveEntity(publicId, systemId, baseURI);
if (is)
- return new Wrapper4DOMInputSource(is);
+ return new Wrapper4DOMInputSource(is, true, getMemoryManager());
}
return 0;
@@ -602,7 +602,7 @@
Grammar* grammar = 0;
try
{
- Wrapper4DOMInputSource isWrapper((DOMInputSource*) &source, false);
+ Wrapper4DOMInputSource isWrapper((DOMInputSource*) &source, false, getMemoryManager());
setParseInProgress(true);
grammar = getScanner()->loadGrammar(isWrapper, grammarType, toCache);
1.20 +4 -1 xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
Index: SAX2XMLReaderImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- SAX2XMLReaderImpl.cpp 16 May 2003 06:01:52 -0000 1.19
+++ SAX2XMLReaderImpl.cpp 16 May 2003 21:36:59 -0000 1.20
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.20 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.19 2003/05/16 06:01:52 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -1089,7 +1092,7 @@
XMLAttDef::DefAttTypes defAttType = attDef.getDefaultType();
const XMLCh* defAttTypeStr = XMLUni::fgNullString;
bool isEnumeration = (attType == XMLAttDef::Notation || attType == XMLAttDef::Enumeration);
- XMLBuffer enumBuf(128);
+ XMLBuffer enumBuf(128, fMemoryManager);
if (defAttType == XMLAttDef::Fixed ||
defAttType == XMLAttDef::Implied ||
1.18 +4 -0 xml-xerces/c/src/xercesc/parsers/SAXParser.cpp
Index: SAXParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/SAXParser.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SAXParser.cpp 15 May 2003 18:26:50 -0000 1.17
+++ SAXParser.cpp 16 May 2003 21:36:59 -0000 1.18
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.18 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.17 2003/05/15 18:26:50 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -262,6 +265,7 @@
, fURIStringPool(0)
, fValidator(valToAdopt)
, fMemoryManager(manager)
+ , fElemQNameBuf(1023, manager)
{
try
{
1.5 +18 -11 xml-xerces/c/src/xercesc/sax/InputSource.cpp
Index: InputSource.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/InputSource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InputSource.cpp 15 May 2003 18:27:05 -0000 1.4
+++ InputSource.cpp 16 May 2003 21:36:59 -0000 1.5
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.5 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.4 2003/05/15 18:27:05 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -139,9 +142,9 @@
// ---------------------------------------------------------------------------
// InputSource: Hidden Constructors
// ---------------------------------------------------------------------------
-InputSource::InputSource() :
+InputSource::InputSource(MemoryManager* const manager) :
- fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ fMemoryManager(manager)
, fEncoding(0)
, fPublicId(0)
, fSystemId(0)
@@ -149,9 +152,10 @@
{
}
-InputSource::InputSource(const XMLCh* const systemId) :
+InputSource::InputSource(const XMLCh* const systemId,
+ MemoryManager* const manager) :
- fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ fMemoryManager(manager)
, fEncoding(0)
, fPublicId(0)
, fSystemId(0)
@@ -160,10 +164,11 @@
fSystemId = XMLString::replicate(systemId, fMemoryManager);
}
-InputSource::InputSource(const XMLCh* const systemId
- , const XMLCh* const publicId) :
+InputSource::InputSource(const XMLCh* const systemId
+ , const XMLCh* const publicId
+ , MemoryManager* const manager) :
- fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ fMemoryManager(manager)
, fEncoding(0)
, fPublicId(0)
, fSystemId(0)
@@ -173,9 +178,10 @@
fSystemId = XMLString::replicate(systemId, fMemoryManager);
}
-InputSource::InputSource(const char* const systemId) :
+InputSource::InputSource(const char* const systemId,
+ MemoryManager* const manager) :
- fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ fMemoryManager(manager)
, fEncoding(0)
, fPublicId(0)
, fSystemId(0)
@@ -185,9 +191,10 @@
}
InputSource::InputSource(const char* const systemId
- , const char* const publicId) :
+ , const char* const publicId
+ , MemoryManager* const manager) :
- fMemoryManager(XMLPlatformUtils::fgMemoryManager)
+ fMemoryManager(manager)
, fEncoding(0)
, fPublicId(0)
, fSystemId(0)
1.7 +12 -5 xml-xerces/c/src/xercesc/sax/InputSource.hpp
Index: InputSource.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/InputSource.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- InputSource.hpp 15 May 2003 18:27:05 -0000 1.6
+++ InputSource.hpp 16 May 2003 21:36:59 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/15 18:27:05 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -306,12 +309,13 @@
/** @name Constructors and Destructor */
//@{
/** Default constructor */
- InputSource();
+ InputSource(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
/** Constructor with a system identifier as XMLCh type.
* @param systemId The system identifier (URI).
*/
- InputSource(const XMLCh* const systemId);
+ InputSource(const XMLCh* const systemId,
+ MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
/** Constructor with a system and public identifiers
* @param systemId The system identifier (URI).
@@ -319,14 +323,16 @@
*/
InputSource
(
- const XMLCh* const systemId
- , const XMLCh* const publicId
+ const XMLCh* const systemId
+ , const XMLCh* const publicId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/** Constructor witha system identifier as string
* @param systemId The system identifier (URI).
*/
- InputSource(const char* const systemId);
+ InputSource(const char* const systemId,
+ MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
/** Constructor witha system and public identifiers. Both as string
* @param systemId The system identifier (URI).
@@ -336,6 +342,7 @@
(
const char* const systemId
, const char* const publicId
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
1.4 +6 -0 xml-xerces/c/src/xercesc/util/BaseRefVectorOf.c
Index: BaseRefVectorOf.c
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/BaseRefVectorOf.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BaseRefVectorOf.c 16 May 2003 06:01:52 -0000 1.3
+++ BaseRefVectorOf.c 16 May 2003 21:36:59 -0000 1.4
@@ -259,6 +259,12 @@
}
+template <class TElem>
+MemoryManager* BaseRefVectorOf<TElem>::getMemoryManager() const
+{
+ return fMemoryManager;
+}
+
// ---------------------------------------------------------------------------
// BaseRefVectorOf: Getter methods
1.4 +1 -0 xml-xerces/c/src/xercesc/util/BaseRefVectorOf.hpp
Index: BaseRefVectorOf.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/BaseRefVectorOf.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BaseRefVectorOf.hpp 16 May 2003 06:01:52 -0000 1.3
+++ BaseRefVectorOf.hpp 16 May 2003 21:36:59 -0000 1.4
@@ -107,6 +107,7 @@
const TElem* elementAt(const unsigned int getAt) const;
TElem* elementAt(const unsigned int getAt);
unsigned int size() const;
+ MemoryManager* getMemoryManager() const;
// -----------------------------------------------------------------------
1.8 +10 -0 xml-xerces/c/src/xercesc/util/QName.hpp
Index: QName.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/QName.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- QName.hpp 16 May 2003 06:01:52 -0000 1.7
+++ QName.hpp 16 May 2003 21:36:59 -0000 1.8
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.8 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.7 2003/05/16 06:01:52 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -161,6 +164,8 @@
const XMLCh* getRawName() const;
XMLCh* getRawName();
+ MemoryManager* getMemoryManager() const;
+
// -----------------------------------------------------------------------
// Setters
// -----------------------------------------------------------------------
@@ -261,6 +266,11 @@
inline unsigned int QName::getURI() const
{
return fURIId;
+}
+
+inline MemoryManager* QName::getMemoryManager() const
+{
+ return fMemoryManager;
}
// ---------------------------------------------------------------------------
1.9 +9 -0 xml-xerces/c/src/xercesc/util/RefHashTableOf.c
Index: RefHashTableOf.c
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/RefHashTableOf.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- RefHashTableOf.c 15 May 2003 19:04:35 -0000 1.8
+++ RefHashTableOf.c 16 May 2003 21:36:59 -0000 1.9
@@ -56,6 +56,9 @@
/**
* $Log$
+ * Revision 1.9 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.8 2003/05/15 19:04:35 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -397,6 +400,12 @@
if (!findIt)
return 0;
return findIt->fData;
+}
+
+template <class TVal>
+MemoryManager* RefHashTableOf<TVal>::getMemoryManager() const
+{
+ return fMemoryManager;
}
1.9 +4 -0 xml-xerces/c/src/xercesc/util/RefHashTableOf.hpp
Index: RefHashTableOf.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/RefHashTableOf.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- RefHashTableOf.hpp 15 May 2003 19:04:35 -0000 1.8
+++ RefHashTableOf.hpp 16 May 2003 21:36:59 -0000 1.9
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.9 2003/05/16 21:36:59 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.8 2003/05/15 19:04:35 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -196,6 +199,7 @@
// -----------------------------------------------------------------------
TVal* get(const void* const key);
const TVal* get(const void* const key) const;
+ MemoryManager* getMemoryManager() const;
// -----------------------------------------------------------------------
// Setters
1.5 +8 -1 xml-xerces/c/src/xercesc/util/ValueVectorOf.c
Index: ValueVectorOf.c
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/ValueVectorOf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ValueVectorOf.c 16 May 2003 06:01:52 -0000 1.4
+++ ValueVectorOf.c 16 May 2003 21:37:00 -0000 1.5
@@ -56,6 +56,9 @@
/**
* $Log$
+ * Revision 1.5 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.4 2003/05/16 06:01:52 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -276,7 +279,11 @@
return fCurCount;
}
-
+template <class TElem>
+MemoryManager* ValueVectorOf<TElem>::getMemoryManager() const
+{
+ return fMemoryManager;
+}
// ---------------------------------------------------------------------------
// ValueVectorOf: Miscellaneous
1.6 +4 -0 xml-xerces/c/src/xercesc/util/ValueVectorOf.hpp
Index: ValueVectorOf.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/ValueVectorOf.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ValueVectorOf.hpp 16 May 2003 06:01:52 -0000 1.5
+++ ValueVectorOf.hpp 16 May 2003 21:37:00 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.5 2003/05/16 06:01:52 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -146,6 +149,7 @@
TElem& elementAt(const unsigned int getAt);
unsigned int curCapacity() const;
unsigned int size() const;
+ MemoryManager* getMemoryManager() const;
// -----------------------------------------------------------------------
1.8 +199 -4 xml-xerces/c/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
Index: ICUTransService.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ICUTransService.cpp 15 May 2003 18:47:03 -0000 1.7
+++ ICUTransService.cpp 16 May 2003 21:37:00 -0000 1.8
@@ -106,13 +106,16 @@
// When XMLCh and ICU's UChar are not the same size, we have to do a temp
// conversion of all strings. These local helper methods make that easier.
//
-static UChar* convertToUChar( const XMLCh* const toConvert
- , const unsigned int srcLen = 0)
+static UChar* convertToUChar( const XMLCh* const toConvert
+ , const unsigned int srcLen = 0
+ , MemoryManager* const manager = 0)
{
const unsigned int actualLen = srcLen
? srcLen : XMLString::stringLen(toConvert);
- UChar* tmpBuf = new UChar[actualLen + 1];
+ UChar* tmpBuf = (manager)
+ ? (UChar*) manager->allocate((actualLen + 1) * sizeof(UChar))
+ : new UChar[actualLen + 1];
const XMLCh* srcPtr = toConvert;
UChar* outPtr = tmpBuf;
while (*srcPtr)
@@ -928,7 +931,199 @@
return retBuf;
}
+char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
+ MemoryManager* const manager)
+{
+ char* retBuf = 0;
+
+ // Check for a couple of special cases
+ if (!toTranscode)
+ return retBuf;
+
+ if (!*toTranscode)
+ {
+ retBuf = new char[1];
+ retBuf[0] = 0;
+ return retBuf;
+ }
+
+ //
+ // Get the length of the source string since we'll have to use it in
+ // a couple places below.
+ //
+ const unsigned int srcLen = XMLString::stringLen(toTranscode);
+
+ //
+ // If XMLCh and UChar are not the same size, then we have to make a
+ // temp copy of the text to pass to ICU.
+ //
+ const UChar* actualSrc;
+ UChar* ncActual = 0;
+ if (sizeof(XMLCh) == sizeof(UChar))
+ {
+ actualSrc = (const UChar*)toTranscode;
+ }
+ else
+ {
+ // Allocate a non-const temp buf, but store it also in the actual
+ ncActual = convertToUChar(toTranscode);
+ actualSrc = ncActual;
+ }
+
+ // Insure that the temp buffer, if any, gets cleaned up via the nc pointer
+ ArrayJanitor<UChar> janTmp(ncActual);
+
+ // Caculate a return buffer size not too big, but less likely to overflow
+ int32_t targetLen = (int32_t)(srcLen * 1.25);
+
+ // Allocate the return buffer
+ retBuf = new char[targetLen + 1];
+
+ //
+ // Lock now while we call the converter. Use a faux block to do the
+ // lock so that it unlocks immediately afterwards.
+ //
+ UErrorCode err = U_ZERO_ERROR;
+ int32_t targetCap;
+ {
+ XMLMutexLock lockConverter(&fMutex);
+
+ targetCap = ucnv_fromUChars
+ (
+ fConverter
+ , retBuf
+ , targetLen + 1
+ , actualSrc
+ , -1
+ , &err
+ );
+ }
+
+ // If targetLen is not enough then buffer overflow might occur
+ if (err == U_BUFFER_OVERFLOW_ERROR)
+ {
+ //
+ // Reset the error, delete the old buffer, allocate a new one,
+ // and try again.
+ //
+ err = U_ZERO_ERROR;
+ delete [] retBuf;
+ retBuf = new char[targetCap + 1];
+
+ // Lock again before we retry
+ XMLMutexLock lockConverter(&fMutex);
+ targetCap = ucnv_fromUChars
+ (
+ fConverter
+ , retBuf
+ , targetCap
+ , actualSrc
+ , -1
+ , &err
+ );
+ }
+
+ if (U_FAILURE(err))
+ {
+ delete [] retBuf;
+ return 0;
+ }
+
+ // Cap it off and return
+ retBuf[targetCap] = 0;
+ return retBuf;
+}
+
XMLCh* ICULCPTranscoder::transcode(const char* const toTranscode)
+{
+ // Watch for a few pyscho corner cases
+ if (!toTranscode)
+ return 0;
+
+ if (!*toTranscode)
+ {
+ XMLCh* retVal = new XMLCh[1];
+ retVal[0] = 0;
+ return retVal;
+ }
+
+ //
+ // Get the length of the string to transcode. The Unicode string will
+ // almost always be no more chars than were in the source, so this is
+ // the best guess as to the storage needed.
+ //
+ const int32_t srcLen = (int32_t)strlen(toTranscode);
+
+ // We need a target buffer of UChars to fill in
+ UChar* targetBuf = 0;
+
+ // Now lock while we do these calculations
+ UErrorCode err = U_ZERO_ERROR;
+ int32_t targetCap;
+ {
+ XMLMutexLock lockConverter(&fMutex);
+
+ //
+ // Here we don't know what the target length will be so use 0 and
+ // expect an U_BUFFER_OVERFLOW_ERROR in which case it'd get resolved
+ // by the correct capacity value.
+ //
+ targetCap = ucnv_toUChars
+ (
+ fConverter
+ , 0
+ , 0
+ , toTranscode
+ , srcLen
+ , &err
+ );
+
+ if (err != U_BUFFER_OVERFLOW_ERROR)
+ return 0;
+
+ err = U_ZERO_ERROR;
+ targetBuf = new UChar[targetCap + 1];
+ ucnv_toUChars
+ (
+ fConverter
+ , targetBuf
+ , targetCap
+ , toTranscode
+ , srcLen
+ , &err
+ );
+ }
+
+ if (U_FAILURE(err))
+ {
+ // Clean up if we got anything allocated
+ delete [] targetBuf;
+ return 0;
+ }
+
+ // Cap it off to make sure
+ targetBuf[targetCap] = 0;
+
+ //
+ // If XMLCh and UChar are the same size, then we can return retVal
+ // as is. Else, we have to allocate another buffer and copy the data
+ // over to it.
+ //
+ XMLCh* actualRet;
+ if (sizeof(XMLCh) == sizeof(UChar))
+ {
+ actualRet = (XMLCh*)targetBuf;
+ }
+ else
+ {
+ actualRet = convertToXMLCh(targetBuf);
+ delete [] targetBuf;
+ }
+ return actualRet;
+}
+
+XMLCh* ICULCPTranscoder::transcode(const char* const toTranscode,
+ MemoryManager* const manager)
{
// Watch for a few pyscho corner cases
if (!toTranscode)
1.13 +181 -0 xml-xerces/c/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp
Index: IconvFBSDTransService.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- IconvFBSDTransService.cpp 15 May 2003 18:47:04 -0000 1.12
+++ IconvFBSDTransService.cpp 16 May 2003 21:37:00 -0000 1.13
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.13 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.12 2003/05/15 18:47:04 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -1139,6 +1142,98 @@
return retVal;
}
+char* IconvFBSDLCPTranscoder::transcode(const XMLCh* const toTranscode,
+ MemoryManager* const manager)
+{
+ if (!toTranscode)
+ return 0;
+
+ char* retVal = 0;
+ if (*toTranscode) {
+ unsigned int wLent = getWideCharLength(toTranscode);
+
+#ifndef XML_USE_LIBICONV
+
+ wchar_t tmpWideCharArr[gTempBuffArraySize];
+ wchar_t* allocatedArray = 0;
+ wchar_t* wideCharBuf = 0;
+
+ if (wLent >= gTempBuffArraySize)
+ wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+ else
+ wideCharBuf = tmpWideCharArr;
+
+ for (unsigned int i = 0; i < wLent; i++)
+ wideCharBuf[i] = toTranscode[i];
+ wideCharBuf[wLent] = 0x00;
+
+ // Calc the needed size.
+ const size_t neededLen = fbsd_wcstombs(NULL, wideCharBuf, 0);
+ if (neededLen == -1) {
+ if (allocatedArray)
+ delete [] allocatedArray;
+ return 0;
+ }
+
+ retVal = new char[neededLen + 1];
+ fbsd_wcstombs(retVal, wideCharBuf, neededLen);
+ if (allocatedArray)
+ delete [] allocatedArray;
+ retVal[neededLen] = 0;
+
+#else /* XML_USE_LIBICONV */
+
+ // Calc needed size.
+ const size_t neededLen = calcRequiredSize (toTranscode);
+ if (neededLen == 0)
+ return 0;
+ // allocate output buffer
+ retVal = new char[neededLen + 1];
+ if (retVal == NULL)
+ return 0;
+ // prepare the original
+ char tmpWBuff[gTempBuffArraySize];
+ char *wideCharBuf = 0;
+ char *wBufPtr = 0;
+ size_t len = wLent * uChSize();
+
+ if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
+ if (len > gTempBuffArraySize) {
+ wBufPtr = new char[len];
+ if (wBufPtr == NULL)
+ return 0;
+ wideCharBuf = wBufPtr;
+ } else
+ wideCharBuf = tmpWBuff;
+ xmlToMbs (toTranscode, wLent, wideCharBuf, wLent);
+ } else
+ wideCharBuf = (char *) toTranscode;
+
+ // perform conversion
+ wLent *= uChSize();
+ char *ptr = retVal;
+ size_t tmpwLent = wLent;
+ size_t rc = iconvTo(wideCharBuf, &tmpwLent, &ptr, neededLen);
+ if (rc == (size_t)-1) {
+ if (wBufPtr)
+ delete [] wBufPtr;
+ return 0;
+ }
+ if (wBufPtr)
+ delete [] wBufPtr;
+ retVal[neededLen] = 0;
+
+#endif /* !XML_USE_LIBICONV */
+
+ } else {
+ retVal = new char[1];
+ if (retVal == NULL)
+ return 0;
+ retVal[0] = 0;
+ }
+ return retVal;
+}
+
bool IconvFBSDLCPTranscoder::transcode( const XMLCh* const toTranscode
, char* const toFill
@@ -1228,6 +1323,92 @@
XMLCh* IconvFBSDLCPTranscoder::transcode(const char* const toTranscode)
+{
+ if (!toTranscode)
+ return 0;
+
+ XMLCh* retVal = 0;
+ if (*toTranscode) {
+ const unsigned int wLent = calcRequiredSize(toTranscode);
+ if (wLent == 0) {
+ retVal = new XMLCh[1];
+ retVal[0] = 0;
+ return retVal;
+ }
+
+#ifndef XML_USE_LIBICONV
+
+ wchar_t tmpWideCharArr[gTempBuffArraySize];
+ wchar_t* allocatedArray = 0;
+ wchar_t* wideCharBuf = 0;
+
+ if (wLent >= gTempBuffArraySize)
+ wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+ else
+ wideCharBuf = tmpWideCharArr;
+
+ fbsd_mbstowcs(wideCharBuf, toTranscode, wLent);
+ retVal = new XMLCh[wLent + 1];
+ if (retVal == NULL) {
+ if (allocatedArray)
+ delete [] allocatedArray;
+ return NULL;
+ }
+ for (unsigned int i = 0; i < wLent; i++)
+ retVal[i] = (XMLCh) wideCharBuf[i];
+ retVal[wLent] = 0x00;
+ if (allocatedArray)
+ delete [] allocatedArray;
+
+#else /* XML_USE_LIBICONV */
+
+ char tmpWBuff[gTempBuffArraySize];
+ char *wideCharBuf = 0;
+ char *wBufPtr = 0;
+ size_t len = wLent * uChSize();
+
+ retVal = new XMLCh[wLent + 1];
+ if (retVal == NULL)
+ return NULL;
+ if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
+ if (len > gTempBuffArraySize) {
+ wBufPtr = new char[len];
+ if (wBufPtr == NULL)
+ return 0;
+ wideCharBuf = wBufPtr;
+ } else
+ wideCharBuf = tmpWBuff;
+ } else
+ wideCharBuf = (char *) retVal;
+
+ size_t flen = strlen(toTranscode);
+ char *ptr = wideCharBuf;
+ size_t rc = iconvFrom(toTranscode, &flen, &ptr, len);
+ if (rc == (size_t) -1) {
+ if (wBufPtr)
+ delete [] wBufPtr;
+ return NULL;
+ }
+ if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
+ mbsToXML (wideCharBuf, wLent, retVal, wLent);
+ if (wBufPtr)
+ delete [] wBufPtr;
+ retVal[wLent] = 0x00;
+
+#endif /* !XML_USE_LIBICONV */
+
+ }
+ else {
+ retVal = new XMLCh[1];
+ if (retVal == NULL )
+ return 0;
+ retVal[0] = 0;
+ }
+ return retVal;
+}
+
+XMLCh* IconvFBSDLCPTranscoder::transcode(const char* const toTranscode,
+ MemoryManager* const manager)
{
if (!toTranscode)
return 0;
1.8 +118 -0 xml-xerces/c/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
Index: IconvGNUTransService.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- IconvGNUTransService.cpp 15 May 2003 18:47:05 -0000 1.7
+++ IconvGNUTransService.cpp 16 May 2003 21:37:00 -0000 1.8
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.8 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.7 2003/05/15 18:47:05 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -860,6 +863,64 @@
return retVal;
}
+char* IconvGNULCPTranscoder::transcode(const XMLCh* const toTranscode,
+ MemoryManager* const manager)
+{
+ if (!toTranscode)
+ return 0;
+
+ char* retVal = 0;
+ if (*toTranscode) {
+ unsigned int wLent = getWideCharLength(toTranscode);
+
+ // Calc needed size.
+ const size_t neededLen = calcRequiredSize (toTranscode);
+ if (neededLen == 0)
+ return 0;
+ // allocate output buffer
+ retVal = new char[neededLen + 1];
+ if (retVal == NULL)
+ return 0;
+ // prepare the original
+ char tmpWBuff[gTempBuffArraySize];
+ char *wideCharBuf = 0;
+ char *wBufPtr = 0;
+ size_t len = wLent * uChSize();
+
+ if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
+ if (len > gTempBuffArraySize) {
+ wBufPtr = new char[len];
+ if (wBufPtr == NULL)
+ return 0;
+ wideCharBuf = wBufPtr;
+ } else
+ wideCharBuf = tmpWBuff;
+ xmlToMbs (toTranscode, wLent, wideCharBuf, wLent);
+ } else
+ wideCharBuf = (char *) toTranscode;
+
+ // perform conversion
+ wLent *= uChSize();
+ char *ptr = retVal;
+ size_t rc = iconvTo(wideCharBuf, (size_t *) &wLent, &ptr, neededLen);
+ if (rc == (size_t)-1) {
+ if (wBufPtr)
+ delete [] wBufPtr;
+ return 0;
+ }
+ if (wBufPtr)
+ delete [] wBufPtr;
+ retVal[neededLen] = 0;
+
+ } else {
+ retVal = new char[1];
+ if (retVal == NULL)
+ return 0;
+ retVal[0] = 0;
+ }
+ return retVal;
+}
+
bool IconvGNULCPTranscoder::transcode( const XMLCh* const toTranscode
, char* const toFill
@@ -916,6 +977,63 @@
XMLCh* IconvGNULCPTranscoder::transcode(const char* const toTranscode)
+{
+ if (!toTranscode)
+ return 0;
+
+ XMLCh* retVal = 0;
+ if (*toTranscode) {
+ const unsigned int wLent = calcRequiredSize(toTranscode);
+ if (wLent == 0) {
+ retVal = new XMLCh[1];
+ retVal[0] = 0;
+ return retVal;
+ }
+
+ char tmpWBuff[gTempBuffArraySize];
+ char *wideCharBuf = 0;
+ char *wBufPtr = 0;
+ size_t len = wLent * uChSize();
+
+ retVal = new XMLCh[wLent + 1];
+ if (retVal == NULL)
+ return NULL;
+ if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
+ if (len > gTempBuffArraySize) {
+ wBufPtr = new char[len];
+ if (wBufPtr == NULL)
+ return 0;
+ wideCharBuf = wBufPtr;
+ } else
+ wideCharBuf = tmpWBuff;
+ } else
+ wideCharBuf = (char *) retVal;
+
+ size_t flen = strlen(toTranscode);
+ char *ptr = wideCharBuf;
+ size_t rc = iconvFrom(toTranscode, &flen, &ptr, len);
+ if (rc == (size_t) -1) {
+ if (wBufPtr)
+ delete [] wBufPtr;
+ return NULL;
+ }
+ if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
+ mbsToXML (wideCharBuf, wLent, retVal, wLent);
+ if (wBufPtr)
+ delete [] wBufPtr;
+ retVal[wLent] = 0x00;
+ }
+ else {
+ retVal = new XMLCh[1];
+ if (retVal == NULL )
+ return 0;
+ retVal[0] = 0;
+ }
+ return retVal;
+}
+
+XMLCh* IconvGNULCPTranscoder::transcode(const char* const toTranscode,
+ MemoryManager* const manager)
{
if (!toTranscode)
return 0;
1.8 +42 -18 xml-xerces/c/src/xercesc/util/regx/RangeToken.cpp
Index: RangeToken.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/RangeToken.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RangeToken.cpp 15 May 2003 21:46:47 -0000 1.7
+++ RangeToken.cpp 16 May 2003 21:37:00 -0000 1.8
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.8 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.7 2003/05/15 21:46:47 knoaman
* Add missing include.
*
@@ -121,7 +124,9 @@
// ---------------------------------------------------------------------------
// RangeToken: Constructors and Destructors
// ---------------------------------------------------------------------------
-RangeToken::RangeToken(const unsigned short tokType) : Token(tokType)
+RangeToken::RangeToken(const unsigned short tokType,
+ MemoryManager* const manager)
+ : Token(tokType)
, fSorted(false)
, fCompacted(false)
, fNonMapIndex(0)
@@ -130,14 +135,15 @@
, fMap(0)
, fRanges(0)
, fCaseIToken(0)
+ , fMemoryManager(manager)
{
}
RangeToken::~RangeToken() {
- delete [] fMap;
- delete[] fRanges;
+ fMemoryManager->deallocate(fMap);//delete [] fMap;
+ fMemoryManager->deallocate(fRanges);//delete[] fRanges;
}
@@ -169,12 +175,12 @@
if (fRanges) {
if (fMap) {
- delete [] fMap;
+ fMemoryManager->deallocate(fMap);//delete [] fMap;
fMap = 0;
}
fElemCount = 0;
- delete [] fRanges;
+ fMemoryManager->deallocate(fRanges);//delete [] fRanges;
fRanges = 0;
}
@@ -204,7 +210,10 @@
if (fRanges == 0) {
- fRanges = new XMLInt32[fMaxCount];
+ fRanges = (XMLInt32*) fMemoryManager->allocate
+ (
+ fMaxCount * sizeof(XMLInt32)
+ );//new XMLInt32[fMaxCount];
fRanges[0] = val1;
fRanges[1] = val2;
fElemCount = 2;
@@ -327,7 +336,10 @@
if (fRanges == 0) {
fMaxCount = rangeTok->fMaxCount;
- fRanges = new XMLInt32[fMaxCount];
+ fRanges = (XMLInt32*) fMemoryManager->allocate
+ (
+ fMaxCount * sizeof(XMLInt32)
+ );//new XMLInt32[fMaxCount];
for (unsigned int index = 0; index < rangeTok->fElemCount; index++) {
fRanges[index] = rangeTok->fRanges[index];
}
@@ -338,7 +350,10 @@
unsigned int newMaxCount = (fElemCount + rangeTok->fElemCount >= fMaxCount)
? fMaxCount + rangeTok->fMaxCount : fMaxCount;
- XMLInt32* result = new XMLInt32[newMaxCount];
+ XMLInt32* result = (XMLInt32*) fMemoryManager->allocate
+ (
+ newMaxCount * sizeof(XMLInt32)
+ );//new XMLInt32[newMaxCount];
for (unsigned int i=0, j=0, k=0; i < fElemCount || j < rangeTok->fElemCount;) {
@@ -371,7 +386,7 @@
}
}
- delete [] fRanges;
+ fMemoryManager->deallocate(fRanges);//delete [] fRanges;
fElemCount += rangeTok->fElemCount;
fRanges = result;
fMaxCount = newMaxCount;
@@ -396,7 +411,10 @@
unsigned int newMax = (fElemCount + tok->fElemCount >= fMaxCount)
? fMaxCount + tok->fMaxCount : fMaxCount;
- XMLInt32* result = new XMLInt32[newMax];
+ XMLInt32* result = (XMLInt32*) fMemoryManager->allocate
+ (
+ newMax * sizeof(XMLInt32)
+ );//new XMLInt32[newMax];
unsigned int newElemCount = 0;
unsigned int srcCount = 0;
unsigned int subCount = 0;
@@ -441,7 +459,7 @@
subCount += 2;
}
else {
- delete [] result;
+ fMemoryManager->deallocate(result);//delete [] result;
ThrowXML(RuntimeException, XMLExcepts::Regex_SubtractRangesError);
}
} //end while
@@ -452,7 +470,7 @@
result[newElemCount++] = fRanges[srcCount++];
}
- delete [] fRanges;
+ fMemoryManager->deallocate(fRanges);//delete [] fRanges;
fRanges = result;
fElemCount = newElemCount;
fMaxCount = newMax;
@@ -474,7 +492,10 @@
unsigned int newMax = (fElemCount + tok->fElemCount >= fMaxCount)
? fMaxCount + tok->fMaxCount : fMaxCount;
- XMLInt32* result = new XMLInt32[newMax];
+ XMLInt32* result = (XMLInt32*) fMemoryManager->allocate
+ (
+ newMax * sizeof(XMLInt32)
+ );//new XMLInt32[newMax];
unsigned int newElemCount = 0;
unsigned int srcCount = 0;
unsigned int tokCount = 0;
@@ -534,12 +555,12 @@
}
else {
- delete [] result;
+ fMemoryManager->deallocate(result);//delete [] result;
ThrowXML(RuntimeException, XMLExcepts::Regex_IntersectRangesError);
}
} //end while
- delete [] fRanges;
+ fMemoryManager->deallocate(fRanges);//delete [] fRanges;
fRanges = result;
fElemCount = newElemCount;
fMaxCount = newMax;
@@ -631,11 +652,14 @@
if (newMax < minNewMax)
newMax = minNewMax;
- XMLInt32* newList = new XMLInt32[newMax];
+ XMLInt32* newList = (XMLInt32*) fMemoryManager->allocate
+ (
+ newMax * sizeof(XMLInt32)
+ );//new XMLInt32[newMax];
for (unsigned int index = 0; index < fElemCount; index++)
newList[index] = fRanges[index];
- delete [] fRanges;
+ fMemoryManager->deallocate(fRanges);//delete [] fRanges;
fRanges = newList;
fMaxCount = newMax;
}
@@ -643,7 +667,7 @@
void RangeToken::createMap() {
int asize = MAPSIZE/32;
- fMap = new int[asize];
+ fMap = (int*) fMemoryManager->allocate(asize * sizeof(int));//new int[asize];
fNonMapIndex = fElemCount;
for (int i = 0; i < asize; i++) {
1.5 +4 -2 xml-xerces/c/src/xercesc/util/regx/RangeToken.hpp
Index: RangeToken.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/RangeToken.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RangeToken.hpp 7 Mar 2003 18:13:58 -0000 1.4
+++ RangeToken.hpp 16 May 2003 21:37:00 -0000 1.5
@@ -79,7 +79,8 @@
// -----------------------------------------------------------------------
// Public Constructors and Destructor
// -----------------------------------------------------------------------
- RangeToken(const unsigned short tokType);
+ RangeToken(const unsigned short tokType,
+ MemoryManager* const manager);
~RangeToken();
// -----------------------------------------------------------------------
@@ -139,6 +140,7 @@
int* fMap;
XMLInt32* fRanges;
RangeToken* fCaseIToken;
+ MemoryManager* fMemoryManager;
};
XERCES_CPP_NAMESPACE_END
1.11 +5 -2 xml-xerces/c/src/xercesc/util/regx/RegularExpression.cpp
Index: RegularExpression.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/RegularExpression.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- RegularExpression.cpp 16 May 2003 06:01:57 -0000 1.10
+++ RegularExpression.cpp 16 May 2003 21:37:00 -0000 1.11
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.11 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.10 2003/05/16 06:01:57 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -874,7 +877,7 @@
RefArrayVectorOf<XMLCh>* tokenStack = tokenize(matchString, start, end, subEx);
Janitor<RefArrayVectorOf<XMLCh> > janTokStack(tokenStack);
- XMLBuffer result;
+ XMLBuffer result(1023, fMemoryManager);
int numSubEx = 0;
@@ -1487,7 +1490,7 @@
bool notEscaped = true;
- XMLBuffer newString;
+ XMLBuffer newString(1023, fMemoryManager);
XMLCh indexStr[2]; //holds the string rep of a
1.5 +3 -3 xml-xerces/c/src/xercesc/util/regx/StringToken.hpp
Index: StringToken.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/StringToken.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StringToken.hpp 16 May 2003 00:03:10 -0000 1.4
+++ StringToken.hpp 16 May 2003 21:37:00 -0000 1.5
@@ -123,8 +123,8 @@
// ---------------------------------------------------------------------------
inline void StringToken::setString(const XMLCh* const literal) {
- delete [] fString;
- fString = XMLString::replicate(literal);
+ fMemoryManager->deallocate(fString);//delete [] fString;
+ fString = XMLString::replicate(literal, fMemoryManager);
}
XERCES_CPP_NAMESPACE_END
1.7 +5 -2 xml-xerces/c/src/xercesc/util/regx/TokenFactory.cpp
Index: TokenFactory.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/TokenFactory.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TokenFactory.cpp 16 May 2003 00:03:10 -0000 1.6
+++ TokenFactory.cpp 16 May 2003 21:37:00 -0000 1.7
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.7 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.6 2003/05/16 00:03:10 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -218,8 +221,8 @@
RangeToken* TokenFactory::createRange(const bool isNegRange){
- RangeToken* tmpTok = isNegRange ? new (fMemoryManager) RangeToken(Token::T_NRANGE)
- : new (fMemoryManager) RangeToken(Token::T_RANGE);
+ RangeToken* tmpTok = isNegRange ? new (fMemoryManager) RangeToken(Token::T_NRANGE, fMemoryManager)
+ : new (fMemoryManager) RangeToken(Token::T_RANGE, fMemoryManager);
fTokens->addElement(tmpTok);
return tmpTok;
1.7 +7 -1 xml-xerces/c/src/xercesc/util/regx/TokenFactory.hpp
Index: TokenFactory.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/TokenFactory.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TokenFactory.hpp 16 May 2003 00:03:10 -0000 1.6
+++ TokenFactory.hpp 16 May 2003 21:37:00 -0000 1.7
@@ -136,6 +136,7 @@
Token* getDot();
Token* getCombiningCharacterSequence();
Token* getGraphemePattern();
+ MemoryManager* getMemoryManager() const;
private:
// -----------------------------------------------------------------------
@@ -183,6 +184,11 @@
Token* fGrapheme;
MemoryManager* fMemoryManager;
};
+
+inline MemoryManager* TokenFactory::getMemoryManager() const
+{
+ return fMemoryManager;
+}
XERCES_CPP_NAMESPACE_END
1.5 +5 -2 xml-xerces/c/src/xercesc/util/regx/UnionToken.cpp
Index: UnionToken.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/regx/UnionToken.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- UnionToken.cpp 16 May 2003 00:03:10 -0000 1.4
+++ UnionToken.cpp 16 May 2003 21:37:00 -0000 1.5
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.5 2003/05/16 21:37:00 knoaman
+ * Memory manager implementation: Modify constructors to pass in the memory manager.
+ *
* Revision 1.4 2003/05/16 00:03:10 knoaman
* Partial implementation of the configurable memory manager.
*
@@ -135,7 +138,7 @@
return;
if (fChildren == 0)
- fChildren = new RefVectorOf<Token>(INITIALSIZE, false);
+ fChildren = new (tokFactory->getMemoryManager()) RefVectorOf<Token>(INITIALSIZE, false);
if (getTokenType() == T_UNION) {
@@ -174,7 +177,7 @@
}
// Continue
- XMLBuffer stringBuf;
+ XMLBuffer stringBuf(1023, tokFactory->getMemoryManager());
if (previousType == T_CHAR) {
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org