Node

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.

Constructors

this
this(T value, const string tag = null)
this(T value, const string tag = null)

Construct a Node from a value.

this
this(T[] array, const string tag = null)

Construct a node from an _array.

this
this(V[K] array, const string tag = null)

Construct a node from an associative _array.

this
this(K[] keys, V[] values, const string tag = null)

Construct a node from arrays of _keys and _values.

Members

Aliases

as
alias as = get

Shortcut for get().

Functions

add
void add(T value)

Add an element to a sequence.

add
void add(K key, V value)

Add a key-value pair to a mapping.

contains
bool contains(T rhs)

Determine if a collection contains specified value.

containsKey
bool containsKey(T rhs)

Determine if a mapping contains specified key.

opApply
int opApply(int delegate(ref T) dg)

Foreach over a sequence, getting each element as T.

opApply
int opApply(int delegate(ref K, ref V) dg)

Foreach over a mapping, getting each key/value as K/V.

opAssign
void opAssign(Node rhs)

Assignment (shallow copy) by value.

opAssign
void opAssign(ref Node rhs)

Assignment (shallow copy) by reference.

opBinaryRight
Node* opBinaryRight(K key)

Determine whether a key is in a mapping, and access its value.

opCmp
int opCmp(ref const Node node)

Compare with another _node.

opEquals
bool opEquals(const auto ref T rhs)

Equality test.

opIndex
Node opIndex(T index)

Get the element at specified index.

opIndexAssign
void opIndexAssign(V value, K index)

Set element at specified index in a collection.

remove
void remove(T rhs)

Remove first (if any) occurence of a value in a collection.

removeAt
void removeAt(T index)

Remove element at the specified index of a collection.

Properties

get
T get [@property getter]
T get [@property getter]

Get the value of the node as specified type.

isMapping
bool isMapping [@property getter]

Is this node a mapping?

isNull
bool isNull [@property getter]

Is this node null?

isScalar
bool isScalar [@property getter]

Is this node a scalar value?

isSequence
bool isSequence [@property getter]

Is this node a sequence?

isUserType
bool isUserType [@property getter]

Is this node a user defined type?

isValid
bool isValid [@property getter]

Is this node valid (initialized)?

length
size_t length [@property getter]

If this is a collection, return its length.

tag
string tag [@property getter]

Return tag of the node.

Meta