dyaml.composer

Composes nodes from YAML events provided by parser. Code based on PyYAML: http://www.pyyaml.org

struct Composer

Types 1

structComposer

Composes YAML documents from events provided by a Parser.

Fields
Parser parser_Parser providing YAML events.
Resolver resolver_Resolver resolving tags (data types).
Node[string] anchors_Nodes associated with anchors. Used by YAML aliases.
Appender!(Node.Pair[])[] pairAppenders_Used to reduce allocations when creating pair arrays.
Appender!(Node[])[] nodeAppenders_Used to reduce allocations when creating node arrays.
Methods
bool checkNode() @safeDetermine if there are any nodes left.
Node getNode() @safeGet a YAML document as a node (the root of the document).
inout(string) name() ref inout @safe return pure nothrow @nogcSet file name.
Mark mark() const @safe pure nothrow @nogcGet a mark from the current reader position
Resolver resolver() ref @safe return pure nothrow @nogcGet resolver
void skipExpected(const EventID id) @safe
void ensureAppendersExist(const uint pairAppenderLevel, const uint nodeAppenderLevel) @safeEnsure that appenders for specified nesting levels exist.
Node composeDocument() @safeCompose a YAML document and return its root node.
Node composeNode(const uint pairAppenderLevel, const uint nodeAppenderLevel) @safeCompose a node.
Node composeScalarNode() @safeCompose a scalar node.
Node composeSequenceNode(const uint pairAppenderLevel, const uint nodeAppenderLevel) @safeCompose a sequence node.
Node.Pair[] flatten(ref Node root, const Mark startMark, const Mark endMark, const uint pairAppenderLevel, const uint nodeAppenderLevel) @safeFlatten a node, merging it with nodes referenced through YAMLMerge data type.
Node composeMappingNode(const uint pairAppenderLevel, const uint nodeAppenderLevel) @safeCompose a mapping node.
Constructors
this(Parser parser, Resolver resolver)Construct a composer.