|
sprint 1-alpha
|
#include <uxml.h>
Inherited by sprint::xml::document.
Public Types | |
| typedef node_list_t::const_iterator | const_iterator |
| typedef node_list_t::iterator | iterator |
Public Member Functions | |
| node () | |
| empty costructor | |
| node (const char *p_id) | |
| costructor with a classname | |
| const_iterator | cbegin () const |
| Iterator on childs. | |
| const_iterator | cend () const |
| Iterator on childs. | |
| void | add (const node &n) |
| bool | find_attr (const std::string &key, std::string &value) const |
| Find a key in the attr vector. | |
| template<class T > | |
| void | set_attr (const std::string &key, T value) |
| template<class T > | |
| T | get_attr (const std::string &key, T _default) const |
| bool | has_child () const |
| Has at least one child? | |
| const node & | first_child () const |
| node & | first_child () |
| Return the first CHild (have to check before if have child) | |
| node * | find_child_by_class (const char *classid) |
| const node * | find_child_by_class (const char *classid) const |
| node & | set_text (const char *txt) |
| node & | set_text (const std::string &txt) |
Public Attributes | |
| std::string | id |
| XML Node ID. | |
| std::string | text |
| XML Node Text. | |
| attr_list_t | attr |
| Attribute lists. | |
| node_list_t | child |
| Child. | |
An XML node
| void sprint::xml::node::add | ( | const node & | n | ) |
append a new child
| node* sprint::xml::node::find_child_by_class | ( | const char * | classid | ) |
find a child by his class ID
sprint::xml::node * palette = dom.find_child_by_class("palette"); if(palette) { .. do something ... }
| const node& sprint::xml::node::first_child | ( | ) | const |
Return the first CHild (have to check before if have child)
const sprint::xml::node & tile = xml.first_child();
| T sprint::xml::node::get_attr | ( | const std::string & | key, |
| T | _default | ||
| ) | const |
| void sprint::xml::node::set_attr | ( | const std::string & | key, |
| T | value | ||
| ) |
| node& sprint::xml::node::set_text | ( | const char * | txt | ) |
set text
root.add(sprint::xml::node("name").set_text("mandelbrot"));
1.7.4