|
| | reader (std::string_view xml_sv, reader_blanks blanks_option=reader_blanks::keep) |
| | Constructs a reader from a string view. More...
|
| |
| bool | read_next () const |
| | Advances the reader to the next node. More...
|
| |
|
std::string_view | content () const |
| | Returns the content of the current node (e.g., text inside an element).
|
| |
|
std::string_view | name () const |
| | Returns the local name of the current node.
|
| |
|
std::string_view | full_name () const |
| | Returns the full name (including namespace) of the current node.
|
| |
|
std::string_view | string_value () const |
| | Returns the string value of the current node (concatenated text of children).
|
| |
| bool | move_to_first_attribute () const |
| | Moves the reader to the first attribute of the current element. More...
|
| |
| bool | move_to_next_attribute () const |
| | Moves the reader to the next attribute. More...
|
| |
| void | move_to_element () const noexcept(safety_level==relaxed) |
| | Moves the reader back to the element containing the attributes. More...
|
| |
|
non_negative< int, safety_level > | depth () const |
| | Returns the depth of the current node in the XML tree.
|
| |
|
node_type | type () const |
| | Returns the type of the current node.
|
| |
template<safety_policy safety_level = default_safety_level>
class docwire::xml::reader< safety_level >
A forward-only, non-cached XML reader.
This class provides a wrapper around libxml2's xmlTextReader, offering a modern C++ interface with configurable safety policies.
- Template Parameters
-
| safety_level | The safety policy to use (strict or relaxed). |
- Warning
- This is a single-pass reader. Once the reader advances, previous nodes cannot be revisited.
- See also
- XML parsing example
Definition at line 63 of file xml_reader.h.