syBR::Core::XMLFile Class Reference

XML file class. More...

#include <XML.hpp>

List of all members.

Public Member Functions

 XMLFile (const std::string &filename, const std::string &rootNodeName, Logger *pLogger)
 Constructor.
 ~XMLFile ()
 Destructor.
bool load ()
 Load the XML file.
bool save ()
 Save the XML file.
void clear ()
 Clear the XML file.
XMLNodegetRootNode () const
 Get root node.
const std::string getLastError () const
 Get last error.
const int getLastErrorLine () const
 Get last error line number.
const int getLastErrorColumn () const
 Get last error line number.

Private Attributes

Loggerm_pLogger
 Pointer to the logger to be used.
std::string m_filename
 XML filename.
std::string m_rootNodeName
 XML root node name.
XMLNodem_pRootNode
 XML root node.
TiXmlDocument * m_pXMLDocument
 TinyXML: XML document.
TiXmlElement * m_pXMLRoot
 TinyXML: XML root element.
std::string m_lastError
 Description of last error.
int m_lastErrorLine
 Line number of last error.
int m_lastErrorColumn
 Column of last error.


Detailed Description

XML file class.

Constructor & Destructor Documentation

syBR::Core::XMLFile::XMLFile ( const std::string &  filename,
const std::string &  rootNodeName,
Logger pLogger 
)

Constructor.

Parameters:
filename Name of the XML file to be used
rootNodeName Name of the root node of the XML file
pLogger Pointer to the instance of the logger to use

syBR::Core::XMLFile::~XMLFile (  ) 

Destructor.


Member Function Documentation

bool syBR::Core::XMLFile::load (  ) 

Load the XML file.

Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Core::XMLFile::save (  ) 

Save the XML file.

Returns:
One of these:
  • true in case of success
  • false otherwise

void syBR::Core::XMLFile::clear (  ) 

Clear the XML file.

XMLNode * syBR::Core::XMLFile::getRootNode (  )  const

Get root node.

NULL will be returned if the XML file has not been initialized / loaded.

Returns:
Pointer to the root node

const std::string syBR::Core::XMLFile::getLastError (  )  const

Get last error.

Returns:
Description of the last error, if any

const int syBR::Core::XMLFile::getLastErrorLine (  )  const

Get last error line number.

Returns:
One of these:
  • Line number of last error if an error occured
  • -1 otherwise

const int syBR::Core::XMLFile::getLastErrorColumn (  )  const

Get last error line number.

Returns:
One of these:
  • Line number of last error if an error occured
  • -1 otherwise


Member Data Documentation

Logger* syBR::Core::XMLFile::m_pLogger [private]

Pointer to the logger to be used.

std::string syBR::Core::XMLFile::m_filename [private]

XML filename.

std::string syBR::Core::XMLFile::m_rootNodeName [private]

XML root node name.

XMLNode* syBR::Core::XMLFile::m_pRootNode [private]

XML root node.

TiXmlDocument* syBR::Core::XMLFile::m_pXMLDocument [private]

TinyXML: XML document.

TiXmlElement* syBR::Core::XMLFile::m_pXMLRoot [private]

TinyXML: XML root element.

std::string syBR::Core::XMLFile::m_lastError [private]

Description of last error.

int syBR::Core::XMLFile::m_lastErrorLine [private]

Line number of last error.

int syBR::Core::XMLFile::m_lastErrorColumn [private]

Column of last error.


The documentation for this class was generated from the following files:

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:33 2008