MUSX Document Model
Loading...
Searching...
No Matches
musx::factory::DocumentFactory Class Reference

Factory class for creating Document objects from XML. More...

#include <DocumentFactory.h>

+ Inheritance diagram for musx::factory::DocumentFactory:

Static Public Member Functions

template<typename XmlDocumentType >
static DocumentPtr create (const char *data, size_t size, dom::PartVoicingPolicy partVoicingPolicy=dom::PartVoicingPolicy::Ignore)
 Creates a Document object from an XML buffer.
 
template<typename XmlDocumentType >
static DocumentPtr create (const std::vector< char > &xmlBuffer, dom::PartVoicingPolicy partVoicingPolicy=dom::PartVoicingPolicy::Ignore)
 Creates a Document object from an XML buffer.
 

Detailed Description

Factory class for creating Document objects from XML.

Member Function Documentation

◆ create() [1/2]

template<typename XmlDocumentType >
static DocumentPtr musx::factory::DocumentFactory::create ( const char *  data,
size_t  size,
dom::PartVoicingPolicy  partVoicingPolicy = dom::PartVoicingPolicy::Ignore 
)
inlinestatic

Creates a Document object from an XML buffer.

Parameters
dataPointer to a buffer containing EnigmaXML for a musx file.
sizeThe size of the buffer.
partVoicingPolicyWhether to ignore or apply part voicing as defined by dom::others::PartVoicing (when it exists).
Returns
A fully populated Document object.
Exceptions
std::invalid_argumentIf required nodes or attributes are missing or invalid.

◆ create() [2/2]

template<typename XmlDocumentType >
static DocumentPtr musx::factory::DocumentFactory::create ( const std::vector< char > &  xmlBuffer,
dom::PartVoicingPolicy  partVoicingPolicy = dom::PartVoicingPolicy::Ignore 
)
inlinestatic

Creates a Document object from an XML buffer.

Parameters
xmlBufferBuffer containing EnigmaXML for a musx file.
partVoicingPolicyWhether to ignore or apply part voicing as defined by dom::others::PartVoicing (when it exists).
Returns
A fully populated Document object.
Exceptions
std::invalid_argumentIf required nodes or attributes are missing or invalid.