knoaman 2003/08/13 08:43:24 Modified: c/src/xercesc/dom/deprecated DOMParser.cpp c/src/xercesc/parsers SAX2XMLReaderImpl.cpp SAXParser.cpp XercesDOMParser.cpp c/src/xercesc/sax SAXException.cpp SAXException.hpp SAXParseException.cpp SAXParseException.hpp Log: Use memory manager when creating SAX exceptions. Revision Changes Path 1.24 +2 -1 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.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- DOMParser.cpp 31 Jul 2003 17:01:20 -0000 1.23 +++ DOMParser.cpp 13 Aug 2003 15:43:24 -0000 1.24 @@ -552,6 +552,7 @@ , systemId , lineNum , colNum + , fMemoryManager ); // 1.26 +10 -6 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.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- SAX2XMLReaderImpl.cpp 31 Jul 2003 17:05:48 -0000 1.25 +++ SAX2XMLReaderImpl.cpp 13 Aug 2003 15:43:24 -0000 1.26 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.26 2003/08/13 15:43:24 knoaman + * Use memory manager when creating SAX exceptions. + * * Revision 1.25 2003/07/31 17:05:48 peiyongz * using getGrammar(URI) * @@ -1404,6 +1407,7 @@ , systemId , lineNum , colNum + , fMemoryManager ); if (!fErrorHandler) @@ -1431,7 +1435,7 @@ { if (fParseInProgress) - throw SAXNotSupportedException("Feature modification is not supported during parse."); + throw SAXNotSupportedException("Feature modification is not supported during parse.", fMemoryManager); if (XMLString::compareIString(name, XMLUni::fgSAX2CoreNameSpaces) == 0) { @@ -1505,7 +1509,7 @@ fScanner->setStandardUriConformant(value); } else - throw SAXNotRecognizedException("Unknown Feature"); + throw SAXNotRecognizedException("Unknown Feature", fMemoryManager); } bool SAX2XMLReaderImpl::getFeature(const XMLCh* const name) const @@ -1537,7 +1541,7 @@ else if (XMLString::compareIString(name, XMLUni::fgXercesStandardUriConformant) == 0) return fScanner->getStandardUriConformant(); else - throw SAXNotRecognizedException("Unknown Feature"); + throw SAXNotRecognizedException("Unknown Feature", fMemoryManager); return false; } @@ -1545,7 +1549,7 @@ void SAX2XMLReaderImpl::setProperty(const XMLCh* const name, void* value) { if (fParseInProgress) - throw SAXNotSupportedException("Property modification is not supported during parse."); + throw SAXNotSupportedException("Property modification is not supported during parse.", fMemoryManager); if (XMLString::compareIString(name, XMLUni::fgXercesSchemaExternalSchemaLocation) == 0) { @@ -1578,7 +1582,7 @@ } } else - throw SAXNotRecognizedException("Unknown Property"); + throw SAXNotRecognizedException("Unknown Property", fMemoryManager); } @@ -1593,7 +1597,7 @@ else if (XMLString::equals(name, XMLUni::fgXercesScannerName)) return (void*)fScanner->getName(); else - throw SAXNotRecognizedException("Unknown Property"); + throw SAXNotRecognizedException("Unknown Property", fMemoryManager); return 0; } 1.24 +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.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- SAXParser.cpp 31 Jul 2003 17:05:48 -0000 1.23 +++ SAXParser.cpp 13 Aug 2003 15:43:24 -0000 1.24 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.24 2003/08/13 15:43:24 knoaman + * Use memory manager when creating SAX exceptions. + * * Revision 1.23 2003/07/31 17:05:48 peiyongz * using getGrammar(URI) * @@ -1276,6 +1279,7 @@ , systemId , lineNum , colNum + , fMemoryManager ); if (!fErrorHandler) 1.16 +2 -1 xml-xerces/c/src/xercesc/parsers/XercesDOMParser.cpp Index: XercesDOMParser.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/parsers/XercesDOMParser.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- XercesDOMParser.cpp 31 Jul 2003 17:05:48 -0000 1.15 +++ XercesDOMParser.cpp 13 Aug 2003 15:43:24 -0000 1.16 @@ -206,6 +206,7 @@ , systemId , lineNum , colNum + , getMemoryManager() ); // 1.3 +19 -12 xml-xerces/c/src/xercesc/sax/SAXException.cpp Index: SAXException.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/SAXException.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SAXException.cpp 4 Nov 2002 14:56:26 -0000 1.2 +++ SAXException.cpp 13 Aug 2003 15:43:24 -0000 1.3 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.3 2003/08/13 15:43:24 knoaman + * Use memory manager when creating SAX exceptions. + * * Revision 1.2 2002/11/04 14:56:26 tng * C++ Namespace Support. * @@ -76,18 +79,20 @@ // SAXNotSupportedException Constructors -SAXNotSupportedException::SAXNotSupportedException() - : SAXException() +SAXNotSupportedException::SAXNotSupportedException(MemoryManager* const manager) + : SAXException(manager) { } -SAXNotSupportedException::SAXNotSupportedException(const XMLCh* const msg) - : SAXException(msg) +SAXNotSupportedException::SAXNotSupportedException(const XMLCh* const msg, + MemoryManager* const manager) + : SAXException(msg, manager) { } -SAXNotSupportedException::SAXNotSupportedException(const char* const msg) - : SAXException(msg) +SAXNotSupportedException::SAXNotSupportedException(const char* const msg, + MemoryManager* const manager) + : SAXException(msg, manager) { } @@ -97,18 +102,20 @@ } // SAXNotRecognizedException Constructors -SAXNotRecognizedException::SAXNotRecognizedException() - : SAXException() +SAXNotRecognizedException::SAXNotRecognizedException(MemoryManager* const manager) + : SAXException(manager) { } -SAXNotRecognizedException::SAXNotRecognizedException(const XMLCh* const msg) - : SAXException(msg) +SAXNotRecognizedException::SAXNotRecognizedException(const XMLCh* const msg, + MemoryManager* const manager) + : SAXException(msg, manager) { } -SAXNotRecognizedException::SAXNotRecognizedException(const char* const msg) - : SAXException(msg) +SAXNotRecognizedException::SAXNotRecognizedException(const char* const msg, + MemoryManager* const manager) + : SAXException(msg, manager) { } 1.5 +31 -16 xml-xerces/c/src/xercesc/sax/SAXException.hpp Index: SAXException.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/SAXException.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SAXException.hpp 15 May 2003 18:27:05 -0000 1.4 +++ SAXException.hpp 13 Aug 2003 15:43:24 -0000 1.5 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.5 2003/08/13 15:43:24 knoaman + * Use memory manager when creating SAX exceptions. + * * Revision 1.4 2003/05/15 18:27:05 knoaman * Partial implementation of the configurable memory manager. * @@ -138,9 +141,10 @@ //@{ /** Default constructor */ - SAXException() : + SAXException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : - fMsg(XMLString::replicate(XMLUni::fgZeroLenString)) + fMsg(XMLString::replicate(XMLUni::fgZeroLenString, manager)) + , fMemoryManager(manager) { } @@ -149,9 +153,11 @@ * * @param msg The error or warning message. */ - SAXException(const XMLCh* const msg) : + SAXException(const XMLCh* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : - fMsg(XMLString::replicate(msg)) + fMsg(XMLString::replicate(msg, manager)) + , fMemoryManager(manager) { } @@ -160,9 +166,11 @@ * * @param msg The error or warning message. */ - SAXException(const char* const msg) : + SAXException(const char* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) : - fMsg(XMLString::transcode(msg)) + fMsg(XMLString::transcode(msg, manager)) + , fMemoryManager(manager) { } @@ -173,14 +181,15 @@ */ SAXException(const SAXException& toCopy) : - fMsg(XMLString::replicate(toCopy.fMsg)) + fMsg(XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager)) + , fMemoryManager(toCopy.fMemoryManager) { } /** Destructor */ virtual ~SAXException() { - delete [] fMsg; + fMemoryManager->deallocate(fMsg);//delete [] fMsg; } //@} @@ -198,8 +207,9 @@ if (this == &toCopy) return *this; - delete [] fMsg; - fMsg = XMLString::replicate(toCopy.fMsg); + fMemoryManager->deallocate(fMsg);//delete [] fMsg; + fMsg = XMLString::replicate(toCopy.fMsg, toCopy.fMemoryManager); + fMemoryManager = toCopy.fMemoryManager; return *this; } //@} @@ -225,27 +235,30 @@ // This is the text of the error that is being thrown. // ----------------------------------------------------------------------- XMLCh* fMsg; + MemoryManager* fMemoryManager; }; class SAX_EXPORT SAXNotSupportedException : public SAXException { public: - SAXNotSupportedException(); + SAXNotSupportedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. */ - SAXNotSupportedException(const XMLCh* const msg); + SAXNotSupportedException(const XMLCh* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. */ - SAXNotSupportedException(const char* const msg); + SAXNotSupportedException(const char* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor @@ -258,21 +271,23 @@ class SAX_EXPORT SAXNotRecognizedException : public SAXException { public: - SAXNotRecognizedException(); + SAXNotRecognizedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. */ - SAXNotRecognizedException(const XMLCh* const msg); + SAXNotRecognizedException(const XMLCh* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Create a new SAXException. * * @param msg The error or warning message. */ - SAXNotRecognizedException(const char* const msg); + SAXNotRecognizedException(const char* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** * Copy constructor 1.5 +22 -16 xml-xerces/c/src/xercesc/sax/SAXParseException.cpp Index: SAXParseException.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/SAXParseException.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SAXParseException.cpp 21 Apr 2003 21:07:38 -0000 1.4 +++ SAXParseException.cpp 13 Aug 2003 15:43:24 -0000 1.5 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.5 2003/08/13 15:43:24 knoaman + * Use memory manager when creating SAX exceptions. + * * Revision 1.4 2003/04/21 21:07:38 knoaman * Use XMLString::release to prepare for configurable memory manager. * @@ -102,12 +105,13 @@ // SAXParseException: Constructors and Destructor // --------------------------------------------------------------------------- SAXParseException::SAXParseException(const XMLCh* const message - , const Locator& locator) : - SAXException(message) + , const Locator& locator + , MemoryManager* const manager) : + SAXException(message, manager) , fColumnNumber(locator.getColumnNumber()) , fLineNumber(locator.getLineNumber()) - , fPublicId(XMLString::replicate(locator.getPublicId())) - , fSystemId(XMLString::replicate(locator.getSystemId())) + , fPublicId(XMLString::replicate(locator.getPublicId(), manager)) + , fSystemId(XMLString::replicate(locator.getSystemId(), manager)) { } @@ -115,12 +119,13 @@ , const XMLCh* const publicId , const XMLCh* const systemId , const XMLSSize_t lineNumber - , const XMLSSize_t columnNumber) : - SAXException(message) + , const XMLSSize_t columnNumber + , MemoryManager* const manager) : + SAXException(message, manager) , fColumnNumber(columnNumber) , fLineNumber(lineNumber) - , fPublicId(XMLString::replicate(publicId)) - , fSystemId(XMLString::replicate(systemId)) + , fPublicId(XMLString::replicate(publicId, manager)) + , fSystemId(XMLString::replicate(systemId, manager)) { } @@ -132,14 +137,14 @@ , fPublicId(0) , fSystemId(0) { - fPublicId = XMLString::replicate(toCopy.fPublicId); - fSystemId = XMLString::replicate(toCopy.fSystemId); + fPublicId = XMLString::replicate(toCopy.fPublicId, toCopy.fMemoryManager); + fSystemId = XMLString::replicate(toCopy.fSystemId, toCopy.fMemoryManager); } SAXParseException::~SAXParseException() { - XMLString::release(&fPublicId); - XMLString::release(&fSystemId); + fMemoryManager->deallocate(fPublicId);//XMLString::release(&fPublicId); + fMemoryManager->deallocate(fSystemId);//XMLString::release(&fSystemId); } @@ -152,14 +157,15 @@ if (this == &toAssign) return *this; + fMemoryManager->deallocate(fPublicId);//XMLString::release(&fPublicId); + fMemoryManager->deallocate(fSystemId);//XMLString::release(&fSystemId); + this->SAXException::operator =(toAssign); fColumnNumber = toAssign.fColumnNumber; fLineNumber = toAssign.fLineNumber; - XMLString::release(&fPublicId); - XMLString::release(&fSystemId); - fPublicId = XMLString::replicate(toAssign.fPublicId); - fSystemId = XMLString::replicate(toAssign.fSystemId); + fPublicId = XMLString::replicate(toAssign.fPublicId, fMemoryManager); + fSystemId = XMLString::replicate(toAssign.fSystemId, fMemoryManager); return *this; } 1.5 +6 -1 xml-xerces/c/src/xercesc/sax/SAXParseException.hpp Index: SAXParseException.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/sax/SAXParseException.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SAXParseException.hpp 15 May 2003 18:27:05 -0000 1.4 +++ SAXParseException.hpp 13 Aug 2003 15:43:24 -0000 1.5 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.5 2003/08/13 15:43:24 knoaman + * Use memory manager when creating SAX exceptions. + * * Revision 1.4 2003/05/15 18:27:05 knoaman * Partial implementation of the configurable memory manager. * @@ -132,7 +135,8 @@ * @see Locator#Locator * @see Parser#setLocale */ - SAXParseException(const XMLCh* const message, const Locator& locator); + SAXParseException(const XMLCh* const message, const Locator& locator, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); /** @@ -161,6 +165,7 @@ , const XMLCh* const systemId , const XMLSSize_t lineNumber , const XMLSSize_t columnNumber + , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /**
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]