|
|
static void | Initialize (const char *const locale=XMLUni::fgXercescDefaultLocale, const char *const nlsHome=0, PanicHandler *const panicHandler=0, MemoryManager *const memoryManager=0) |
| Perform per-process parser initialization.
|
|
static void | Initialize (XMLSize_t initialDOMHeapAllocSize, XMLSize_t maxDOMHeapAllocSize, XMLSize_t maxDOMSubAllocationSize, const char *const locale=XMLUni::fgXercescDefaultLocale, const char *const nlsHome=0, PanicHandler *const panicHandler=0, MemoryManager *const memoryManager=0) |
| Perform per-process parser initialization.
|
|
static void | Terminate () |
| Perform per-process parser termination.
|
|
static void | panic (const PanicHandler::PanicReasons reason) |
| The panic mechanism.
|
|
|
static XMLFileMgr * | makeFileMgr (MemoryManager *const manager) |
| Make a new file object appropriate for the platform.
|
|
static XMLFilePos | curFilePos (FileHandle theFile, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Get the current file position.
|
|
static void | closeFile (FileHandle theFile, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Closes the file handle.
|
|
static XMLFilePos | fileSize (FileHandle theFile, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Returns the file size.
|
|
static FileHandle | openFile (const char *const fileName, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Opens the file.
|
|
static FileHandle | openFile (const XMLCh *const fileName, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Opens a named file.
|
|
static FileHandle | openFileToWrite (const char *const fileName, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Open a named file to write.
|
|
static FileHandle | openFileToWrite (const XMLCh *const fileName, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Open a named file to write.
|
|
static FileHandle | openStdInHandle (MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Opens the standard input as a file.
|
|
static XMLSize_t | readFileBuffer (FileHandle theFile, const XMLSize_t toRead, XMLByte *const toFill, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Reads the file buffer.
|
|
static void | writeBufferToFile (FileHandle const theFile, XMLSize_t toWrite, const XMLByte *const toFlush, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Writes the buffer to the file.
|
|
static void | resetFile (FileHandle theFile, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Resets the file handle.
|
|
|
static XMLCh * | getFullPath (const XMLCh *const srcPath, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Gets the full path from a relative path.
|
|
static XMLCh * | getCurrentDirectory (MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Gets the current working directory.
|
|
static bool | isAnySlash (XMLCh c) |
| Check if a character is a slash.
|
|
static void | removeDotSlash (XMLCh *const srcPath, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Remove occurrences of the pair of dot slash.
|
|
static void | removeDotDotSlash (XMLCh *const srcPath, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Remove occurrences of the dot dot slash.
|
|
static bool | isRelative (const XMLCh *const toCheck, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Determines if a path is relative or absolute.
|
|
static XMLCh * | weavePaths (const XMLCh *const basePath, const XMLCh *const relativePath, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Utility to join two paths.
|
|
|
static unsigned long | getCurrentMillis () |
| Gets the system time in milliseconds.
|
|
|
static XMLMutexMgr * | makeMutexMgr (MemoryManager *const manager) |
| Factory method for creating MutexMgr object.
|
|
static void | closeMutex (void *const mtxHandle, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Closes a mutex handle.
|
|
static void | lockMutex (void *const mtxHandle) |
| Locks a mutex handle.
|
|
static void * | makeMutex (MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| Make a new mutex.
|
|
static void | unlockMutex (void *const mtxHandle) |
| Unlocks a mutex.
|
|
|
static XMLMsgLoader * | loadMsgSet (const XMLCh *const msgDomain) |
| Loads the message set from among the available domains.
|
|
|
static void | recognizeNEL (bool state, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) |
| This function enables the recognition of NEL(0x85) char and LSEP (0x2028) as newline chars which is disabled by default.
|
|
static bool | isNELRecognized () |
| Return the value of fgNEL flag.
|
|
Utilities that must be implemented in a platform-specific way.
This class contains methods that must be implemented in a platform specific manner. The actual implementations of these methods are available in the per-platform files inside src/util/Platforms
.
Get the current file position.
This must be implemented by the per-platform driver, which should use local file services to determine the current position within the passed file.
Since the file API provided here only reads, if the host platform supports separate read/write positions, only the read position is of any interest, and hence should be the one returned.
- Parameters
-
theFile | The file handle |
manager | The MemoryManager to use to allocate objects |
Perform per-process parser initialization.
Initialization must be called first in any client code.
- Parameters
-
locale | The locale to use for messages. |
The locale is set iff the Initialize() is invoked for the very first time, to ensure that each and every message loader, in the process space, share the same locale.
All subsequent invocations of Initialize(), with a different locale, have no effect on the message loaders, either instantiated, or to be instantiated.
To set to a different locale, client application needs to Terminate() (or multiple Terminate() in the case where multiple Initialize() have been invoked before), followed by Initialize(new_locale).
The default locale is "en_US".
- Parameters
-
nlsHome | User specified location where MsgLoader retrieves error message files. the discussion above with regard to locale, applies to nlsHome as well. |
panicHandler | Application's panic handler, application owns this handler. Application shall make sure that the plugged panic handler persists through the call to XMLPlatformUtils::Terminate(). |
memoryManager | Plugged-in memory manager which is owned by the application. Applications must make sure that the plugged-in memory manager persist through the call to XMLPlatformUtils::Terminate() |
Perform per-process parser initialization.
Initialization must be called first in any client code.
- Parameters
-
initialDOMHeapAllocSize | The size of the first memory block allocated by the DOMDocument heap. Note that changing this parameter may result in poor performance and/or excessive memory usage. For the default value refer to dom/impl/DOMDocumentImpl.cpp. |
maxDOMHeapAllocSize | The maximum size of the memory block allocated by the DOMDocument heap. As the document grows, the allocated by the heap memory blocks grow from initialDOMHeapAllocSize to maxDOMHeapAllocSize. Note that changing this parameter may result in poor performance and/or excessive memory usage. For the default value refer to dom/impl/DOMDocumentImpl.cpp. |
maxDOMSubAllocationSize | The maximum size of the memory block requested that is handled by the DOMDocument heap. A request for a larger block is handled directly by the memory manager. Note that changing this parameter may result in poor performance and/or excessive memory usage. For the default value refer to dom/impl/DOMDocumentImpl.cpp. |
locale | The locale to use for messages. |
The locale is set iff the Initialize() is invoked for the very first time, to ensure that each and every message loader, in the process space, share the same locale.
All subsequent invocations of Initialize(), with a different locale, have no effect on the message loaders, either instantiated, or to be instantiated.
To set to a different locale, client application needs to Terminate() (or multiple Terminate() in the case where multiple Initialize() have been invoked before), followed by Initialize(new_locale).
The default locale is "en_US".
- Parameters
-
nlsHome | User specified location where MsgLoader retrieves error message files. the discussion above with regard to locale, applies to nlsHome as well. |
panicHandler | Application's panic handler, application owns this handler. Application shall make sure that the plugged panic handler persists through the call to XMLPlatformUtils::Terminate(). |
memoryManager | Plugged-in memory manager which is owned by the application. Applications must make sure that the plugged-in memory manager persist through the call to XMLPlatformUtils::Terminate() |
static void xercesc::XMLPlatformUtils::panic |
( |
const PanicHandler::PanicReasons | reason | ) |
|
|
static |
The panic mechanism.
If, during initialization, we cannot even get far enough along to get transcoding up or get message loading working, we call this method.
Each platform can implement it however they want. This method will delegate the panic handling to a user specified panic handler or in the absence of it, the default panic handler.
In case the default panic handler does not support a particular platform, the platform specific panic handling shall be implemented here
.
- Parameters
-
reason | The enumeration that defines the cause of the failure |
Utility to join two paths.
This must be implemented by the per-platform driver, and should weave the relative path part together with the base part and return a new path that represents this combination.
If the relative part turns out to be fully qualified, it will be returned as is. If it is not, then it will be woven onto the passed base path, by removing one path component for each leading "../" (or whatever is the equivalent in the local system) in the relative path.
- Parameters
-
basePath | The string containing the base path |
relativePath | The string containing the relative path |
manager | The MemoryManager to use to allocate objects |
- Returns
- Returns a string containing the 'woven' path. It should be dynamically allocated and becomes the responsibility of the caller to delete.
The network accessor.
This is provided by the per-platform driver, so each platform can choose what actual implementation it wants to use. The object must be dynamically allocated.
Note that you may optionally, if your platform driver does not install a network accessor, set it manually from your client code after calling Initialize(). This works because this object is not required during initialization, and only comes into play during actual XML parsing.