22 #if !defined(XERCESC_INCLUDE_GUARD_PLATFORMUTILS_HPP)
23 #define XERCESC_INCLUDE_GUARD_PLATFORMUTILS_HPP
25 #include <xercesc/util/XercesDefs.hpp>
26 #include <xercesc/util/XMLException.hpp>
27 #include <xercesc/util/PanicHandler.hpp>
29 #include <xercesc/util/XMLFileMgr.hpp>
30 #include <xercesc/util/XMLMutexMgr.hpp>
32 XERCES_CPP_NAMESPACE_BEGIN
36 class XMLTransService;
101 static XMLTransService* fgTransService2;
173 static void Initialize(
const char*
const locale = XMLUni::fgXercescDefaultLocale
174 ,
const char*
const nlsHome = 0
175 , PanicHandler*
const panicHandler = 0
227 static void Initialize(XMLSize_t initialDOMHeapAllocSize
228 , XMLSize_t maxDOMHeapAllocSize
229 , XMLSize_t maxDOMSubAllocationSize
230 ,
const char*
const locale = XMLUni::fgXercescDefaultLocale
231 ,
const char*
const nlsHome = 0
232 , PanicHandler*
const panicHandler = 0
241 static void Terminate();
261 const PanicHandler::PanicReasons reason
273 static XMLFileMgr* makeFileMgr(
MemoryManager*
const manager);
288 static XMLFilePos curFilePos(FileHandle theFile
289 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
301 static void closeFile(FileHandle theFile
302 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
314 static XMLFilePos fileSize(FileHandle theFile
315 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
327 static FileHandle openFile(
const char*
const fileName
328 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
340 static FileHandle openFile(
const XMLCh*
const fileName
341 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
353 static FileHandle openFileToWrite(
const char*
const fileName
354 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
366 static FileHandle openFileToWrite(
const XMLCh*
const fileName
367 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
379 static FileHandle openStdInHandle(
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
397 static XMLSize_t readFileBuffer
400 ,
const XMLSize_t toRead
401 , XMLByte*
const toFill
402 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager
419 static void writeBufferToFile
421 FileHandle
const theFile
423 ,
const XMLByte*
const toFlush
424 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager
436 static void resetFile(FileHandle theFile
437 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
465 static XMLCh* getFullPath
467 const XMLCh*
const srcPath
468 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager
484 static XMLCh* getCurrentDirectory
486 MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager
498 static inline bool isAnySlash(XMLCh c);
509 static void removeDotSlash(XMLCh*
const srcPath
510 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
522 static void removeDotDotSlash(XMLCh*
const srcPath
523 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
538 static bool isRelative(
const XMLCh*
const toCheck
539 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager
561 static XMLCh* weavePaths
563 const XMLCh*
const basePath
564 ,
const XMLCh*
const relativePath
565 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager
581 static unsigned long getCurrentMillis();
594 static XMLMutexMgr* makeMutexMgr(
MemoryManager*
const manager);
604 static void closeMutex(
void*
const mtxHandle,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
613 static void lockMutex(
void*
const mtxHandle);
624 static void* makeMutex(
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
638 static void unlockMutex(
void*
const mtxHandle);
653 static XMLMsgLoader* loadMsgSet(
const XMLCh*
const msgDomain);
671 static void recognizeNEL(
bool state
672 ,
MemoryManager*
const manager = XMLPlatformUtils::fgMemoryManager);
677 static bool isNELRecognized();
691 static void strictIANAEncoding(
const bool state);
697 static bool isStrictIANAEncoding();
707 static inline XMLSize_t alignPointerForNewBlockAllocation(XMLSize_t ptrSize);
723 static XMLMsgLoader* loadAMsgSet(
const XMLCh*
const msgDomain);
734 static XMLNetAccessor* makeNetAccessor();
746 static XMLTransService* makeTransService();
755 static int searchSlashDotDotSlash(XMLCh*
const srcPath);
768 static bool fgMemMgrAdopted;
774 MakeXMLException(XMLPlatformUtilsException, XMLUTIL_EXPORT)
806 #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT
807 const XMLSize_t alignment = XML_PLATFORM_NEW_BLOCK_ALIGNMENT;
809 const XMLSize_t alignment = (
sizeof(
void*) >=
sizeof(
double)) ?
sizeof(
void*) :
sizeof(double);
813 XMLSize_t current = ptrSize % alignment;
816 return (current == 0)
818 : (ptrSize + alignment - current);
826 inline XMLDeleter::~XMLDeleter()
833 inline XMLDeleter::XMLDeleter()
837 XERCES_CPP_NAMESPACE_END
Configurable memory manager.
Definition: MemoryManager.hpp:39
Definition: PlatformUtils.hpp:46