|
DocWire SDK
DocWire SDK: Deterministic, auditable, and secure data processing in C++20. On-premise by default. No compromises on computational speed.
|
XML processing utilities. More...
Classes | |
| class | attribute_ref |
| A reference to an XML attribute. More... | |
| class | attributes_view |
| A view over the attributes of an XML node. More... | |
| class | children_view |
| A view over the direct children of an XML node. More... | |
| class | descendants_view |
| A view over all descendants of an XML node (recursive). More... | |
| struct | iterator_state |
| Shared state for XML iterators to coordinate traversal. More... | |
| class | node_ref |
| A reference to the current XML node in the reader. More... | |
| class | nodes_view |
| A view over a sequence of XML nodes. More... | |
| class | reader |
| A forward-only, non-cached XML reader. More... | |
Enumerations | |
| enum class | reader_blanks { keep , ignore } |
| Options for handling blank nodes in the XML reader. More... | |
| enum class | node_type { none = 0 , element = 1 , attribute = 2 , text = 3 , cdata = 4 , entity_reference = 5 , entity = 6 , processing_instruction = 7 , comment = 8 , document = 9 , document_type = 10 , document_fragment = 11 , notation = 12 , whitespace = 13 , significant_whitespace = 14 , end_element = 15 , end_entity = 16 , xml_declaration = 17 } |
| Represents the type of an XML node. More... | |
Functions | |
| template<typename T, safety_policy safety_level> requires convert::conversion_implementation_exists<T, std::string_view> | |
| std::optional< T > | convert_impl (const attribute_ref< safety_level > &attr, convert::dest_type_tag< T >) noexcept |
| Conversion implementation to convert an attribute_ref to another type T. This is done by attempting to convert the attribute's string value. | |
| template<safety_policy safety_level> | |
| attributes_view< safety_level > | attributes (const node_ref< safety_level > &node) |
| A factory function to create an attributes_view with a specified safety policy. | |
| template<safety_policy safety_level> | |
| checked< std::optional< std::string_view >, safety_level > | attribute_value (const node_ref< safety_level > &node, std::string_view name) |
| A convenience helper to find an attribute by name. | |
| template<typename T, safety_policy safety_level> requires convert::conversion_implementation_exists<T, std::string_view> | |
| checked< std::optional< T >, safety_level > | attribute_value (const node_ref< safety_level > &node, std::string_view name) |
| A convenience helper to find an attribute by name and convert its value to a specific type. | |
| template<safety_policy safety_level> | |
| children_view< safety_level > | children (const node_ref< safety_level > &node) |
| Returns a view of the direct children of the given node. | |
| template<safety_policy safety_level> | |
| children_view< safety_level > | children (reader< safety_level > &reader) |
| Returns a view of the top-level children in the reader. | |
| template<safety_policy safety_level> | |
| descendants_view< safety_level > | descendants (const node_ref< safety_level > &node) |
| Returns a view of all descendants of the given node. | |
| template<safety_policy safety_level> | |
| descendants_view< safety_level > | descendants (reader< safety_level > &reader) |
| Returns a view of all descendants in the reader (entire document). | |
| template<typename T, safety_policy safety_level> requires convert::conversion_implementation_exists<T, std::string_view> | |
| std::optional< T > | convert_impl (const node_ref< safety_level > &node, convert::dest_type_tag< T >) noexcept |
| Conversion implementation to convert a node_ref to another type T. This is done by attempting to convert the node's string value. | |
| template<safety_policy safety_level> | |
| nodes_view< safety_level > | nodes (const node_ref< safety_level > &node) |
| Creates a view of nodes starting from the given node's state. | |
| template<safety_policy safety_level> | |
| nodes_view< safety_level > | nodes (reader< safety_level > &reader) |
| Creates a view of nodes from the reader. | |
| template<safety_policy safety_level> | |
| node_ref< safety_level > | root_element (reader< safety_level > &reader) |
| Finds and returns the root element of the XML document. | |
XML processing utilities.
|
strong |
Represents the type of an XML node.
Definition at line 30 of file xml_reader.h.
|
strong |
Options for handling blank nodes in the XML reader.
Definition at line 26 of file xml_reader.h.
| checked< std::optional< T >, safety_level > docwire::xml::attribute_value | ( | const node_ref< safety_level > & | node, |
| std::string_view | name ) |
A convenience helper to find an attribute by name and convert its value to a specific type.
| T | The target type for conversion. |
| safety_level | The safety policy for the node reference and attribute access. |
| node | The XML node to search within. |
| name | The name of the attribute to find. |
Definition at line 108 of file xml_attributes.h.
| checked< std::optional< std::string_view >, safety_level > docwire::xml::attribute_value | ( | const node_ref< safety_level > & | node, |
| std::string_view | name ) |
A convenience helper to find an attribute by name.
| safety_level | The safety policy to use. |
| node | The XML node to search within. |
| name | The name of the attribute to find. |
Definition at line 88 of file xml_attributes.h.
| attributes_view< safety_level > docwire::xml::attributes | ( | const node_ref< safety_level > & | node | ) |
A factory function to create an attributes_view with a specified safety policy.
| node | The XML node whose attributes will be viewed. |
| safety_level | The safety policy to use. |
Definition at line 73 of file xml_attributes.h.
| children_view< safety_level > docwire::xml::children | ( | const node_ref< safety_level > & | node | ) |
Returns a view of the direct children of the given node.
| safety_level | The safety policy to use. |
| node | The node to retrieve children for. |
Definition at line 119 of file xml_children.h.
| children_view< safety_level > docwire::xml::children | ( | reader< safety_level > & | reader | ) |
Returns a view of the top-level children in the reader.
| safety_level | The safety policy to use. |
| reader | The XML reader to traverse. |
Definition at line 132 of file xml_children.h.
|
noexcept |
Conversion implementation to convert an attribute_ref to another type T. This is done by attempting to convert the attribute's string value.
| T | The target type. |
| safety_level | The safety policy. |
Definition at line 57 of file xml_attribute_ref.h.
|
noexcept |
Conversion implementation to convert a node_ref to another type T. This is done by attempting to convert the node's string value.
| T | The target type. |
| safety_level | The safety policy. |
Definition at line 68 of file xml_node_ref.h.
| descendants_view< safety_level > docwire::xml::descendants | ( | const node_ref< safety_level > & | node | ) |
Returns a view of all descendants of the given node.
| safety_level | The safety policy to use. |
| node | The node to retrieve descendants for. |
Definition at line 128 of file xml_descendants.h.
| descendants_view< safety_level > docwire::xml::descendants | ( | reader< safety_level > & | reader | ) |
Returns a view of all descendants in the reader (entire document).
| safety_level | The safety policy to use. |
| reader | The XML reader to traverse. |
Definition at line 141 of file xml_descendants.h.
| nodes_view< safety_level > docwire::xml::nodes | ( | const node_ref< safety_level > & | node | ) |
Creates a view of nodes starting from the given node's state.
| safety_level | The safety policy. |
| node | The reference node. |
Definition at line 104 of file xml_nodes.h.
| nodes_view< safety_level > docwire::xml::nodes | ( | reader< safety_level > & | reader | ) |
Creates a view of nodes from the reader.
| safety_level | The safety policy. |
| reader | The XML reader. |
Definition at line 116 of file xml_nodes.h.
| node_ref< safety_level > docwire::xml::root_element | ( | reader< safety_level > & | reader | ) |
Finds and returns the root element of the XML document.
| safety_level | The safety policy to use. |
| reader | The XML reader to search. |
| docwire::error | with docwire::errors::uninterpretable_data tag attached if no root element is found. |
Definition at line 32 of file xml_root_element.h.