xmlreader.h File Reference

XML utilities and functionality for reading and parsing. More...

#include <iterator>
#include <stdio.h>
#include "Filename.h"
#include "LocationType.h"
#include "MessageLogMgr.h"
#include "MessageLog.h"
#include "XercesIncludes.h"
#include "xmlbase.h"

Go to the source code of this file.

Classes

class  XmlReader
 This class reads and parses XML. More...
class  XmlReader::StringStreamAssigner< T >
 Convert a string to another type. More...
class  XmlReader::StringAssigner< T >
 Convert a const char * to another type. More...
class  XmlReader::ParseStringAssigner< T >
 Convert a const char * to another type. More...
class  XmlReader::XmlReaderException
 An exception class representing an error or warning while reading and parsing. More...
class  XmlReader::DomParseException
 An exception class representing an error or warning while parsing the DOM. More...
class  XmlReader::StringStreamAssigner< std::string >
 Convert a null-terminated char array to a std::string. More...
class  BinFILEInputStream
 Class required by Xerces for parsing. More...
class  FILEInputSource
 Class required by Xerces for parsing. More...

Defines

#define FOR_EACH_DOMNODE(pParent, pChild)

Functions

XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode * 
findChildNode (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParent, const char *pName)
std::string findAttribute (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParent, const char *pName)
XERCES_CPP_NAMESPACE_QUALIFIER
DOMElement * 
readFontElement (const char *pName, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *pParent, Font &font)


Detailed Description

XML utilities and functionality for reading and parsing.

Definition in file xmlreader.h.


Define Documentation

#define FOR_EACH_DOMNODE ( pParent,
pChild   ) 

Value:

for (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* pChild = pParent->getFirstChild(); \
      pChild != NULL; \
      pChild = pChild->getNextSibling())
This macro creates a for-loop that iterates over the child nodes of a specified parent node.

Parameters:
pParent A non-NULL node over whose children to iterate
pChild The variable name that will be given to each child node.

Definition at line 616 of file xmlreader.h.


Function Documentation

std::string findAttribute ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  pParent,
const char *  pName 
)

This is a convenience method that returns an attribute of a DOMElement in an XML hierarchy.

Parameters:
pParent The DOMElement to start the search from.
pName The full path of the attribute from the specified parent, with element parentage specified with '/'. For example, the following code will extract the attribute called "baz" from the element called "bar", which is a child of the element called "foo" which is a child of pParent.
  string s = findAttribute(pParent, "foo/bar/baz");
Returns:
The found attribute, or an empty string if the attribute is not found.

XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* findChildNode ( XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  pParent,
const char *  pName 
)

This is a convenience method that returns a decendent of a DOMElement in an XML hierarchy.

Note:
This can be inefficient if called multiple times in a method. In this case, it is usually best to manually loop through the child nodes and process each as it is traversed.
Parameters:
pParent The DOMElement to start the search from.
pName The full path of the decendent node from the specified parent, with element parentage specified with '/'. For example, the following code will return the node called "baz" from the element called "bar", which is a child of the element called "foo" which is a child of pParent.
  DOMNode *pNode = findChildNode(pParent, "foo/bar/baz");
Returns:
The found node or NULL if the node is not found.

XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* readFontElement ( const char *  pName,
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  pParent,
Font font 
)

This method reads a font that was written using XMLWriter::addFontElement.

Parameters:
pName The name the font was written out with.
pParent The DOMElement the data was written to.
font A font to read the data into.
Returns:
The DOMElement the data was read from or NULL if the element was not found.


Software Development Kit - Opticks 4.9.0 Build 16218