Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::xml::XMLDocument Class Reference

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.
 
Registryregistry ()
 Get the underlying ECS Registry, which holds all data for the document, for advanced use.
 
const Registryregistry () const
 Get the underlying ECS Registry, which holds all data for the document, for advanced use.
 
std::shared_ptr< RegistrysharedRegistry () 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.
 
bool operator== (const XMLDocument &other) const
 Returns true if the two XMLDocument handles reference the same underlying document.
 

Friends

class XMLNode
 

Detailed Description

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.

See also
XMLNode
Entity Component System (ECS)

Constructor & Destructor Documentation

◆ XMLDocument()

donner::xml::XMLDocument::XMLDocument ( )

Constructor to create an empty XMLDocument.

To load a document from an XML file, use donner::base::xml::XMLParser.

Parameters
settingsSettings to configure the document.

The documentation for this class was generated from the following files: