|
|
Donner
C++20 SVG rendering library
|
Represents an XML document, which holds a collection of XMLNode as the document tree. More...
#include "donner/base/xml/XMLDocument.h"
Public Member Functions | |
| XMLDocument () | |
| Constructor to create an empty XMLDocument. | |
| Registry & | registry () |
| Get the underlying ECS Registry, which holds all data for the document, for advanced use. | |
| std::shared_ptr< Registry > | sharedRegistry () const |
| Gets the registry as a shared pointer, for advanced use. | |
| XMLNode | root () const |
| Get the root XMLNdoe of the document. | |
| EntityHandle | rootEntityHandle () const |
| Get the root ECS Entity of the document, for advanced use. | |
Represents an XML document, which holds a collection of XMLNode as the document tree.
Each XMLNode may only belong to a single document, and each document can have only one root. XMLDocument is responsible for managing the lifetime of all elements in the document, by storing a shared pointer to the internal Registry data-store.
Data is stored using the Entity Component System (Entity Component System (ECS)) pattern, which is a data-oriented design optimized for fast data access and cache locality, particularly during rendering.
XMLDocument and XMLNode provide a facade over the ECS, and surface a familiar Document Object Model (DOM) API to traverse and manipulate the document tree, which is internally stored within Components in the ECS. This makes XMLNode a thin wrapper around an Entity, making the object lightweight and usable on the stack.
| donner::xml::XMLDocument::XMLDocument | ( | ) |
Constructor to create an empty XMLDocument.
To load a document from an XML file, use donner::xml::XMLParser.
| settings | Settings to configure the document. |