MUSX Document Model
Loading...
Searching...
No Matches
musx::xml::rapidxml::Document Class Reference

Implementation of IXmlDocument using rapidxml. More...

#include <RapidXmlImpl.h>

+ Inheritance diagram for musx::xml::rapidxml::Document:

Public Member Functions

void loadFromString (const std::string &xmlContent) override
 Loads XML content from a string.
 
void loadFromBuffer (const char *data, size_t size) override
 Loads XML content from buffer.
 
std::shared_ptr< IXmlElementgetRootElement () const override
 Gets the root element of the document.
 
- Public Member Functions inherited from musx::xml::IXmlDocument
void loadFromString (const std::vector< char > &xmlContent)
 Loads XML content from a vector of characters.
 

Detailed Description

Implementation of IXmlDocument using rapidxml.

Member Function Documentation

◆ getRootElement()

std::shared_ptr< IXmlElement > musx::xml::rapidxml::Document::getRootElement ( ) const
inlineoverridevirtual

Gets the root element of the document.

Returns
A shared pointer to the root element, or nullptr if the document is empty.

Implements musx::xml::IXmlDocument.

◆ loadFromBuffer()

void musx::xml::rapidxml::Document::loadFromBuffer ( const char *  data,
size_t  size 
)
inlineoverridevirtual

Loads XML content from buffer.

Parameters
datapointer to the XML content.
sizesize of the XML content.
Exceptions
musx::xml::load_errorif the load fails.

Implements musx::xml::IXmlDocument.

◆ loadFromString()

void musx::xml::rapidxml::Document::loadFromString ( const std::string &  xmlContent)
inlineoverridevirtual

Loads XML content from a string.

Parameters
xmlContentThe XML content as a string.
Exceptions
musx::xml::load_errorif the load fails.

Implements musx::xml::IXmlDocument.