#include <tag.h>
Public Types | |
| typedef std::list< Attribute * > | AttributeList |
Public Member Functions | |
| Tag (const std::string &name, const std::string &cdata=EmptyString) | |
| Tag (Tag *parent, const std::string &name, const std::string &cdata=EmptyString) | |
| Tag (const std::string &name, const std::string &attrib, const std::string &value) | |
| Tag (Tag *parent, const std::string &name, const std::string &attrib, const std::string &value) | |
| virtual | ~Tag () |
| const std::string | xml () const |
| bool | setPrefix (const std::string &prefix) |
| const std::string & | prefix () const |
| const std::string & | prefix (const std::string &xmlns) const |
| bool | setXmlns (const std::string &xmlns, const std::string &prefix=EmptyString) |
| const std::string & | xmlns () const |
| const std::string & | xmlns (const std::string &prefix) const |
| bool | addAttribute (Attribute *attr) |
| bool | addAttribute (const std::string &name, const std::string &value) |
| bool | addAttribute (const std::string &name, int value) |
| bool | addAttribute (const std::string &name, long value) |
| void | setAttributes (const AttributeList &attributes) |
| void | addChild (Tag *child) |
| void | addChildCopy (const Tag *child) |
| bool | setCData (const std::string &cdata) |
| bool | addCData (const std::string &cdata) |
| const std::string & | name () const |
| const std::string | cdata () const |
| const AttributeList & | attributes () const |
| const TagList & | children () const |
| const std::string & | findAttribute (const std::string &name) const |
| bool | hasAttribute (const std::string &name, const std::string &value=EmptyString) const |
| Tag * | findChild (const std::string &name) const |
| Tag * | findChild (const std::string &name, const std::string &attr, const std::string &value=EmptyString) const |
| bool | hasChild (const std::string &name, const std::string &attr=EmptyString, const std::string &value=EmptyString) const |
| Tag * | findChildWithAttrib (const std::string &attr, const std::string &value=EmptyString) const |
| bool | hasChildWithAttrib (const std::string &attr, const std::string &value=EmptyString) const |
| TagList | findChildren (const std::string &name, const std::string &xmlns=EmptyString) const |
| void | removeChild (const std::string &name, const std::string &xmlns=EmptyString) |
| void | removeChild (Tag *tag) |
| void | removeAttribute (const std::string &attr, const std::string &value=EmptyString, const std::string &xmlns=EmptyString) |
| bool | hasChildWithCData (const std::string &name, const std::string &cdata) const |
| Tag * | parent () const |
| Tag * | clone () const |
| const std::string | findCData (const std::string &expression) const |
| const Tag * | findTag (const std::string &expression) const |
| ConstTagList | findTagList (const std::string &expression) const |
| bool | operator== (const Tag &right) const |
| bool | operator!= (const Tag &right) const |
| operator bool () const | |
Classes | |
| class | Attribute |
Definition at line 46 of file tag.h.
|
|
A list of XML element attributes. |
|
||||||||||||
|
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.
|
|
|
Use this function to add a new attribute to the tag. The Tag will become the owner of the Attribute and take care of deletion. If an Attribute with the same name already exists, it will be replaced by the new one.
|
|
|
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 retrieve the XML character data of an element.
|
|
|
Use this function to fetch a const list of child elements.
|
|
|
This function creates a deep copy of this Tag.
|
|
|
This function can be used to retrieve the value of a Tag's attribute.
|
|
|
Evaluates the given XPath expression and returns the result Tag's character data, if any. If more than one Tag match, only the first one's character data is returned.
|
|
||||||||||||||||
|
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. |
|
|
Returns the namespace prefix for the given namespace.
|
|
|
Returns the namespace prefix for this Tag, if any.
|
|
||||||||||||||||
|
Removes the attribute with the given name and optional value from this Tag.
|
|
|
Removes the given Tag from the list of child Tags.
|
|
||||||||||||
|
Removes and deletes all child tags that have the given name and are, optionally, within the given namespace.
|
|
|
Sets the given attributes. Any existing attributes are lost.
|
|
|
Sets the XML character data for this Tag.
|
|
|
Sets the Tag's namespace prefix.
|
|
||||||||||||
|
Sets an XML namespace with a given prefix, or the default namespace if
|
|
|
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.
|
|
|
Returns the namespace for the given prefix, or the default namespace if <foo:bar xmlns:foo='foobar'/> foobar namespace, having a prefix of foo. A call to prefix() will return 'foo'. A call to xmlns( "foo" ) or xmlns( prefix() ) will return 'foobar'. A call to xmlns() will also return 'foobar' (it is a shortcut to xmlns( prefix() ).
|
|
|
Returns the namespace for this element. Namespace declarations in parent tags as well as prefixes will be taken into account.
|
1.4.1