Constructor

Constructs YAML values.

Each YAML scalar, sequence or mapping has a tag specifying its data type. Constructor uses user-specifyable functions to create a node of desired data type from a scalar, sequence or mapping.

More...

Constructors

this
this(const Flag!"useDefaultConstructors" defaultConstructors = Yes.useDefaultConstructors)

Construct a Constructor.

Destructor

~this
~this()

Destroy the constructor.

Members

Functions

addConstructorMapping
void addConstructorMapping(const string tag, T function(ref Node) ctor)

Add a constructor function from a mapping.

addConstructorScalar
void addConstructorScalar(const string tag, T function(ref Node) ctor)

Add a constructor function from scalar.

addConstructorSequence
void addConstructorSequence(const string tag, T function(ref Node) ctor)

Add a constructor function from sequence.

Detailed Description

Each of these functions is associated with a tag, and can process either a scalar, a sequence, or a mapping. The constructor passes each value to the function with corresponding tag, which then returns the resulting value that can be stored in a node.

If a tag is detected with no known constructor function, it is considered an error.

Meta