Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Xml::Element Class Reference

Xml Element. More...

#include <xml.h>

List of all members.

Public Member Functions

 Element (TiXmlElement *i)
 ~Element ()
Element operator() ()
 return child element
Element operator() (const char *el)
 return child el element
 operator bool ()
 is this valid element?
Element Sibling ()
 return sibling element
Element Sibling (const char *el)
 return el sibling element
const char * operator[] (const char *attr)
 attr val (null is not exist)
int Int (const char *attr)
 get int (bail out if error)
bool Bool (const char *attr)
 get bool (bail out if error)

Private Member Functions

void BailOut (const char *attr)
 bail out with error message

Private Attributes

TiXmlElement * e


Detailed Description

Xml Element.

        Xml::Element child = root("Child");
        Xml::Element child = root();

        for( ; child ; child = child.Sibling("Child"))
                //...

        string name = child["name"];
        int age = child.Int("age");
        bool dead = child.Bool("isdead");

It is the sole responsibility of user to check if int/bool attribute exists (using operator[]), before loading it. Otherwise the program bails out with an error message.


Constructor & Destructor Documentation

Xml::Element::Element TiXmlElement *  i  ) 
 

Xml::Element::~Element  ) 
 


Member Function Documentation

void Xml::Element::BailOut const char *  attr  )  [private]
 

bail out with error message

bool Xml::Element::Bool const char *  attr  ) 
 

get bool (bail out if error)

int Xml::Element::Int const char *  attr  ) 
 

get int (bail out if error)

Xml::Element::operator bool  ) 
 

is this valid element?

Element Xml::Element::operator() const char *  el  ) 
 

return child el element

Element Xml::Element::operator()  ) 
 

return child element

const char * Xml::Element::operator[] const char *  attr  ) 
 

attr val (null is not exist)

Element Xml::Element::Sibling const char *  el  ) 
 

return el sibling element

Element Xml::Element::Sibling  ) 
 

return sibling element


Member Data Documentation

TiXmlElement* Xml::Element::e [private]
 


The documentation for this class was generated from the following files:
Generated on Sun Mar 20 12:22:07 2005 for The Grid by doxygen 1.3.8