|
#include <CXmlElement.h>

Public Member Functions | |
| CXmlElement (CXmlNode &parent, const char *tagname) | |
| Constructor. | |
| CXmlElement (CXmlNode *parent, const char *tagname) | |
| Constructor. | |
| CXmlElement (CXmlNode &parent, const std::string &tagname) | |
| Constructor. | |
| virtual CXmlNodeType | type () const |
| Returns node type. | |
| virtual iterator | begin () |
| Returns the first subnode iterator. | |
| virtual const_iterator | begin () const |
| Returns the first subnode const iterator. | |
| virtual iterator | end () |
| Returns the end subnode iterator. | |
| virtual const_iterator | end () const |
| Returns the end subnode const iterator. | |
| virtual uint32_t | size () const |
| Returns a number of subnodes. | |
| virtual bool | empty () const |
| Returns true if node has no subnodes of subnodes. | |
| virtual void | push_back (CXmlNode *node) |
| Appends a subnode. | |
| virtual void | insert (iterator pos, CXmlNode *node) |
| Inserts a subnode. | |
| virtual void | remove (CXmlNode *node) |
| Removes a subnode. | |
| virtual void | unlink (CXmlNode *node) |
| Removes a subnode. | |
| virtual void | clearChildren () |
| Deletes all child nodes. | |
| virtual void | clear () |
| Deletes all children and clears all the attributes. | |
| virtual CXmlAttributes & | attributes () |
| Returns referrence to node attributes. | |
| virtual const CXmlAttributes & | attributes () const |
| Returns referrence to node attributes (const version). | |
| virtual bool | hasAttributes () const |
| Returns true, if node has any attributes. | |
| virtual bool | hasAttribute (const char *attr) const |
| virtual CXmlValue | getAttribute (std::string attr, const char *defaultValue="") const |
| virtual void | setAttribute (const char *attr, CXmlValue value, const char *defaultValue="") |
| virtual void | setAttribute (const std::string &attr, CXmlValue value, const char *defaultValue="") |
Protected Member Functions | |
| CXmlElement (CXmlDoc &doc) | |
| Protected constructor for creating CXmlDoc only. | |
Protected Attributes | |
| CXmlAttributes | m_attributes |
| Node attributes. | |
Friends | |
| class | CXmlDoc |
| sptk::CXmlElement::CXmlElement | ( | CXmlDoc & | doc | ) | [inline, protected] |
| sptk::CXmlElement::CXmlElement | ( | CXmlNode & | parent, | |
| const char * | tagname | |||
| ) | [inline] |
Constructor.
| parent | CXmlNode*, a parent node. | |
| tagname | const char*, a name of XML tag |
| sptk::CXmlElement::CXmlElement | ( | CXmlNode * | parent, | |
| const char * | tagname | |||
| ) | [inline] |
Constructor.
| parent | CXmlNode*, a parent node. | |
| tagname | const char*, a name of XML tag |
| sptk::CXmlElement::CXmlElement | ( | CXmlNode & | parent, | |
| const std::string & | tagname | |||
| ) | [inline] |
| virtual void sptk::CXmlElement::clear | ( | ) | [virtual] |
Deletes all children and clears all the attributes.
Any memory, associated with children or attributes, is released.
Reimplemented from sptk::CXmlNode.
Reimplemented in sptk::CXmlDoc.
| virtual void sptk::CXmlElement::clearChildren | ( | ) | [virtual] |
Deletes all child nodes.
Any memory, associated with child nodes, is released.
Reimplemented from sptk::CXmlNode.
| virtual CXmlValue sptk::CXmlElement::getAttribute | ( | std::string | attr, | |
| const char * | defaultValue = "" | |||
| ) | const [inline, virtual] |
Returns attribute value for given attribute. HTML tags can have empty attributes, for those you should use has_attribute() method.
| attr | std::string, name of attribute | |
| defaultValue | const char *, a default value. If attribute doesn't exist then default value is returned. |
Reimplemented from sptk::CXmlNode.
References sptk::CXmlAttributes::getAttribute(), and m_attributes.
| virtual bool sptk::CXmlElement::hasAttribute | ( | const char * | attr | ) | const [inline, virtual] |
Returns true, if given attribute is found
| attr | const char *, attribute to search |
Reimplemented from sptk::CXmlNode.
References sptk::CXmlAttributes::hasAttribute(), and m_attributes.
Inserts a subnode.
| pos | iterator, insert position with the list of subnodes | |
| node | CXmlNode*, node to insert |
Reimplemented from sptk::CXmlNode.
| virtual void sptk::CXmlElement::push_back | ( | CXmlNode * | node | ) | [virtual] |
| virtual void sptk::CXmlElement::remove | ( | CXmlNode * | node | ) | [virtual] |
Removes a subnode.
Any memory allocated for subnode is released and subnode is removed from its parent
| node | CXmlNode*, node to remove |
Reimplemented from sptk::CXmlNode.
| virtual void sptk::CXmlElement::setAttribute | ( | const std::string & | attr, | |
| CXmlValue | value, | |||
| const char * | defaultValue = "" | |||
| ) | [inline, virtual] |
Sets new value to attribute 'attr'. If attribute is not found, it's added to map.
| attr | const string&, an attribute name | |
| value | CXmlValue, attribute value | |
| defaultValue | const char *, a default value. If attribute value is matching default value than attribute isn't stored (or removed if it existed). |
Reimplemented from sptk::CXmlNode.
References m_attributes, and sptk::CXmlAttributes::setAttribute().
| virtual void sptk::CXmlElement::setAttribute | ( | const char * | attr, | |
| CXmlValue | value, | |||
| const char * | defaultValue = "" | |||
| ) | [inline, virtual] |
Sets new value to attribute 'attr'. If attribute is not found, it's added to map.
| attr | const char*, attribute name | |
| value | CXmlValue, attribute value | |
| defaultValue | const char *, a default value. If attribute value is matching default value than attribute isn't stored (or removed if it existed). |
Reimplemented from sptk::CXmlNode.
References m_attributes, and sptk::CXmlAttributes::setAttribute().
| virtual void sptk::CXmlElement::unlink | ( | CXmlNode * | node | ) | [virtual] |