dyaml.node

Node of a YAML document. Used to read YAML data once it's loaded, and to prepare data to emit.

Types 7

enumNodeID : ubyte
scalar
sequence
mapping
invalid
structYAMLNull

Null YAML type. Used in nodes with _null values.

Methods
string toString() const pure @safe nothrowUsed for string conversion.
private structYAMLInvalid

Invalid YAML type, used internally by SumType

structYAMLMerge
private structPair
Fields
Node keyKey node.
Node valueValue node.
Methods
bool opEquals(const ref Pair rhs) const scope @safeEquality test with another Pair.
int opCmp(const scope ref Pair rhs) const scope @safe
void toString(scope void delegate(scope const(char)[]) @safe sink) const scope @safe
Constructors
this(K key, V value)Construct a Pair from two values. Will be converted to Nodes if needed.
null_
merge
boolean
integer
decimal
binary
timestamp
string
mapping
sequence
invalid
structNode

YAML node.

This is a pseudo-dynamic type that can store any YAML value, including a sequence or mapping of nodes. You can get data from a Node directly or iterate over it if it's a collection.

Fields
Value value_
Mark startMark_
string tag_
ScalarStyle scalarStyle
CollectionStyle collectionStyle
Methods
bool isValid() @property const scope @safe pure nothrow @nogcIs this node valid (initialized)?
string tag() @property const return scope @safe pure nothrow @nogcReturn tag of the node.
Mark startMark() @property const return scope @safe pure nothrow @nogcReturn the start position of the node.
bool opEquals(const scope Node rhs) const scope @safeEquality test.
bool opEquals(T)(const scope auto ref T rhs) const @safe
inout(T) get(T, Flag!"stringConversion" stringConversion = Yes.stringConversion)() inout @safe return scopeGet the value of the node as specified type.
T get(T)() if (hasIndirections!(Unqual!T) && hasNodeConstructor!(Unqual!T) && (!hasNodeConstructor!(inout(Unqual!T)))) constditto
size_t length() @property const @safeIf this is a collection, return its length.
inout(Node) opIndex(T)(T index) ref inout return scope @safeGet the element at specified index.
bool contains(T)(T rhs) constDetermine if a collection contains specified value.
bool containsKey(T)(T rhs) constDetermine if a mapping contains specified key.
void opAssign()(auto ref Node rhs)Assignment (shallow copy) by value.
void opIndexAssign(K, V)(V value, K index)Set element at specified index in a collection.
auto mappingKeys(K = Node)() constReturn a range object iterating over mapping's keys.
auto mappingValues(V = Node)() constReturn a range object iterating over mapping's values.
int opApply(D)(D dg) if (isDelegate!D && (Parameters!D.length == 1))Foreach over a sequence, getting each element as T.
int opApply(D)(D dg) if (isDelegate!D && (Parameters!D.length == 1)) constditto
int opApply(DG)(DG dg) if (isDelegate!DG && (Parameters!DG.length == 2))Foreach over a mapping, getting each key/value as K/V.
int opApply(DG)(DG dg) if (isDelegate!DG && (Parameters!DG.length == 2)) constditto
void add(T)(T value)Add an element to a sequence.
void add(K, V)(K key, V value)Add a key-value pair to a mapping.
inout(Node *) opBinaryRight(string op, K)(K key) if (op == "in") inoutDetermine whether a key is in a mapping, and access its value.
void remove(T)(T rhs)Remove first (if any) occurence of a value in a collection.
void removeAt(T)(T index)Remove element at the specified index of a collection.
int opCmp(const scope ref Node rhs) const scope @safeCompare with another node.
hash_t toHash() nothrow const @trusted
NodeType type() @property const scope @safe pure nothrow @nogcGet type of the node value.
NodeID nodeID() @property const scope @safe pure nothrow @nogcGet the kind of node this is.
string debugString(uint level = 0) @property const scope @safe
string nodeTypeString() @property const scope @safe pure nothrow @nogc
bool convertsTo(T)() @property const
void setStyle(CollectionStyle style) @safeSets the style of this node when dumped.
void setStyle(ScalarStyle style) @safeDitto
bool isType(T)() @property const
bool contains_(T, Flag!"key" key, string func)(T rhs) constCheck at compile time if a type is stored natively
void remove_(T, Flag!"key" key, string func)(T rhs)
sizediff_t findPair(T, Flag!"key" key = Yes.key)(const scope ref T index) const scope @safe
void checkSequenceIndex(T)(T index) const scope @safe
inout(T) getValue(T)() @safe return scope inout
inout(T) coerceValue(T)() @trusted scope return inout
void setValue(T)(T value) @trusted
void toString(DGT)(scope DGT sink) const scope @safe
Constructors
this(T value, const string tag = null)Construct a Node from a value.
this(K[] keys, V[] values, const string tag = null)Construct a node from arrays of keys and values.
Nested Templates
sequence(T = Node)Return a range object iterating over a sequence, getting each element as T.
mapping()Return a range object iterating over mapping's pairs.

Functions 1

fnvoid merge(ref Appender!(Node.Pair[]) pairs, Node.Pair[] toMerge) @safe

Templates 2

tmplhasSimpleNodeConstructor(T)
tmplhasExpandedNodeConstructor(T)