#include <XmlElement.h>
Inherits Support.
Inherited by XmlAttributeElement, XmlDataElement, and XmlRegistryElement.
Inheritance diagram for XmlElement:


Public Member Functions | |
| XmlElement (const String &tag, XmlAttribute *attr=NULL, const String &innerData="", XmlElement *nextChild=NULL, XmlElement *nextSibling=NULL) | |
| virtual | ~XmlElement () |
| String | tag () const |
| String | id () const |
| int | setId (const String &id) |
| String | name () const |
| int | setName (const String &name) |
| int | attribute (const String &name, String &value) const |
| XmlAttributeCollection | atributes () const |
| int | setAttribute (const String &name, const String &value) |
| bool | hasChildren () const |
| XmlElementCollection * | children () const |
| int | appendChild (XmlElement *element) |
| int | detachChild (XmlElement *element) |
| int | removeChild (XmlElement *element) |
| int | removeChildren () |
| XmlDocument * | document () const |
| XmlElement * | parent () const |
| String | innerData () const |
| int | setInnerData (const String &data) |
| int | appendInnerData (const String &data) |
| int | toString (String &str) const |
Protected Member Functions | |
| virtual int | close () |
Private Member Functions | |
| int | setDocument (const XmlDocument *doc) |
| int | setParent (const XmlElement *parent) |
| int | _toString (String &str, unsigned int &indent) const |
Private Attributes | |
| String | _tag |
| XmlDocument * | _document |
| XmlElement * | _parent |
| XmlElement * | _nextSibling |
| String | _innerData |
| XmlAttributeCollection | _attributes |
| XmlElementCollection | _children |
Friends | |
| class | XmlDocument |
Definition at line 40 of file XmlElement.h.
| XmlElement::XmlElement | ( | const String & | tag, | |
| XmlAttribute * | attr = NULL, |
|||
| const String & | innerData = "", |
|||
| XmlElement * | nextChild = NULL, |
|||
| XmlElement * | nextSibling = NULL | |||
| ) |
Definition at line 13 of file XmlElement.cpp.
References _attributes, appendChild(), CHECK_PARENT, ERROR_BACKTRACE(), FAILED(), Support::failure(), XmlAttribute::name(), XmlAttribute::next(), and XmlAttribute::value().
| XmlElement::~XmlElement | ( | ) | [virtual] |
Definition at line 46 of file XmlElement.cpp.
| String XmlElement::tag | ( | ) | const |
Definition at line 50 of file XmlElement.cpp.
References _tag.
Referenced by XmlDocument::_getElementsByTagName(), XmlAttributeElement::close(), and S11n< T >::fromXml().
| String XmlElement::id | ( | ) | const |
Definition at line 55 of file XmlElement.cpp.
References _attributes, MSG_XML_ELEMENT_ATTR_NOT_FOUND, WARNING, and XML_ATTR_ID.
Referenced by setId().
| int XmlElement::setId | ( | const String & | id | ) |
| String XmlElement::name | ( | ) | const |
Definition at line 71 of file XmlElement.cpp.
References _attributes, MSG_XML_ELEMENT_ATTR_NOT_FOUND, WARNING, and XML_ATTR_NAME.
Referenced by XmlDocument::_getElementsByName(), attribute(), setAttribute(), and setName().
| int XmlElement::setName | ( | const String & | name | ) |
Definition at line 81 of file XmlElement.cpp.
References _attributes, name(), OK, and XML_ATTR_NAME.
Definition at line 87 of file XmlElement.cpp.
References _attributes, CSTRING(), MSG_XML_ELEMENT_ATTR_NOT_FOUND, name(), OK, and WARNING.
Referenced by XmlRegistryElement::defaultValue(), S11n< T >::fromXml(), S11n< T >::fromXmlAttrValue(), XmlRegistryElement::type(), XmlRegistryElement::value(), and XmlDataElement::XmlDataElement().
| XmlAttributeCollection XmlElement::atributes | ( | ) | const |
Definition at line 104 of file XmlElement.cpp.
References _attributes, name(), and OK.
Referenced by XmlAttributeElement::close(), and S11n< T >::toXmlAttrValue().
| bool XmlElement::hasChildren | ( | ) | const |
Definition at line 110 of file XmlElement.cpp.
References _children.
Referenced by XmlDocument::_getElementsByName(), XmlDocument::_getElementsByTagName(), and _toString().
| XmlElementCollection * XmlElement::children | ( | ) | const |
Definition at line 115 of file XmlElement.cpp.
References _children.
Referenced by S11n< T >::fromXml().
| int XmlElement::appendChild | ( | XmlElement * | element | ) |
Definition at line 120 of file XmlElement.cpp.
References _children, ERROR, ERROR_BACKTRACE(), FAILED(), MSG_NULL_POINTER, OK, and setParent().
Referenced by XmlDocument::start(), S11n< T >::toXml(), and XmlElement().
| int XmlElement::detachChild | ( | XmlElement * | element | ) |
Definition at line 135 of file XmlElement.cpp.
References _children, ERROR, ERROR_BACKTRACE(), FAILED(), MSG_NULL_POINTER, MSG_XML_ELEMENT_NOT_FOUND, OK, setParent(), and WARNING.
Referenced by removeChild().
| int XmlElement::removeChild | ( | XmlElement * | element | ) |
Definition at line 160 of file XmlElement.cpp.
References detachChild(), ERROR_BACKTRACE(), FAILED(), and OK.
Referenced by XmlDocument::removeElement().
| int XmlElement::removeChildren | ( | ) |
Definition at line 170 of file XmlElement.cpp.
Referenced by S11n< T >::toXml(), and S11n< T >::toXmlAttrValue().
| XmlDocument * XmlElement::document | ( | ) | const |
| XmlElement * XmlElement::parent | ( | ) | const |
Definition at line 188 of file XmlElement.cpp.
References _parent.
Referenced by XmlAttributeElement::close(), XmlDocument::end(), XmlDocument::removeElement(), and setParent().
| String XmlElement::innerData | ( | ) | const |
Definition at line 193 of file XmlElement.cpp.
References _innerData.
Referenced by XmlAttributeElement::close(), and S11n< T >::fromXml().
| int XmlElement::setInnerData | ( | const String & | data | ) |
Definition at line 198 of file XmlElement.cpp.
References _innerData, OK, and String::trim().
Referenced by S11n< T >::toXml().
| int XmlElement::appendInnerData | ( | const String & | data | ) |
Definition at line 205 of file XmlElement.cpp.
References _innerData, OK, and String::trim().
Referenced by XmlDocument::data().
| int XmlElement::toString | ( | String & | str | ) | const |
Definition at line 212 of file XmlElement.cpp.
References _toString(), ERROR_BACKTRACE(), FAILED(), and OK.
Referenced by Config::save().
| int XmlElement::close | ( | ) | [protected, virtual] |
Reimplemented in XmlAttributeElement.
Definition at line 227 of file XmlElement.cpp.
References OK.
Referenced by XmlDocument::end().
| int XmlElement::setDocument | ( | const XmlDocument * | doc | ) | [private] |
| int XmlElement::setParent | ( | const XmlElement * | parent | ) | [private] |
Definition at line 240 of file XmlElement.cpp.
References _nextSibling, _parent, ERROR_BACKTRACE(), FAILED(), OK, parent(), and setParent().
Referenced by appendChild(), detachChild(), and setParent().
| int XmlElement::_toString | ( | String & | str, | |
| unsigned int & | indent | |||
| ) | const [private] |
Definition at line 253 of file XmlElement.cpp.
References _attributes, _children, _innerData, _tag, String::eol(), ERROR_BACKTRACE(), FAILED(), hasChildren(), OK, and XML_INDENT.
Referenced by toString().
friend class XmlDocument [friend] |
Definition at line 43 of file XmlElement.h.
String XmlElement::_tag [private] |
XmlDocument* XmlElement::_document [private] |
XmlElement* XmlElement::_parent [private] |
XmlElement* XmlElement::_nextSibling [private] |
String XmlElement::_innerData [private] |
Definition at line 95 of file XmlElement.h.
Referenced by _toString(), appendInnerData(), innerData(), and setInnerData().
Definition at line 96 of file XmlElement.h.
Referenced by _toString(), atributes(), attribute(), id(), name(), setAttribute(), setId(), setName(), and XmlElement().
XmlElementCollection XmlElement::_children [private] |
Definition at line 97 of file XmlElement.h.
Referenced by XmlDocument::_getElementsByName(), XmlDocument::_getElementsByTagName(), _toString(), appendChild(), children(), detachChild(), hasChildren(), and removeChildren().
1.5.1