Read and write XML

enum xml::ParserOptions

Representation of available options to influence the behaviour of the XML parser.

ParserOptions satisfies the requirements of BitmaskType.

This means that the bitwise operators (e.g. operator| or operator&) are defined for this type. Thus options may be combined by OR-ing the respective values.

Note

No options have been implemented so far. As soon as this is done, provide an usage example, a list describing the member constants (options) and which options can be combined. Refer to std::filesystem::copy_options for an example.

Values:

none = 0x0

default behaviour

recursive_node_search = 0x1

recursively search whole xml for audioFormatExtended node

enum xml::WriterOptions

Representation of available options to influence the behaviour of the XML writer.

WriterOptions satisfies the requirements of BitmaskType.

This means that the bitwise operators (e.g. operator| or operator&) are defined for this type. Thus options may be combined by OR-ing the respective values.

Available options

At most one writer option in each of the following options groups may be present, otherwise the behavior is undefined.

Values:

none = 0x0

default behaviour

itu_structure = 0x1

use ITU xml structure

write_default_values = 0x2

write default values

std::shared_ptr<Document> adm::parseXml(const std::string &filename, xml::ParserOptions options = xml::ParserOptions::none)

Parse an XML representation of the Audio Definition Model.

Convenience wrapper for files using parseXml(std::istream&)

Parameters
  • filename: XML file to read and parse

  • options: Options to influence the XML parser behaviour

std::shared_ptr<Document> adm::parseXml(std::istream &stream, xml::ParserOptions options = xml::ParserOptions::none)

Parse an XML representation of the Audio Definition Model.

Parse adm data from an std::istream.

Parameters
  • stream: input stream to parse XML data

  • options: Options to influence the XML parser behaviour

void adm::writeXml(const std::string &filename, std::shared_ptr<const Document> admDocument, xml::WriterOptions options = xml::WriterOptions::none)

Write an Document.

Convenience wrapper for files using writeXml(std::ostream&, std::shared_ptr<const Document>)

Parameters
  • filename: XML file to write to

  • admDocument: ADM document that should be transformed into XML

  • options: Options to influence the XML generator behaviour

std::ostream &adm::writeXml(std::ostream &stream, std::shared_ptr<const Document> admDocument, xml::WriterOptions options = xml::WriterOptions::none)

Write an Document to an output stream.

Parameters
  • stream: output stream to write XML data

  • admDocument: ADM document that should be transformed into XML

  • options: Options to influence the XML generator behaviour