xmlwrapp
Lightweight C++ XML parsing library
|
This class implements a view of XML nodes. More...
#include <nodes_view.h>
Classes | |
class | const_iterator |
The const_iterator provides a way to access nodes in the view similar to a standard C++ container. More... | |
class | iterator |
The iterator provides a way to access nodes in the view similar to a standard C++ container. More... | |
Public Types | |
typedef std::size_t | size_type |
Size type. More... | |
Public Member Functions | |
iterator | begin () |
Get an iterator that points to the beginning of this view's nodes. More... | |
const_iterator | begin () const |
Get an iterator that points to the beginning of this view's nodes. More... | |
iterator | end () |
Get an iterator that points one past the last child for this view. More... | |
const_iterator | end () const |
Get an iterator that points one past the last child for this view. More... | |
size_type | size () const |
Returns the number of nodes in this view. More... | |
bool | empty () const |
Is the view empty? More... | |
iterator | erase (const iterator &to_erase) |
Erase the node that is pointed to by the given iterator. More... | |
iterator | erase (iterator first, const iterator &last) |
Erase all nodes in the given range, from first to last. More... | |
This class implements a view of XML nodes.
A view is a container-like class that only allows access to a subset of xml::node's child nodes. The exact content depends on how the view was obtained; typical uses are e.g. a view of all element children or all elements with a given name.
The nodes_view class implements the same container interface that xml::node does: it has begin() and end() methods.
typedef std::size_t xml::nodes_view::size_type |
Size type.
|
inline |
Get an iterator that points to the beginning of this view's nodes.
|
inline |
Get an iterator that points to the beginning of this view's nodes.
|
inline |
Is the view empty?
|
inline |
Get an iterator that points one past the last child for this view.
|
inline |
Get an iterator that points one past the last child for this view.
Erase the node that is pointed to by the given iterator.
The node and all its children will be removed from its parent node. This will invalidate any iterators that point to the node to be erased, or any pointers or references to that node (but not any other iterators).
to_erase | An iterator that points to the node to be erased. |
Erase all nodes in the given range, from first to last.
This will invalidate any iterators that point to the nodes to be erased, or any pointers or references to those nodes.
first | The first node in the range to be removed. |
last | An iterator that points one past the last node to erase. Think xml::node::end(). |
size_type xml::nodes_view::size | ( | ) | const |
Returns the number of nodes in this view.