|
ui-gxmlcpp 1.4.6
|
A XML node. More...
#include <Tree.hpp>


Public Types | |
| typedef xmlElementType | Type |
| Abstract from libxml2 type. | |
Public Member Functions | |
| Node (xmlNode *const node=0) | |
| Constructor from libxml2 node. | |
| bool | isNull () const |
| Test if this is null ("not a tree node"). | |
| void | unlink () |
| Unlink this node (from underlying tree). Memory will be freed, and the node becomes a null node. | |
| NodeSet | getChilds (std::string const &name="") const |
| Get all child nodes of this node. | |
| Type | getType () const |
| Get node type. | |
| std::string | getXPath () const |
| Get associated XPath. | |
| char const * | hasAttribute (std::string const &name) const |
| Returns 0 if not found, else the attribute's content. | |
| char const * | getAttributeC (std::string const &name) const |
| Like above, but always return valid c string (length 0 if not found). | |
| std::string | getAttribute (std::string const &name) const |
| Like above, but return std::string. | |
| void | setAttribute (std::string const &name, std::string const &content) |
| Node | addChild (std::string const &name, std::string const &content="") |
| Add a new (element) child node. | |
| Node | addChild (Node const &n) |
| Add a (deep) copy of this node. | |
| Node | addSiblingAfter (std::string const &name, std::string const &content) |
| Add a new (element) sibling node. | |
| Node | addSiblingAfter (Node const &n) |
| Add a (deep) copy of this node as a sibling. | |
| std::string | dump (bool const &format=false, std::string const &encoding=DefaultEncoding_) const |
| Dump shortcut. | |
Navigate through the tree. | |
| Node | getParent () const |
| Node | getChild () const |
| Node | getNext () const |
| Node | getPrev () const |
Get/set name of node. | |
| char const * | getNameC () const |
| std::string | getName () const |
| void | setName (std::string const &name) |
Get/set text content of first child node. | |
| char const * | getContentC () const |
| std::string | getContent () const |
| void | setContent (std::string const &content) |
Xpath evaluation on this node. | |
| NodeSet | getNodeSet (std::string const &xpath) const |
| Node | getNode (std::string const &xpath, bool const &doThrow=true) const |
Friends | |
| class | NodeSet |
A XML node.
| char const * UI::GXML::Tree::Node::getNameC | ( | ) | const |
| Tree::NodeSet UI::GXML::Tree::Node::getNodeSet | ( | std::string const & | xpath | ) | const |
References UI::GXML::Tree::XPathContext.
| Tree::Node UI::GXML::Tree::Node::getParent | ( | ) | const |
If a node does not exists, the returned node isNull().
| void UI::GXML::Tree::Node::setName | ( | std::string const & | name | ) |
Referenced by UI::GXML::Tree::setName().