Read and write XML

enum 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:

enumerator none

default behaviour

enumerator recursive_node_search

recursively search whole xml for audioFormatExtended node

enum 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.

Constant

Meaning

options controlling the XML envelope

none

use <ebuCoreMain> envelope (default)

itu_structure

use <ituADM> to contain the ADM elements

options controlling default values

none

use <ebuCoreMain> envelope (default)

write_default_values

use <ebuCoreMain> envelope (default)

Values:

enumerator none

default behaviour

enumerator itu_structure

use ITU xml structure

enumerator write_default_values

write default values

std::shared_ptr<Document> 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> 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 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 &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