#include <tag.h>
Inherited by Stanza.
Inheritance diagram for Tag:


Public Types | |
| typedef std::pair< std::string, std::string > | Attribute |
| typedef std::list< Attribute > | AttributeList |
| typedef std::list< Tag * > | TagList |
Public Member Functions | |
| GLOOX_DEPRECATED_CTOR | Tag () |
| Tag (const std::string &name, const std::string &cdata="", bool incoming=false) | |
| Tag (Tag *parent, const std::string &name, const std::string &cdata="", bool incoming=false) | |
| Tag (const std::string &name, const std::string &attrib, const std::string &value, bool incoming=false) | |
| Tag (Tag *parent, const std::string &name, const std::string &attrib, const std::string &value, bool incoming=false) | |
| virtual | ~Tag () |
| virtual const std::string | xml () const |
| virtual void | addAttribute (const std::string &name, const std::string &value) |
| virtual void | addAttribute (const std::string &name, int value) |
| virtual void | addAttribute (const std::string &name, long value) |
| virtual void | setAttributes (const AttributeList &attributes) |
| virtual void | addChild (Tag *child) |
| virtual void | addChildCopy (const Tag *child) |
| virtual void | setCData (const std::string &cdata) |
| virtual void | addCData (const std::string &cdata) |
| virtual const std::string & | name () const |
| virtual const std::string & | cdata () const |
| virtual AttributeList & | attributes () |
| virtual const AttributeList & | attributes () const |
| virtual TagList & | children () |
| virtual const TagList & | children () const |
| virtual const std::string | findAttribute (const std::string &name) const |
| virtual bool | hasAttribute (const std::string &name, const std::string &value="") const |
| virtual Tag * | findChild (const std::string &name) const |
| virtual Tag * | findChild (const std::string &name, const std::string &attr, const std::string &value="") const |
| virtual bool | hasChild (const std::string &name, const std::string &attr="", const std::string &value="") const |
| virtual Tag * | findChildWithAttrib (const std::string &attr, const std::string &value="") const |
| virtual bool | hasChildWithAttrib (const std::string &attr, const std::string &value="") const |
| TagList | findChildren (const std::string &name) const |
| void | removeChild (Tag *tag) |
| virtual GLOOX_DEPRECATED bool | empty () const |
| bool | hasChildWithCData (const std::string &name, const std::string &cdata) const |
| Tag * | parent () const |
| virtual StanzaType | type () const |
| virtual Tag * | clone () const |
| Tag * | findTag (const std::string &expression) |
| Tag::TagList | findTagList (const std::string &expression) |
| bool | operator== (const Tag &right) const |
| bool | operator!= (const Tag &right) const |
| operator bool () const | |
Static Public Member Functions | |
| static const std::string | escape (std::string what) |
| static const std::string | relax (std::string what) |
Protected Types | |
| enum | XPathError { XPNoError, XPExpectedLeftOperand } |
Definition at line 32 of file tag.h.
|
|
An XML element's attribute. |
|
|
A list of XML element attributes. |
|
|
A list of Tags. |
|
|
XPath error conditions. |
|
|
Creates an empty tag.
|
|
||||||||||||||||
|
Creates a new tag with a given name (and XML character data, if given).
|
|
||||||||||||||||||||
|
Creates a new tag as a child tag of the given parent, with a given name (and XML character data, if given).
|
|
||||||||||||||||||||
|
Creates a new tag with a given name and an attribute.
|
|
||||||||||||||||||||||||
|
Creates a new tag as a child tag of the given parent, with a given name and an attribute.
|
|
|
Virtual destructor. |
|
||||||||||||
|
Use this function to add a new attribute to the tag. The value is a
|
|
||||||||||||
|
Use this function to add a new attribute to the tag. The value is an
|
|
||||||||||||
|
Use this function to add a new attribute to the tag.
|
|
|
Adds the string to the existing XML character data for this Tag.
|
|
|
Use this function to add a child node to the tag. The Tag will be owned by Tag.
|
|
|
Use this function to add a copy of the given element to the tag.
|
|
|
Use this function to fetch a const list of attributes.
|
|
|
Use this function to manipulate the list of attributes.
|
|
|
Use this function to retrieve the XML character data of an element.
|
|
|
Use this function to fetch a const list of child elements.
|
|
|
Use this function to manipulate the list of child elements.
|
|
|
This function creates a deep copy of this Tag.
|
|
|
Returns whether the Tag is considered empty, i.e. invalid.
|
|
|
Does some fancy escaping. (& --> &, etc).
|
|
|
This function can be used to retrieve the value of a Tag's attribute.
|
|
||||||||||||||||
|
This function finds and returns the first element within the child elements of the current tag, that has a certain name, and a certain attribute with a certain value.
|
|
|
This function finds and returns the first element within the child elements of the current tag that has a matching tag name.
|
|
|
Returns a list of child tags of the current tag with the given name.
|
|
||||||||||||
|
This function checks whether the Tag has a child element which posesses a given attribute with an optional value. The name of the child element does not matter.
|
|
|
Evaluates the given XPath expression and returns the result Tag. If more than one Tag match, only the first one is returned.
|
|
|
Evaluates the given XPath expression and returns the matched Tags.
|
|
||||||||||||
|
Checks whether the tag has a attribute with given name and optional value.
|
|
||||||||||||||||
|
This function checks whether the Tag has a child element with a given name, and optionally this child element is checked for having a given attribute with an optional value.
|
|
||||||||||||
|
This function checks whether the Tag has a child element which posesses a given attribute with an optional value. The name of the child element does not matter.
|
|
||||||||||||
|
This function checks whether a child element with given name exists and has XML character data that equals the given cdata string.
|
|
|
Use this function to retrieve the name of an element.
|
|
|
Returns true if the Tag is valid, false otherwise. |
|
|
Checks two Tags for inequality. Order of attributes and child tags does matter.
|
|
|
Checks two Tags for equality. Order of attributes and child tags does matter.
|
|
|
Returns the tag's parent Tag. |
|
|
Reverses operation of escape(). (& --> &).
|
|
|
Removes the given Tag from the list of child Tags.
|
|
|
Sets the given attributes. Any existing attributes are lost.
|
|
|
Sets the XML character data for this Tag.
|
|
|
Returns the stanza type.
|
|
|
This function can be used to retrieve the complete XML of a tag as a string. It includes all the attributes, child nodes and character data.
|
1.4.1