doxybook::xml::element
Defined in header <doxybook/xml.hpp>
class element;
The data of an element nodes.
Public Functions
Member Functions | Description |
---|---|
(constructor) | Constructor. (function) |
(destructor) = default | Destructor. (function) |
all_child_elements const | Execute callback for all child element with a given name. (function) |
as_node const | Get as generic node. (function) |
next_sibling_element const | Get next sibling element. (function) |
next_sibling const | Get next sibling node. (function) |
first_child const | Get first child node. (function) |
first_child_element const | Get first child element node. (function) |
get_line const | Get line number in xml file. (function) |
get_document const | Get reference to document. (function) |
get_attr const | Get node attribute. (function) |
get_name const | Get node name. (function) |
has_text const | Check if node has text. (function) |
get_text const | Get node text. (function) |
operator bool const | Check if element is valid. (function) |
Public Functions
function element
Defined in header <doxybook/xml.hpp>
element() = default;
explicit element(tinyxml2::XMLElement * ptr);
- Constructor.
- Constructor from tinyxml element node.
Exception Safety
Basic exception guarantee.
function ~element
Defined in header <doxybook/xml.hpp>
~element() = default;
Destructor.
Exception Safety
Basic exception guarantee.
function all_child_elements
Defined in header <doxybook/xml.hpp>
void
all_child_elements(
std::string const & name,
element_callback const & callback) const;
Execute callback for all child element with a given name.
Exception Safety
Basic exception guarantee.
function as_node
Defined in header <doxybook/xml.hpp>
node
as_node() const;
Get as generic node.
Exception Safety
Basic exception guarantee.
function next_sibling_element
Defined in header <doxybook/xml.hpp>
element
next_sibling_element() const;
element
next_sibling_element(std::string const & name) const;
- Get next sibling element.
- Get next sibling element with the specified name.
Exception Safety
Basic exception guarantee.
function next_sibling
Defined in header <doxybook/xml.hpp>
node
next_sibling() const;
Get next sibling node.
Exception Safety
Basic exception guarantee.
function first_child
Defined in header <doxybook/xml.hpp>
node
first_child() const;
Get first child node.
Exception Safety
Basic exception guarantee.
function first_child_element
Defined in header <doxybook/xml.hpp>
element
first_child_element() const;
element
first_child_element(std::string const & name) const;
- Get first child element node.
- Get first child element with the specified name.
Exception Safety
Basic exception guarantee.
function get_line
Defined in header <doxybook/xml.hpp>
int
get_line() const;
Get line number in xml file.
Exception Safety
Basic exception guarantee.
function get_document
Defined in header <doxybook/xml.hpp>
xml const &
get_document() const;
Get reference to document.
Exception Safety
Basic exception guarantee.
function get_attr
Defined in header <doxybook/xml.hpp>
std::string
get_attr(std::string const & name) const;
std::string
get_attr(
std::string const & name,
std::string const & default_value) const;
- Get node attribute.
- Get node attribute or default value.
Exception Safety
Basic exception guarantee.
function get_name
Defined in header <doxybook/xml.hpp>
std::string
get_name() const;
Get node name.
Exception Safety
Basic exception guarantee.
function has_text
Defined in header <doxybook/xml.hpp>
bool
has_text() const;
Check if node has text.
Exception Safety
Basic exception guarantee.
function get_text
Defined in header <doxybook/xml.hpp>
std::string
get_text() const;
Get node text.
Exception Safety
Basic exception guarantee.
function operator bool
Defined in header <doxybook/xml.hpp>
operator bool() const;
Check if element is valid.
Exception Safety
Basic exception guarantee.
Updated on 2023-04-03