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.

struct Node {}

Constructors

this
this(T value, string tag)

Construct a Node from a value.

this
this(T[] array, string tag)

Construct a node from an _array.

this
this(V[K] array, string tag)

Construct a node from an associative _array.

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[], YAMLObject)
Undocumented in source.
as
alias as = get

Shortcut for get().

isBinary
alias isBinary = isType!(ubyte[])
Undocumented in source.
isBool
alias isBool = isType!bool
Undocumented in source.
isFloat
alias isFloat = isType!real
Undocumented in source.
isInt
alias isInt = isType!long
Undocumented in source.
isString
alias isString = isType!string
Undocumented in source.
isTime
alias isTime = isType!SysTime
Undocumented in source.

Enums

scalarCtorNothrow
eponymoustemplate scalarCtorNothrow(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.

cmp
int cmp(Node rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
contains
bool contains(T rhs)

Determine if a collection contains specified value.

containsKey
bool containsKey(T rhs)

Determine if a mapping contains specified key.

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

Compare with another _node.

opEquals
bool opEquals(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.

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.
get
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?

isType
bool isType [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
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.

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

Return tag of the node.

type
TypeInfo type [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

rawNode
Node rawNode(Value value, Mark startMark, Tag tag, ScalarStyle scalarStyle, CollectionStyle collectionStyle)
Undocumented in source. Be warned that the author may not have intended to support it.
userValue
Value userValue(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
value
Value value(T value)
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

allowed
template allowed(T)
Undocumented in source.

Variables

collectionStyle
CollectionStyle collectionStyle;
Undocumented in source.
scalarStyle
ScalarStyle scalarStyle;
Undocumented in source.
tag_
Tag tag_;
Undocumented in source.

Meta