DataNode

A node containing data for (de)serialization.

Constructors

this
this(T value)

Constructs a boolean data node.

this
this(T value)

Constructs a signed integer data node.

this
this(T value)

Constructs an unsigned integer data node.

this
this(T value)

Constructs a floating point data node.

this
this(string value)

Constructs a string data node.

this
this(ubyte[] value)

Constructs a string data node.

this
this(typeof(this) rhs)

Copy constructor

Destructor

~this
~this()

Destructor

Members

Functions

isType
bool isType(inout(DataNodeType) type)

Gets whether this DataNode contains data of the given type.

opBinaryRight
inout(DataNode)* opBinaryRight(string key)

Gets whether the given key is present in the object.

opEquals
bool opEquals(DataNode other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(T other)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
DataNode opIndex(string key)

Gets the given entry in the object.

opIndex
DataNode opIndex(size_t idx)

Gets the given entry in the array.

opIndexAssign
void opIndexAssign(T value, string key)

Assigns an element of the object node.

opIndexAssign
void opIndexAssign(T rhs, size_t idx)

Assigns an element of the array node.

opOpAssign
void opOpAssign(DataNode rhs)

Adds the given entry into the array.

remove
void remove(string key)

Removes the given key from the object.

remove
void remove(size_t idx)

Removes the given index from the array.

toString
string toString()

Converts the DataNode to a string.

tryCoerce
T tryCoerce(T defaultValue)

Coerces the value of the DataNode to the given type, if possible.

Properties

array
RcArray!DataNode array [@property getter]

The array in the DataNode object, or null.

blob
ubyte[] blob [@property getter]

A blob of binary data, or null.

boolean
bool boolean [@property getter]

The boolean content of the datanode, or false.

isArray
bool isArray [@property getter]

Whether the DataNode is an array.

isBlob
bool isBlob [@property getter]

Whether the DataNode is a byte blob.

isNull
bool isNull [@property getter]

Whether the DataNode contains a nil value.

isNumber
bool isNumber [@property getter]

Whether the DataNode contains a numeric value.

isObject
bool isObject [@property getter]

Whether the DataNode is an object.

length
size_t length [@property getter]

Length of the node.

number
float number [@property getter]

The number content of the data node, or NaN

object
RcOrderedDictionary!(string, DataNode) object [@property getter]

The key-value pairs in the DataNode object, or null.

text
string text [@property getter]

The text content of the node, or null.

type
DataNodeType type [@property getter]

The type of data stored within the node.

Static functions

createArray
DataNode createArray()

Creates a new array node.

createObject
DataNode createObject()

Creates a new object node.

Meta