Class lsl::xml_element
ClassList > lsl > xml_element
#include <lsl_cpp.h>
Public Functions
| Type | Name |
|---|---|
| xml_element | append_child (const std::string & name) Append a child element with the specified name. |
| xml_element | append_child_value (const std::string & name, const std::string & value) |
| xml_element | append_copy (const xml_element & e) Append a copy of the specified element as a child. |
| xml_element | child (const std::string & name) const Get a child with a specified name. |
| const char * | child_value () const Get child value (value of the first child that is text). |
| const char * | child_value (const std::string & name) const Get child value of a child with a specified name. |
| bool | empty () const Whether this node is empty. |
| xml_element | first_child () const Get the first child of the element. |
| bool | is_text () const Is this a text body (instead of an XML element)? True both for plain char data and CData. |
| xml_element | last_child () const Get the last child of the element. |
| const char * | name () const Name of the element. |
| xml_element | next_sibling () const Get the next sibling in the children list of the parent node. |
| xml_element | next_sibling (const std::string & name) const Get the next sibling with the specified name. |
| xml_element | parent () const Get the parent node. |
| xml_element | prepend_child (const std::string & name) Prepend a child element with the specified name. |
| xml_element | prepend_child_value (const std::string & name, const std::string & value) |
| xml_element | prepend_copy (const xml_element & e) Prepend a child element with the specified name. |
| xml_element | previous_sibling () const Get the previous sibling in the children list of the parent node. |
| xml_element | previous_sibling (const std::string & name) const Get the previous sibling with the specified name. |
| void | remove_child (const std::string & name) Remove a child element with the specified name. |
| void | remove_child (const xml_element & e) Remove a specified child element. |
| bool | set_child_value (const std::string & name, const std::string & value) Set the text value of the (nameless) plain-text child of a named child node. |
| bool | set_name (const std::string & rhs) |
| bool | set_value (const std::string & rhs) |
| const char * | value () const Value of the element. |
| xml_element (lsl_xml_ptr obj=0) Constructor. |
Detailed Description
A lightweight XML element tree; models the .desc() field of stream_info.
Has a name and can have multiple named children or have text content as value; attributes are omitted. Insider note: The interface is modeled after a subset of pugixml's node type and is compatible with it. See also http://pugixml.googlecode.com/svn/tags/latest/docs/manual/access.html for additional documentation.
Public Functions Documentation
function append_child
Append a child element with the specified name.
function append_child_value
inline xml_element lsl::xml_element::append_child_value (
const std::string & name,
const std::string & value
)
Append a child node with a given name, which has a (nameless) plain-text child with the given text value.
function append_copy
Append a copy of the specified element as a child.
function child
Get a child with a specified name.
function child_value [1/2]
Get child value (value of the first child that is text).
function child_value [2/2]
Get child value of a child with a specified name.
function empty
Whether this node is empty.
function first_child
Get the first child of the element.
function is_text
Is this a text body (instead of an XML element)? True both for plain char data and CData.
function last_child
Get the last child of the element.
function name
Name of the element.
function next_sibling [1/2]
Get the next sibling in the children list of the parent node.
function next_sibling [2/2]
Get the next sibling with the specified name.
function parent
Get the parent node.
function prepend_child
Prepend a child element with the specified name.
function prepend_child_value
inline xml_element lsl::xml_element::prepend_child_value (
const std::string & name,
const std::string & value
)
Prepend a child node with a given name, which has a (nameless) plain-text child with the given text value.
function prepend_copy
Prepend a child element with the specified name.
function previous_sibling [1/2]
Get the previous sibling in the children list of the parent node.
function previous_sibling [2/2]
Get the previous sibling with the specified name.
function remove_child [1/2]
Remove a child element with the specified name.
function remove_child [2/2]
Remove a specified child element.
function set_child_value
Set the text value of the (nameless) plain-text child of a named child node.
inline bool lsl::xml_element::set_child_value (
const std::string & name,
const std::string & value
)
function set_name
Set the element's name.
Returns:
False if the node is empty (or if out of memory).
function set_value
Set the element's value.
Returns:
False if the node is empty (or if out of memory).
function value
Value of the element.
function xml_element
Constructor.
The documentation for this class was generated from the following file liblsl/include/lsl_cpp.h