Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUI::XercesParser Class Reference

Implementation of XMLParser using Xerces-C++. More...

#include <CEGUIXercesParser.h>

Inheritance diagram for CEGUI::XercesParser:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::XercesParser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XercesParser (void)
 ~XercesParser (void)
void parseXMLFile (XMLHandler &handler, const String &filename, const String &schemaName, const String &resourceGroup)
 abstract method which initiates parsing of an XML file.
bool initialise (void)
 Initialises the XMLParser module ready for use.
void cleanup (void)
 Cleans up the XMLParser module after use.
const StringgetIdentifierString () const
 Return identification string for the XML parser module. If the internal id string has not been set by the XML parser module creator, a generic string of "Unknown XML parser" will be returned.

Static Public Member Functions

static void populateAttributesBlock (const XERCES_CPP_NAMESPACE::Attributes &src, XMLAttributes &dest)
 Populate the CEGUI::XMLAttributes object with attribute data from the Xerces attributes block.
static String transcodeXmlCharToString (const XMLCh *const xmlch_str)
 Return a CEGUI::String containing the Xerces XMLChar string data in xmlch_str.

Protected Member Functions

bool initialiseImpl (void)
 abstract method which initialises the XMLParser ready for use.
void cleanupImpl (void)
 abstract method which cleans up the XMLParser after use.

Static Protected Member Functions

static void initialiseSchema (XERCES_CPP_NAMESPACE::SAX2XMLReader *reader, const String &schemaName, const String &xmlFilename, const String &resourceGroup)
static XERCES_CPP_NAMESPACE::SAX2XMLReader * createReader (XERCES_CPP_NAMESPACE::DefaultHandler &handler)
static void doParse (XERCES_CPP_NAMESPACE::SAX2XMLReader *parser, const String &xmlFilename, const String &resourceGroup)

Protected Attributes

String d_identifierString
 String that holds some id information about the module.

Detailed Description

Implementation of XMLParser using Xerces-C++.

Definition at line 63 of file CEGUIXercesParser.h.


Constructor & Destructor Documentation

CEGUI::XercesParser::XercesParser void   ) 
 

Definition at line 43 of file CEGUIXercesParser.cpp.

References CEGUI::XMLParser::d_identifierString.

CEGUI::XercesParser::~XercesParser void   ) 
 

Definition at line 49 of file CEGUIXercesParser.cpp.


Member Function Documentation

void CEGUI::XMLParser::cleanup void   )  [inherited]
 

Cleans up the XMLParser module after use.

Note that this calls the protected abstract method 'cleanupImpl', which should be provided in your implementation to perform any required cleanup.

Returns:
Nothing.

Definition at line 49 of file CEGUIXMLParser.cpp.

References CEGUI::XMLParser::cleanupImpl().

Referenced by CEGUI::System::~System().

void CEGUI::XercesParser::cleanupImpl void   )  [protected, virtual]
 

abstract method which cleans up the XMLParser after use.

Returns:
Nothing.

Implements CEGUI::XMLParser.

Definition at line 130 of file CEGUIXercesParser.cpp.

XERCES_CPP_NAMESPACE::SAX2XMLReader * CEGUI::XercesParser::createReader XERCES_CPP_NAMESPACE::DefaultHandler &  handler  )  [static, protected]
 

Definition at line 236 of file CEGUIXercesParser.cpp.

Referenced by parseXMLFile().

void CEGUI::XercesParser::doParse XERCES_CPP_NAMESPACE::SAX2XMLReader *  parser,
const String xmlFilename,
const String resourceGroup
[static, protected]
 

Definition at line 252 of file CEGUIXercesParser.cpp.

References CEGUI::String::c_str(), CEGUI::DataContainer< T >::getDataPtr(), CEGUI::System::getResourceProvider(), CEGUI::System::getSingleton(), CEGUI::DataContainer< T >::getSize(), CEGUI::ResourceProvider::loadRawDataContainer(), and CEGUI::ResourceProvider::unloadRawDataContainer().

Referenced by parseXMLFile().

const String & CEGUI::XMLParser::getIdentifierString  )  const [inherited]
 

Return identification string for the XML parser module. If the internal id string has not been set by the XML parser module creator, a generic string of "Unknown XML parser" will be returned.

Returns:
String object holding a string that identifies the XML parser in use.

Definition at line 58 of file CEGUIXMLParser.cpp.

References CEGUI::XMLParser::d_identifierString.

bool CEGUI::XMLParser::initialise void   )  [inherited]
 

Initialises the XMLParser module ready for use.

Note that this calls the protected abstract method 'initialiseImpl', which should be provided in your implementation to perform any required initialisation.

Returns:
  • true if the module initialised successfully.
  • false if the module initialisation failed.

Definition at line 38 of file CEGUIXMLParser.cpp.

References CEGUI::XMLParser::initialiseImpl().

bool CEGUI::XercesParser::initialiseImpl void   )  [protected, virtual]
 

abstract method which initialises the XMLParser ready for use.

Returns:
  • true if the module initialised successfully.
  • false if the module initialisation failed.

Implements CEGUI::XMLParser.

Definition at line 106 of file CEGUIXercesParser.cpp.

References CEGUI::String::c_str().

void CEGUI::XercesParser::initialiseSchema XERCES_CPP_NAMESPACE::SAX2XMLReader *  reader,
const String schemaName,
const String xmlFilename,
const String resourceGroup
[static, protected]
 

Definition at line 185 of file CEGUIXercesParser.cpp.

References CEGUI::String::assign(), CEGUI::String::c_str(), CEGUI::DataContainer< T >::getDataPtr(), CEGUI::System::getResourceProvider(), CEGUI::System::getSingleton(), CEGUI::Logger::getSingleton(), CEGUI::DataContainer< T >::getSize(), CEGUI::ResourceProvider::loadRawDataContainer(), CEGUI::Logger::logEvent(), CEGUI::String::npos, CEGUI::String::rfind(), and CEGUI::ResourceProvider::unloadRawDataContainer().

Referenced by parseXMLFile().

void CEGUI::XercesParser::parseXMLFile XMLHandler handler,
const String filename,
const String schemaName,
const String resourceGroup
[virtual]
 

abstract method which initiates parsing of an XML file.

Parameters:
handler XMLHandler based object which will process the XML elements.
filename String object holding the filename of the XML file to be parsed.
schemaName String object holding the name of the XML schema file to use for validating the XML. Note that whether this is used or not is dependant upon the XMLParser in use.
resourceGroup String object holding the resource group identifier which will be passed to the ResourceProvider when loading the XML and schema files.
Returns:
Nothing.

Implements CEGUI::XMLParser.

Definition at line 52 of file CEGUIXercesParser.cpp.

References createReader(), doParse(), CEGUI::Errors, CEGUI::Logger::getSingleton(), initialiseSchema(), CEGUI::Logger::logEvent(), and CEGUI::PropertyHelper::uintToString().

void CEGUI::XercesParser::populateAttributesBlock const XERCES_CPP_NAMESPACE::Attributes &  src,
XMLAttributes dest
[static]
 

Populate the CEGUI::XMLAttributes object with attribute data from the Xerces attributes block.

Definition at line 137 of file CEGUIXercesParser.cpp.

References CEGUI::XMLAttributes::add(), and transcodeXmlCharToString().

Referenced by CEGUI::XercesHandler::startElement().

String CEGUI::XercesParser::transcodeXmlCharToString const XMLCh *const   xmlch_str  )  [static]
 

Return a CEGUI::String containing the Xerces XMLChar string data in xmlch_str.

Definition at line 150 of file CEGUIXercesParser.cpp.

References CEGUI::String::append().

Referenced by CEGUI::XercesHandler::endElement(), populateAttributesBlock(), and CEGUI::XercesHandler::startElement().


Member Data Documentation

String CEGUI::XMLParser::d_identifierString [protected, inherited]
 

String that holds some id information about the module.

Definition at line 132 of file CEGUIXMLParser.h.

Referenced by CEGUI::XMLParser::getIdentifierString(), CEGUI::TinyXMLParser::TinyXMLParser(), and XercesParser().


The documentation for this class was generated from the following files:
Generated on Wed Sep 7 10:07:49 2005 for Crazy Eddies GUI System by  doxygen 1.4.3