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

Implementation of IXmlDocument using tinyxml2. More...

#include <TinyXmlImpl.h>

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

Public Member Functions

void loadFromString (const std::string &xmlContent) override
 Loads XML content from a string.
 
void loadFromString (const std::vector< char > &xmlContent) override
 Loads XML content from a vector of characters.
 
std::shared_ptr< IXmlElementgetRootElement () const override
 Gets the root element of the document.
 

Detailed Description

Implementation of IXmlDocument using tinyxml2.

Member Function Documentation

◆ getRootElement()

std::shared_ptr< IXmlElement > musx::xml::tinyxml2::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.

◆ loadFromString() [1/2]

void musx::xml::tinyxml2::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.

◆ loadFromString() [2/2]

void musx::xml::tinyxml2::Document::loadFromString ( const std::vector< char > &  xmlContent)
inlineoverridevirtual

Loads XML content from a vector of characters.

Parameters
xmlContentThe XML content as a vector of characters.
Exceptions
musx::xml::load_errorif the load fails.

Implements musx::xml::IXmlDocument.