adchpp::SimpleXML Class Reference

A simple XML class that loads an XML-ish structure into an internal tree and allows easy access to each element through a "current location". More...

#include <SimpleXML.h>

Inheritance diagram for adchpp::SimpleXML:
Inheritance graph
[legend]
Collaboration diagram for adchpp::SimpleXML:
Collaboration graph
[legend]

List of all members.

Classes

class  Tag

Public Member Functions

ADCHPP_DLL void addAttrib (const std::string &aName, const std::string &aData) throw (SimpleXMLException)
template<typename T >
void addAttrib (const std::string &aName, const T &aData) throw (SimpleXMLException)
ADCHPP_DLL void addChildAttrib (const std::string &aName, const std::string &aData) throw (SimpleXMLException)
template<typename T >
void addChildAttrib (const std::string &aName, const T &aData) throw (SimpleXMLException)
void addTag (const std::string &aName, int64_t aData) throw (SimpleXMLException)
void addTag (const std::string &aName, int aData) throw (SimpleXMLException)
ADCHPP_DLL void addTag (const std::string &aName, const std::string &aData=Util::emptyString) throw (SimpleXMLException)
ADCHPP_DLL bool findChild (const std::string &aName) const throw ()
ADCHPP_DLL void fromXML (const std::string &aXML) throw (SimpleXMLException)
bool getBoolChildAttrib (const std::string &aName) const
const std::string & getChildAttrib (const std::string &aName, const std::string &aDefault=Util::emptyString) const
const std::string & getChildData () const
const std::string & getChildName () const
const std::string & getData () const
int getIntChildAttrib (const std::string &aName) const
int64_t getLongLongChildAttrib (const std::string &aName) const
void resetCurrentChild () const throw ()
ADCHPP_DLL SimpleXML (int numAttribs=0)
ADCHPP_DLL void stepIn () const throw (SimpleXMLException)
ADCHPP_DLL void stepOut () const throw (SimpleXMLException)
std::string toXML ()
ADCHPP_DLL ~SimpleXML ()

Static Public Member Functions

static ADCHPP_DLL void escape (std::string &aString, bool aAttrib, bool aLoading=false)
static bool needsEscape (const std::string &aString, bool aAttrib, bool aLoading=false)
 This is a heurestic for whether escape needs to be called or not.

Private Member Functions

void checkChildSelected () const throw ()

Private Attributes

int attribs
Tag::Ptr current
 Current position.
Tag::Iter currentChild
bool found
Tag::Ptr root
 Bogus root tag, should be only one child!

Detailed Description

A simple XML class that loads an XML-ish structure into an internal tree and allows easy access to each element through a "current location".

Definition at line 33 of file SimpleXML.h.


Constructor & Destructor Documentation

adchpp::SimpleXML::SimpleXML ( int  numAttribs = 0  ) 

Definition at line 27 of file SimpleXML.cpp.

References current, adchpp::Util::emptyString, and root.

adchpp::SimpleXML::~SimpleXML (  ) 

Definition at line 31 of file SimpleXML.cpp.

References root.


Member Function Documentation

void adchpp::SimpleXML::addAttrib ( const std::string &  aName,
const std::string &  aData 
) throw (SimpleXMLException)

Definition at line 320 of file SimpleXML.cpp.

template<typename T >
void adchpp::SimpleXML::addAttrib ( const std::string &  aName,
const T &  aData 
) throw (SimpleXMLException) [inline]

Definition at line 48 of file SimpleXML.h.

References adchpp::Util::toString().

Here is the call graph for this function:

void adchpp::SimpleXML::addChildAttrib ( const std::string &  aName,
const std::string &  aData 
) throw (SimpleXMLException)

Definition at line 327 of file SimpleXML.cpp.

template<typename T >
void adchpp::SimpleXML::addChildAttrib ( const std::string &  aName,
const T &  aData 
) throw (SimpleXMLException) [inline]

Definition at line 55 of file SimpleXML.h.

References adchpp::Util::toString().

Here is the call graph for this function:

void adchpp::SimpleXML::addTag ( const std::string &  aName,
int64_t  aData 
) throw (SimpleXMLException) [inline]

Definition at line 43 of file SimpleXML.h.

References addTag(), and adchpp::Util::toString().

Here is the call graph for this function:

void adchpp::SimpleXML::addTag ( const std::string &  aName,
int  aData 
) throw (SimpleXMLException) [inline]

Definition at line 40 of file SimpleXML.h.

References addTag(), and adchpp::Util::toString().

Here is the call graph for this function:

void adchpp::SimpleXML::addTag ( const std::string &  aName,
const std::string &  aData = Util::emptyString 
) throw (SimpleXMLException)

Definition at line 302 of file SimpleXML.cpp.

Referenced by addTag().

Here is the caller graph for this function:

void adchpp::SimpleXML::checkChildSelected (  )  const throw () [inline, private]

Definition at line 180 of file SimpleXML.h.

References adchpp::SimpleXML::Tag::children, current, currentChild, and dcassert.

Referenced by getBoolChildAttrib(), getChildAttrib(), getChildData(), getChildName(), getIntChildAttrib(), getLongLongChildAttrib(), and stepIn().

Here is the caller graph for this function:

void adchpp::SimpleXML::escape ( std::string &  aString,
bool  aAttrib,
bool  aLoading = false 
) [static]

Definition at line 35 of file SimpleXML.cpp.

References dcasserta.

Referenced by adchpp::SimpleXML::Tag::appendAttribString(), and adchpp::SimpleXML::Tag::toXML().

Here is the caller graph for this function:

bool adchpp::SimpleXML::findChild ( const std::string &  aName  )  const throw ()

Definition at line 140 of file SimpleXML.cpp.

References adchpp::SimpleXML::Tag::children, current, currentChild, dcassert, and found.

void adchpp::SimpleXML::fromXML ( const std::string &  aXML  )  throw (SimpleXMLException)

Definition at line 333 of file SimpleXML.cpp.

References adchpp::Util::emptyString.

bool adchpp::SimpleXML::getBoolChildAttrib ( const std::string &  aName  )  const [inline]

Definition at line 99 of file SimpleXML.h.

References checkChildSelected(), and getChildAttrib().

Here is the call graph for this function:

const std::string& adchpp::SimpleXML::getChildAttrib ( const std::string &  aName,
const std::string &  aDefault = Util::emptyString 
) const [inline]

Definition at line 86 of file SimpleXML.h.

References checkChildSelected().

Referenced by getBoolChildAttrib(), getIntChildAttrib(), and getLongLongChildAttrib().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& adchpp::SimpleXML::getChildData (  )  const [inline]

Definition at line 81 of file SimpleXML.h.

References checkChildSelected().

Here is the call graph for this function:

const std::string& adchpp::SimpleXML::getChildName (  )  const [inline]

Definition at line 76 of file SimpleXML.h.

References checkChildSelected().

Here is the call graph for this function:

const std::string& adchpp::SimpleXML::getData (  )  const [inline]

Definition at line 60 of file SimpleXML.h.

References current, adchpp::SimpleXML::Tag::data, and dcassert.

int adchpp::SimpleXML::getIntChildAttrib ( const std::string &  aName  )  const [inline]

Definition at line 91 of file SimpleXML.h.

References checkChildSelected(), getChildAttrib(), and adchpp::Util::toInt().

Here is the call graph for this function:

int64_t adchpp::SimpleXML::getLongLongChildAttrib ( const std::string &  aName  )  const [inline]

Definition at line 95 of file SimpleXML.h.

References checkChildSelected(), getChildAttrib(), and adchpp::Util::toInt64().

Here is the call graph for this function:

static bool adchpp::SimpleXML::needsEscape ( const std::string &  aString,
bool  aAttrib,
bool  aLoading = false 
) [inline, static]

This is a heurestic for whether escape needs to be called or not.

The results are only guaranteed for false, i e sometimes true might be returned even though escape was not needed...

Definition at line 115 of file SimpleXML.h.

Referenced by adchpp::SimpleXML::Tag::appendAttribString(), and adchpp::SimpleXML::Tag::toXML().

Here is the caller graph for this function:

void adchpp::SimpleXML::resetCurrentChild (  )  const throw () [inline]

Definition at line 68 of file SimpleXML.h.

References adchpp::SimpleXML::Tag::children, current, currentChild, dcassert, and found.

void adchpp::SimpleXML::stepIn (  )  const throw (SimpleXMLException)

Definition at line 156 of file SimpleXML.cpp.

References checkChildSelected(), adchpp::SimpleXML::Tag::children, current, currentChild, and found.

Here is the call graph for this function:

void adchpp::SimpleXML::stepOut (  )  const throw (SimpleXMLException)

Definition at line 163 of file SimpleXML.cpp.

References current, currentChild, dcassert, found, adchpp::SimpleXML::Tag::parent, and root.

std::string adchpp::SimpleXML::toXML (  )  [inline]

Definition at line 107 of file SimpleXML.h.

References adchpp::SimpleXML::Tag::children, adchpp::Util::emptyString, and root.


Member Data Documentation

Definition at line 185 of file SimpleXML.h.

Current position.

Definition at line 176 of file SimpleXML.h.

Referenced by checkChildSelected(), findChild(), getData(), resetCurrentChild(), SimpleXML(), stepIn(), and stepOut().

Definition at line 178 of file SimpleXML.h.

Referenced by checkChildSelected(), findChild(), resetCurrentChild(), stepIn(), and stepOut().

bool adchpp::SimpleXML::found [mutable, private]

Definition at line 186 of file SimpleXML.h.

Referenced by findChild(), resetCurrentChild(), stepIn(), and stepOut().

Bogus root tag, should be only one child!

Definition at line 173 of file SimpleXML.h.

Referenced by SimpleXML(), stepOut(), toXML(), and ~SimpleXML().

Generated on Sat Nov 27 23:38:50 2010 for adchpp by  doxygen 1.6.3