knoaman 2004/10/20 08:18:20 Modified: c/src/xercesc/dom/impl DOMImplementationImpl.cpp DOMImplementationImpl.hpp DOMImplementationRegistry.cpp DOMNodeImpl.cpp DOMNormalizer.cpp c/src/xercesc/framework XMLValidator.cpp c/src/xercesc/framework/psvi XSValue.cpp XSValue.hpp c/src/xercesc/internal XMLScanner.cpp Log: Allow option of initializing static data in XMLPlatformUtils::Initialize Revision Changes Path 1.27 +18 -1 xml-xerces/c/src/xercesc/dom/impl/DOMImplementationImpl.cpp Index: DOMImplementationImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMImplementationImpl.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- DOMImplementationImpl.cpp 8 Sep 2004 13:55:51 -0000 1.26 +++ DOMImplementationImpl.cpp 20 Oct 2004 15:18:20 -0000 1.27 @@ -27,6 +27,7 @@ #include <xercesc/dom/DOMDocumentType.hpp> #include <xercesc/dom/DOMException.hpp> #include <xercesc/util/PlatformUtils.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <xercesc/util/XMLUniDefs.hpp> #include <xercesc/util/XMLChar.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> @@ -117,6 +118,14 @@ return sMsgLoader4DOM; } +void XMLInitializer::initializeMsgLoader4DOM() +{ + sMsgLoader4DOM = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain); + if (sMsgLoader4DOM) { + msgLoader4DOMCleanup.registerCleanup(reinitMsgLoader4DOM); + } +} + // ----------------------------------------------------------------------- // Singleton DOMImplementationImpl // ----------------------------------------------------------------------- @@ -153,6 +162,14 @@ } return gDomimp; +} + +void XMLInitializer::initializeDOMImplementationImpl() +{ + gDomimp = new DOMImplementationImpl; + if (gDomimp) { + implementationCleanup.registerCleanup(reinitImplementation); + } } // ------------------------------------------------------------ 1.17 +2 -1 xml-xerces/c/src/xercesc/dom/impl/DOMImplementationImpl.hpp Index: DOMImplementationImpl.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMImplementationImpl.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- DOMImplementationImpl.hpp 8 Sep 2004 13:55:51 -0000 1.16 +++ DOMImplementationImpl.hpp 20 Oct 2004 15:18:20 -0000 1.17 @@ -44,6 +44,7 @@ private: DOMImplementationImpl(const DOMImplementationImpl &); DOMImplementationImpl & operator = (const DOMImplementationImpl &); + friend class XMLInitializer; protected: DOMImplementationImpl() {}; public: 1.8 +17 -1 xml-xerces/c/src/xercesc/dom/impl/DOMImplementationRegistry.cpp Index: DOMImplementationRegistry.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMImplementationRegistry.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DOMImplementationRegistry.cpp 8 Sep 2004 13:55:51 -0000 1.7 +++ DOMImplementationRegistry.cpp 20 Oct 2004 15:18:20 -0000 1.8 @@ -19,6 +19,7 @@ */ #include <xercesc/util/PlatformUtils.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <xercesc/util/RefVectorOf.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> #include <xercesc/dom/DOMImplementationRegistry.hpp> @@ -95,6 +96,21 @@ } return *gDOMImplSrcVectorMutex; +} + +void XMLInitializer::initializeDOMImplementationRegistry() +{ + // mutex + gDOMImplSrcVectorMutex = new XMLMutex; + if (gDOMImplSrcVectorMutex) { + cleanupDOMImplSrcVectorMutex.registerCleanup(reinitDOMImplSrcVectorMutex); + } + + // vector + gDOMImplSrcVector = new RefVectorOf<DOMImplementationSource>(3, false); + if (gDOMImplSrcVector) { + cleanupDOMImplSrcVector.registerCleanup(reinitDOMImplSrcVector); + } } 1.35 +10 -1 xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp Index: DOMNodeImpl.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- DOMNodeImpl.cpp 8 Sep 2004 13:55:52 -0000 1.34 +++ DOMNodeImpl.cpp 20 Oct 2004 15:18:20 -0000 1.35 @@ -35,6 +35,7 @@ #include <xercesc/util/XMLUniDefs.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> #include <xercesc/util/PlatformUtils.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <stdio.h> #include <assert.h> @@ -71,6 +72,14 @@ delete gEmptyNodeListMutex; gEmptyNodeListMutex = 0; +} + +void XMLInitializer::initializeEmptyNodeList() +{ + gEmptyNodeList = new DOMNodeListImpl(0); + if (gEmptyNodeList) { + emptyNodeListCleanup.registerCleanup(reinitEmptyNodeList); + } } // ----------------------------------------------------------------------- 1.11 +10 -0 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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- DOMNormalizer.cpp 8 Sep 2004 13:55:52 -0000 1.10 +++ DOMNormalizer.cpp 20 Oct 2004 15:18:20 -0000 1.11 @@ -23,6 +23,7 @@ #include <xercesc/util/Mutexes.hpp> #include <xercesc/util/PlatformUtils.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <xercesc/util/XMLMsgLoader.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> #include <xercesc/util/XMLString.hpp> @@ -114,6 +115,15 @@ return *gMsgLoader; } +void XMLInitializer::initializeDOMNormalizerMsgLoader() +{ + gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain); + + // Register this object to be cleaned up at termination + if (gMsgLoader) { + cleanupMsgLoader.registerCleanup(DOMNormalizer::reinitMsgLoader); + } +} DOMNormalizer::DOMNormalizer(MemoryManager* const manager) : fDocument(0) 1.9 +12 -0 xml-xerces/c/src/xercesc/framework/XMLValidator.cpp Index: XMLValidator.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/XMLValidator.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- XMLValidator.cpp 8 Sep 2004 13:55:59 -0000 1.8 +++ XMLValidator.cpp 20 Oct 2004 15:18:20 -0000 1.9 @@ -16,6 +16,9 @@ /** * $Log$ + * Revision 1.9 2004/10/20 15:18:20 knoaman + * Allow option of initializing static data in XMLPlatformUtils::Initialize + * * Revision 1.8 2004/09/08 13:55:59 peiyongz * Apache License Version 2.0 * @@ -100,6 +103,7 @@ #include <xercesc/framework/XMLValidator.hpp> #include <xercesc/util/Mutexes.hpp> #include <xercesc/util/PlatformUtils.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <xercesc/util/XMLMsgLoader.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> #include <xercesc/internal/XMLScanner.hpp> @@ -159,7 +163,15 @@ return *sMsgLoader; } +void XMLInitializer::initializeValidatorMsgLoader() +{ + sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain); + // Register this XMLMsgLoader for cleanup at Termination. + if (sMsgLoader) { + msgLoaderCleanup.registerCleanup(XMLValidator::reinitMsgLoader); + } +} // --------------------------------------------------------------------------- // XMLValidator: Error emitting methods 1.15 +80 -60 xml-xerces/c/src/xercesc/framework/psvi/XSValue.cpp Index: XSValue.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSValue.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- XSValue.cpp 13 Oct 2004 19:23:34 -0000 1.14 +++ XSValue.cpp 20 Oct 2004 15:18:20 -0000 1.15 @@ -16,6 +16,9 @@ /* * $Log$ + * Revision 1.15 2004/10/20 15:18:20 knoaman + * Allow option of initializing static data in XMLPlatformUtils::Initialize + * * Revision 1.14 2004/10/13 19:23:34 peiyongz * using ValueHashTableOf to reduce footprint * @@ -81,6 +84,7 @@ #include <xercesc/util/XMLChar.hpp> #include <xercesc/util/Janitor.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <xercesc/util/regx/RegularExpression.hpp> #include <xercesc/validators/schema/SchemaSymbols.hpp> @@ -194,11 +198,11 @@ { if (!sXSValueRegEx) { - // Lock the mutex - XMLMutexLock lockInit(&gXSValueMutex()); + // Lock the mutex + XMLMutexLock lockInit(&gXSValueMutex()); if (!sXSValueRegEx) - { + { try { sXSValueRegEx = new (XMLPlatformUtils::fgMemoryManager) RegularExpression( @@ -219,9 +223,18 @@ return sXSValueRegEx; } -XSValue::DataType XSValue::getDataType(const XMLCh* const dtString) +void XMLInitializer::initializeXSValueStatics() { + sXSValueRegEx = new RegularExpression(XMLUni::fgLangPattern, SchemaSymbols::fgRegEx_XOption); + if (sXSValueRegEx) { + XSValueRegExCleanup.registerCleanup(XSValue::reinitRegEx); + } + XSValue::initializeRegistry(); +} + +XSValue::DataType XSValue::getDataType(const XMLCh* const dtString) +{ if (!fDataTypeRegistry) { // Lock the mutex @@ -230,66 +243,73 @@ if (!fDataTypeRegistry) { try { - //using the XMLPlatformUtils::fgMemoryManager - fDataTypeRegistry = new ValueHashTableOf<XSValue::DataType>(47); - - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_STRING, XSValue::dt_string); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BOOLEAN, XSValue::dt_boolean); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DECIMAL, XSValue::dt_decimal); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_FLOAT, XSValue::dt_float); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DOUBLE, XSValue::dt_double); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DURATION, XSValue::dt_duration); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DATETIME, XSValue::dt_dateTime); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_TIME, XSValue::dt_time); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DATE, XSValue::dt_date); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_YEARMONTH, XSValue::dt_gYearMonth); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_YEAR, XSValue::dt_gYear); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_MONTHDAY, XSValue::dt_gMonthDay); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DAY, XSValue::dt_gDay); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_MONTH, XSValue::dt_gMonth); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_HEXBINARY, XSValue::dt_hexBinary); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BASE64BINARY, XSValue::dt_base64Binary); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_ANYURI, XSValue::dt_anyURI); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_QNAME, XSValue::dt_QName); - fDataTypeRegistry->put((void*) XMLUni::fgNotationString, XSValue::dt_NOTATION); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NORMALIZEDSTRING, XSValue::dt_normalizedString); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_TOKEN, XSValue::dt_token); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_LANGUAGE, XSValue::dt_language); - fDataTypeRegistry->put((void*) XMLUni::fgNmTokenString, XSValue::dt_NMTOKEN); - fDataTypeRegistry->put((void*) XMLUni::fgNmTokensString, XSValue::dt_NMTOKENS); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NAME, XSValue::dt_Name); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NCNAME, XSValue::dt_NCName); - fDataTypeRegistry->put((void*) XMLUni::fgIDString, XSValue::dt_ID); - fDataTypeRegistry->put((void*) XMLUni::fgIDRefString, XSValue::dt_IDREF); - fDataTypeRegistry->put((void*) XMLUni::fgIDRefsString, XSValue::dt_IDREFS); - fDataTypeRegistry->put((void*) XMLUni::fgEntityString, XSValue::dt_ENTITY); - fDataTypeRegistry->put((void*) XMLUni::fgEntitiesString, XSValue::dt_ENTITIES); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_INTEGER, XSValue::dt_integer); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NONPOSITIVEINTEGER, XSValue::dt_nonPositiveInteger); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NEGATIVEINTEGER, XSValue::dt_negativeInteger); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_LONG, XSValue::dt_long); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_INT, XSValue::dt_int); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_SHORT, XSValue::dt_short); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BYTE, XSValue::dt_byte); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NONNEGATIVEINTEGER, XSValue::dt_nonNegativeInteger); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_ULONG, XSValue::dt_unsignedLong); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_UINT, XSValue::dt_unsignedInt); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_USHORT, XSValue::dt_unsignedShort); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_UBYTE, XSValue::dt_unsignedByte); - fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_POSITIVEINTEGER, XSValue::dt_positiveInteger); - - + initializeRegistry(); } - catch (...) - { + catch (...) { return dt_MAXCOUNT; } - - XSValueRegistryCleanup.registerCleanup(XSValue::reinitRegistry); } } - - return fDataTypeRegistry->containsKey(dtString) ? fDataTypeRegistry->get(dtString) : dt_MAXCOUNT; + + if (fDataTypeRegistry->containsKey(dtString)) { + return fDataTypeRegistry->get(dtString); + } + + return dt_MAXCOUNT; +} + +void XSValue::initializeRegistry() +{ + //using the XMLPlatformUtils::fgMemoryManager + fDataTypeRegistry = new ValueHashTableOf<XSValue::DataType>(43); + + if (fDataTypeRegistry) { + XSValueRegistryCleanup.registerCleanup(XSValue::reinitRegistry); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_STRING, XSValue::dt_string); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BOOLEAN, XSValue::dt_boolean); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DECIMAL, XSValue::dt_decimal); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_FLOAT, XSValue::dt_float); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DOUBLE, XSValue::dt_double); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DURATION, XSValue::dt_duration); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DATETIME, XSValue::dt_dateTime); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_TIME, XSValue::dt_time); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DATE, XSValue::dt_date); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_YEARMONTH, XSValue::dt_gYearMonth); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_YEAR, XSValue::dt_gYear); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_MONTHDAY, XSValue::dt_gMonthDay); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_DAY, XSValue::dt_gDay); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_MONTH, XSValue::dt_gMonth); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_HEXBINARY, XSValue::dt_hexBinary); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BASE64BINARY, XSValue::dt_base64Binary); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_ANYURI, XSValue::dt_anyURI); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_QNAME, XSValue::dt_QName); + fDataTypeRegistry->put((void*) XMLUni::fgNotationString, XSValue::dt_NOTATION); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NORMALIZEDSTRING, XSValue::dt_normalizedString); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_TOKEN, XSValue::dt_token); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_LANGUAGE, XSValue::dt_language); + fDataTypeRegistry->put((void*) XMLUni::fgNmTokenString, XSValue::dt_NMTOKEN); + fDataTypeRegistry->put((void*) XMLUni::fgNmTokensString, XSValue::dt_NMTOKENS); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NAME, XSValue::dt_Name); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NCNAME, XSValue::dt_NCName); + fDataTypeRegistry->put((void*) XMLUni::fgIDString, XSValue::dt_ID); + fDataTypeRegistry->put((void*) XMLUni::fgIDRefString, XSValue::dt_IDREF); + fDataTypeRegistry->put((void*) XMLUni::fgIDRefsString, XSValue::dt_IDREFS); + fDataTypeRegistry->put((void*) XMLUni::fgEntityString, XSValue::dt_ENTITY); + fDataTypeRegistry->put((void*) XMLUni::fgEntitiesString, XSValue::dt_ENTITIES); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_INTEGER, XSValue::dt_integer); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NONPOSITIVEINTEGER, XSValue::dt_nonPositiveInteger); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NEGATIVEINTEGER, XSValue::dt_negativeInteger); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_LONG, XSValue::dt_long); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_INT, XSValue::dt_int); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_SHORT, XSValue::dt_short); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_BYTE, XSValue::dt_byte); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_NONNEGATIVEINTEGER, XSValue::dt_nonNegativeInteger); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_ULONG, XSValue::dt_unsignedLong); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_UINT, XSValue::dt_unsignedInt); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_USHORT, XSValue::dt_unsignedShort); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_UBYTE, XSValue::dt_unsignedByte); + fDataTypeRegistry->put((void*) SchemaSymbols::fgDT_POSITIVEINTEGER, XSValue::dt_positiveInteger); + } } inline 1.14 +10 -1 xml-xerces/c/src/xercesc/framework/psvi/XSValue.hpp Index: XSValue.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSValue.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- XSValue.hpp 13 Oct 2004 19:23:34 -0000 1.13 +++ XSValue.hpp 20 Oct 2004 15:18:20 -0000 1.14 @@ -16,6 +16,9 @@ /* * $Log$ + * Revision 1.14 2004/10/20 15:18:20 knoaman + * Allow option of initializing static data in XMLPlatformUtils::Initialize + * * Revision 1.13 2004/10/13 19:23:34 peiyongz * using ValueHashTableOf to reduce footprint * @@ -424,6 +427,12 @@ ); static ValueHashTableOf<DataType>* fDataTypeRegistry; + + // ----------------------------------------------------------------------- + // static helper methods + // ----------------------------------------------------------------------- + static void initializeRegistry(); + friend class XMLInitializer; // ----------------------------------------------------------------------- // data members 1.74 +18 -1 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.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- XMLScanner.cpp 30 Sep 2004 15:20:14 -0000 1.73 +++ XMLScanner.cpp 20 Oct 2004 15:18:20 -0000 1.74 @@ -30,6 +30,7 @@ #include <xercesc/util/UnexpectedEOFException.hpp> #include <xercesc/util/XMLMsgLoader.hpp> #include <xercesc/util/XMLRegisterCleanup.hpp> +#include <xercesc/util/XMLInitializer.hpp> #include <xercesc/framework/LocalFileInputSource.hpp> #include <xercesc/framework/URLInputSource.hpp> #include <xercesc/framework/XMLDocumentHandler.hpp> @@ -115,6 +116,22 @@ } return *gMsgLoader; +} + +void XMLInitializer::initializeScannerMsgLoader() +{ + gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain); + + // Register this object to be cleaned up at termination + if (gMsgLoader) { + cleanupMsgLoader.registerCleanup(XMLScanner::reinitMsgLoader); + } + + sScannerMutex = new XMLMutex; + if (sScannerMutex) { + scannerMutexCleanup.registerCleanup(XMLScanner::reinitScannerMutex); + sRegistered = true; + } } // ---------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]