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(Flag!"useDefaultConstructors" defaultConstructors)

Construct a Constructor.

Destructor

~this
~this()

Destroy the constructor.

Members

Functions

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

Add a constructor function from a mapping.

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

Add a constructor function from scalar.

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

Add a constructor function from sequence.

node
Node node(Mark start, Mark end, Tag tag, T value, U style)
Undocumented in source. Be warned that the author may not have intended to support it.

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