class XMLPlatformUtils

Utilities that must be implemented in a platform-specific way

Inheritance:



Documentation

Utilities that must be implemented in a platform-specific way.

This class contains functions that must be implemented in a platform-specific manner. This is just an abstract class. The concrete implementations of these functions are available in the per-platform files indide src/util/Platforms.

enum PanicReasons
Public types

Public static data

static XMLNetAccessor* fgNetAccessor
This is the network access implementation. This is provided by the per-platform driver, so each platform can choose what actual implementation it wants to use.

static XMLTransService* fgTransService
This is the transcoding service. This is provided by the per platform driver, so each platform can choose what implemenation it wants to use.

static void Initialize()
Initialization method. This must be called first in any client code.

static void panic( const PanicReasons reason )
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.

Each platform can implement it however they want. This method is expected to display something meaningful and end the process. The enum indicates why its being called, to allow the per-platform code to display something more specific if desired.

Parameters:
reason - The enumeration that defines the cause of the failure

static unsigned int curFilePos(FileHandle theFile)
Get the current file position
Parameters:
theFile - The file handle

static void closeFile(FileHandle theFile)
Closes the file handle
Parameters:
theFile - The file handle

static unsigned int fileSize(FileHandle theFile)
Returns the file size
Returns:
Returns the size of the file in bytes
Parameters:
theFile - The file handle whose size you want

static FileHandle openFile(const char* const fileName)
Opens the file
Returns:
The file handle of the opened file
Parameters:
fileName - The string containing the name of the file

static FileHandle openFile(const XMLCh* const fileName)
Opens the file
Returns:
The file handle of the opened file
Parameters:
fileName - The string containing the name of the file

static FileHandle openStdInHandle()
Opens the standard input as a file
Returns:
The file handle of the standard input stream

static unsigned int readFileBuffer( FileHandle theFile, const unsigned int toRead, XMLByte* const toFill )
Reads the file buffer
Returns:
Returns the number of bytes read from the stream or file
Parameters:
theFile - The file handle that you want to read
toRead - The number of byte to read from the current position
toFill - The string buffer to fill

static void resetFile(FileHandle theFile)
Resets the file handle
Parameters:
theFile - The file handle that you want to reset

static XMLCh* getFullPath(const XMLCh* const srcPath)
Gets the full path from a relative path
Returns:
Returns the fully qualified path of the file name including the file name
Parameters:
srcPath - The path of the file for which you want the full path

static bool isRelative(const XMLCh* const toCheck)
Looks at a file name and tells if the path is specified relative to a directory, or absolute to the root
Returns:
Returns true if the filename appears to be relative
Parameters:
toCheck - The file name which you want to check

static XMLCh* weavePaths( const XMLCh* const basePath, const XMLCh* const relativePath )
Utility to join two paths
Returns:
Returns a string containing the 'woven' path
Parameters:
basePath - The string containing the base path
relativePath - The string containing the relative path

static unsigned long getCurrentMillis()
Gets the system time in milliseconds (for later comparison)
Returns:
Returns the system time as an unsigned long

static void closeMutex(void* const mtxHandle)
Closes a mutex handle
Parameters:
mtxHandle - The mutex handle that you want to close

static void lockMutex(void* const mtxHandle)
Locks a mutex handle
Parameters:
mtxHandle - The mutex handle that you want to lock

static void* makeMutex()
Make a new mutex

static void unlockMutex(void* const mtxHandle)
Unlocks a mutex
Parameters:
mtxGandle - The mutex handle that you want to unlock

static XMLMsgLoader* loadMsgSet(const XMLCh* const msgDomain)
Loads the message set from among the available domains
Parameters:
msgDomain - The message domain which you want to load

static void* compareAndSwap( void** toFill, const void* const newValue, const void* const toCompare )
Conditionally updates or returns a single word variable atomically The compareAndSwap subroutine performs an atomic operation which compares the contents of a single word variable with a stored old value. If the values are equal, a new value is stored in the single word variable and TRUE is returned; otherwise, the old value is set to the current value of the single word variable and FALSE is returned. The compareAndSwap subroutine is useful when a word value must be updated only if it has not been changed since it was last read. Note: The word containing the single word variable must be aligned on a full word boundary.
Returns:
Returns the new value assigned to the single word variable
Parameters:
toFill - Specifies the address of the single word variable
newValue - Specifies the new value to be conditionally assigned to the single word variable.
toCompare - Specifies the address of the old value to be checked against (and conditionally updated with) the value of the single word variable.

static int atomicIncrement(int& location)
Increments a single word variable atomically. The atomicIncrement subroutine increments one word in a single atomic operation. This operation is useful when a counter variable is shared between several threads or processes. When updating such a counter variable, it is important to make sure that the fetch, update, and store operations occur atomically (are not interruptible).
Returns:
The function return value is positive if the result of the operation was positive. Zero if the result of the operation was zero. Negative if the result of the operation was negative. Except for the zero case, the value returned may differ from the actual result of the operation - only the sign and zero/nonzero state is guaranteed to be correct.
Parameters:
location - Specifies the address of the word variable to be incremented.

static int atomicDecrement(int& location)
Decrements a single word variable atomically. The atomicDecrement subroutine increments one word in a single atomic operation. This operation is useful when a counter variable is shared between several threads or processes. When updating such a counter variable, it is important to make sure that the fetch, update, and store operations occur atomically (are not interruptible).
Returns:
The function return value is positive if the result of the operation was positive. Zero if the result of the operation was zero. Negative if the result of the operation was negative. Except for the zero case, the value returned may differ from the actual result of the operation - only the sign and zero/nonzero state is guaranteed to be correct.
Parameters:
location - Specifies the address of the word variable to be decremented.

static XMLMsgLoader* loadAMsgSet(const XMLCh* const msgDomain)
Loads a message set from the available domains
Parameters:
msgDomain - The message domain containing the message to be loaded

static XMLNetAccessor* makeNetAccessor()
Creates a net accessor object

static XMLTransService* makeTransService()
Creates a Transoding service

static void platformInit()
Does initialization for a particular platform Here you put in code that you wish to execute before anything else is done in the application

static bool fgInitFlag
This is used to avoid multiple inits if the client code calls us more than once. They aren't supposed to, but some have trouble keeping up if they are COM objects and such.


This class has no child classes.

alphabetic index hierarchy of classes


Xerces-C XML Parser for C++ Version 1.1
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.

generated by doc++