XmlBase Class Reference
[Application XML system]

Common functionality for reading and writing XML. More...

#include <xmlbase.h>

Inheritance diagram for XmlBase:

Inheritance graph

List of all members.

Public Member Functions

 XmlBase (MessageLog *pLog=NULL)
virtual ~XmlBase ()
void logError (const XERCES_CPP_NAMESPACE_QUALIFIER DOMError &exc)

Static Public Member Functions

static std::string URLtoPath (const XMLCh *pUrl)
static std::string PathToURL (const std::string &path)
static XMLByte * encodeBase64 (const unsigned int *pData, XMLSize_t size, XMLSize_t *pOutLen=NULL, std::string *pChecksum=NULL)
static unsigned int * decodeBase64 (const XMLByte *pData, XMLSize_t size=0, const std::string &checksum=std::string())

Static Public Attributes

static const unsigned int VERSION

Protected Member Functions

void logException (const XERCES_CPP_NAMESPACE_QUALIFIER XMLException *pExc)
void logException (const XERCES_CPP_NAMESPACE_QUALIFIER DOMException *pExc)
void logException (const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException *pExc, std::string severity)
void logSimpleMessage (std::string msg)

Static Protected Attributes

static const char * sNamespaceId

Classes

class  XmlException
 This class represents an exception thrown by the XML classes. More...


Detailed Description

Common functionality for reading and writing XML.

requirements
Apache Xerces-C++ version 3.1.1

Definition at line 145 of file xmlbase.h.


Constructor & Destructor Documentation

XmlBase::XmlBase ( MessageLog pLog = NULL  ) 

Construct a new XML processor.

Constructing an XmlBase is not particularly useful as most functionality will be in derived classes.

Parameters:
pLog If this optional MessageLog is passed in, any errors encountered during processing will be logged.
Exceptions:
XmlException When Xerces fails to initialize.
See also:
XmlReader, XMLWriter

virtual XmlBase::~XmlBase (  )  [virtual]

Destroy and cleanup the XML processor.


Member Function Documentation

static std::string XmlBase::URLtoPath ( const XMLCh *  pUrl  )  [static]

This function will convert a file:// URL to a path.

It handles Windows drive letters reasonably; however, you will not be able to refer to paths such as /c:/ on UNIX.

Parameters:
pUrl The URL to convert to a path. This is passed in as a Unicode string as the most often used pattern is to read an attribute or element value and immediately convert to a path.
Returns:
A string representation of the path

static std::string XmlBase::PathToURL ( const std::string &  path  )  [static]

This function will convert a path to a file:// URL.

It handles Windows drive letters reasonably; however, you will not be able to refer to paths such as /c:/ on UNIX.

Parameters:
path The path to convert to a URL.
Returns:
The URL string.

static XMLByte* XmlBase::encodeBase64 ( const unsigned int *  pData,
XMLSize_t  size,
XMLSize_t *  pOutLen = NULL,
std::string *  pChecksum = NULL 
) [static]

Encode data in base 64 representation.

Parameters:
pData This is the data which will be encoded.
size The number of items in data
pOutLen Optional output parameter which returns the length of the output byte array.
pChecksum Optional output parameter which returns a CCITT checksum.
Returns:
The Unicode form of the base 64 encoded data. It should be freed by calling operator delete.

static unsigned int* XmlBase::decodeBase64 ( const XMLByte *  pData,
XMLSize_t  size = 0,
const std::string &  checksum = std::string() 
) [static]

Decode data in base 64 representation.

Parameters:
pData This is the Unicode representation of the base 64 encoded data.
size The expected number of data items or 0 if size is unknown.
checksum The CCITT checksum to verify. To skip verification, set this to an empty string.
Returns:
The array of decoded data. It should be freed by calling delete [].

void XmlBase::logError ( const XERCES_CPP_NAMESPACE_QUALIFIER DOMError &  exc  ) 

Log a Xerces DOM error to the message log, if one is available.

Parameters:
exc The exception to log.

void XmlBase::logException ( const XERCES_CPP_NAMESPACE_QUALIFIER XMLException *  pExc  )  [protected]

Log an XML exception to the message log, if one is available.

Parameters:
pExc The exception to log.

void XmlBase::logException ( const XERCES_CPP_NAMESPACE_QUALIFIER DOMException *  pExc  )  [protected]

Log a Xerces DOM exception to the message log, if one is available.

Parameters:
pExc The exception to log.

void XmlBase::logException ( const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException *  pExc,
std::string  severity 
) [protected]

Log a Xerces SAX exception to the message log, if one is available.

Parameters:
pExc The exception to log.
severity A severity which is also logged. SAX exceptions may not be fatal and this is a way to inform the uses of the exception severity.

void XmlBase::logSimpleMessage ( std::string  msg  )  [protected]

Log a string message to the message log, if one is available.

Parameters:
msg The message to log.


Member Data Documentation

const unsigned int XmlBase::VERSION [static]

This is the current file format version.

Definition at line 280 of file xmlbase.h.

const char* XmlBase::sNamespaceId [static, protected]

This is the ASCII namespace which XML data exists in.

Definition at line 330 of file xmlbase.h.


Software Development Kit - Opticks 4.9.0 Build 16218