|
Public Member Functions |
| XmlElement (std::string elementName, std::string content="") |
| Constructs an element with the specified name and string content.
|
| XmlElement (std::string elementName, int numericContent) |
| Constructs an element with the specified name and numeric content.
|
virtual | ~XmlElement () |
| Destructs the element and its child elements.
|
std::string | name () const |
| Returns the name of the element.
|
std::string | content () const |
| Returns the content of the element.
|
void | setName (const std::string &name) |
| Sets the name of the element.
|
void | setContent (const std::string &content) |
| Sets the content of the element.
|
void | setContent (int numericContent) |
void | addAttribute (std::string attributeName, std::string value) |
| Adds an attribute with the specified string value.
|
void | addAttribute (std::string attributeName, int numericValue) |
| Adds an attribute with the specified numeric value.
|
void | addElement (XmlElement *element) |
| Adds a child element to the element.
|
int | elementCount () const |
| Returns the number of child elements.
|
XmlElement * | elementAt (int index) const |
| Returns the child element at the specified index.
|
XmlElement * | elementFor (const std::string &name) const |
| Returns the first child element with the specified name.
|
std::string | toString (const std::string &indent="") const |
| Returns a XML string that represents the element.
|
Private Types |
typedef std::pair< std::string,
std::string > | Attribute |
typedef CppUnitDeque< Attribute > | Attributes |
typedef CppUnitDeque< XmlElement * > | Elements |
Private Member Functions |
std::string | attributesAsString () const |
std::string | escape (std::string value) const |
Private Attributes |
std::string | m_name |
std::string | m_content |
Attributes | m_attributes |
Elements | m_elements |