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, string tag)

Construct a Node from a value.

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

Construct a node from arrays of _keys and _values.

Members

Aliases

Pair
alias Pair = .Pair
Undocumented in source.
Value
alias Value = Algebraic!(YAMLNull, YAMLMerge, bool, long, real, ubyte[], SysTime, string, Node.Pair[], Node[])
Undocumented in source.
as
alias as = get

Shortcut for get().

Enums

allowed
eponymoustemplate allowed(T)
Undocumented in source.

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.

get
inout(T) get()
T get()

Get the value of the node as specified type.

mappingKeys
auto mappingKeys()

Return a range object iterating over mapping's keys.

mappingValues
auto mappingValues()

Return a range object iterating over mapping's values.

opApply
int opApply(D dg)

Foreach over a sequence, getting each element as T.

opApply
int opApply(DG dg)

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

opAssign
void opAssign(Node rhs)

Assignment (shallow copy) by value.

opBinaryRight
inout(Node*) opBinaryRight(K key)

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

opCmp
int opCmp(Node rhs)

Compare with another _node.

opEquals
bool opEquals(Node rhs)

Equality test.

opEquals
bool opEquals(T rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
inout(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.

setStyle
void setStyle(CollectionStyle style)
void setStyle(ScalarStyle style)

Sets the style of this node when dumped.

toHash
hash_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

convertsTo
bool convertsTo [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
debugString
uint debugString [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
isValid
bool isValid [@property getter]

Is this node valid (initialized)?

length
size_t length [@property getter]

If this is a collection, return its length.

nodeID
NodeID nodeID [@property getter]

Get the kind of node this is.

nodeTypeString
string nodeTypeString [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
startMark
Mark startMark [@property getter]

Return the start position of the node.

tag
string tag [@property getter]

Return tag of the node.

type
NodeType type [@property getter]

Get type of the node value.

Templates

mapping
template mapping()

Return a range object iterating over mapping's pairs.

sequence
template sequence(T = Node)

Return a range object iterating over a sequence, getting each element as T.

Variables

collectionStyle
CollectionStyle collectionStyle;
Undocumented in source.
scalarStyle
ScalarStyle scalarStyle;
Undocumented in source.
startMark_
Mark startMark_;
Undocumented in source.
tag_
string tag_;
Undocumented in source.
value_
Value value_;
Undocumented in source.

Meta