15 struct Error : std::runtime_error {
27 : std::runtime_error(message)
32 : std::runtime_error(message)
43 std::unique_ptr<Attribute>
next{};
54 std::unique_ptr<Element>
next{};
74 std::unique_ptr<Element>
root{};
Definition: utilities.hpp:182
Named attribute of an Element with an optional value.
Definition: xml.hpp:40
std::string name
Name of the attribute.
Definition: xml.hpp:41
std::unique_ptr< Attribute > next
Next neighboring attribute in the list that this attribute is part of.
Definition: xml.hpp:43
std::string value
Attribute value, or empty for no value.
Definition: xml.hpp:42
Tree of Element nodes defined by an XML file.
Definition: xml.hpp:60
std::unique_ptr< Element > root
Root element of the document tree.
Definition: xml.hpp:74
std::unique_ptr< Element > declaration
Optional XML declaration.
Definition: xml.hpp:73
static Document parse(std::string_view xmlString)
Parse a document from an XML string.
Node in a Document.
Definition: xml.hpp:49
std::string content
Raw non-element text content of the element.
Definition: xml.hpp:51
std::unique_ptr< Attribute > attributes
Linked list of element attributes.
Definition: xml.hpp:52
std::unique_ptr< Element > next
Next neighboring element in the list that this element is part of.
Definition: xml.hpp:54
std::unique_ptr< Element > children
Linked list of children of this element.
Definition: xml.hpp:53
std::string tag
Element tag name.
Definition: xml.hpp:50
Exception type for errors originating from the XML API.
Definition: xml.hpp:15
std::size_t lineNumber
Line number, starting at 1 for the first line, where the error occured.
Definition: xml.hpp:24
Error(const std::string &message, std::string_view::iterator position, std::size_t lineNumber)
Definition: xml.hpp:26
Error(const char *message, std::string_view::iterator position, std::size_t lineNumber)
Definition: xml.hpp:31
std::string_view::iterator position
Iterator into the source XML string where the error originated from.
Definition: xml.hpp:19