JSONValue

JSON value node

struct JSONValue {}

Constructors

this
this(T arg)

Constructor for JSONValue. If arg is a JSONValue its value and type will be copied to the new JSONValue. Note that this is a shallow copy: if type is JSONType.object or JSONType.array then only the reference to the data will be copied. Otherwise, arg must be implicitly convertible to one of the following types: typeof(null), string, ulong, long, double, an associative array V[K] for any V and K i.e. a JSON object, any array or bool. The type will be set accordingly.

Members

Functions

opApply
int opApply(int delegate(size_t index, ref JSONValue) dg)

Implements the foreach opApply interface for json arrays.

opApply
int opApply(int delegate(string key, ref JSONValue) dg)

Implements the foreach opApply interface for json objects.

opAssign
void opAssign(T arg)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(T arg)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
JSONValue opBinary(T arg)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
auto opBinaryRight(string k)

Support for the in operator.

opEquals
bool opEquals(JSONValue rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(JSONValue rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
inout(JSONValue) opIndex(size_t i)

Array syntax for json arrays.

opIndex
inout(JSONValue) opIndex(string k)

Hash syntax for json objects.

opIndexAssign
void opIndexAssign(T value, string key)

Operator sets value for element of JSON object by key.

opIndexAssign
void opIndexAssign(T arg, size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(T arg)
Undocumented in source. Be warned that the author may not have intended to support it.
toPrettyString
void toPrettyString(Out sink, JSONOptions options)
toPrettyString
string toPrettyString(JSONOptions options)

Implicitly calls toJSON on this JSONValue, like toString, but also passes true as pretty argument.

toString
string toString(JSONOptions options)

Implicitly calls toJSON on this JSONValue.

toString
void toString(Out sink, JSONOptions options)

Properties

array
inout(JSONValue[]) array [@property getter]
JSONValue[] array [@property setter]

Value getter/setter for JSONType.array.

arrayNoRef
inout(JSONValue[]) arrayNoRef [@property getter]

Value getter for JSONType.array. Unlike array, this retrieves the array by value and can be used in @safe code.

boolean
bool boolean [@property getter]
bool boolean [@property setter]

Value getter/setter for boolean stored in JSON.

floating
double floating [@property getter]
double floating [@property setter]

Value getter/setter for JSONType.float_. Note that despite the name, this is a 64-bit double, not a 32-bit float.

get
inout(T) get [@property getter]

Generic type value getter A convenience getter that returns this JSONValue as the specified D type. Note: only numeric, bool, string, JSONValue[string] and JSONValue[] types are accepted

get
inout(T) get [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
get
inout(T) get [@property getter]

Generic type value getter A convenience getter that returns this JSONValue as the specified D type. Note: only numeric, bool, string, JSONValue[string] and JSONValue[] types are accepted

integer
long integer [@property getter]
long integer [@property setter]

Value getter/setter for JSONType.integer.

isNull
bool isNull [@property getter]

Test whether the type is JSONType.null_

object
inout(JSONValue[string]) object [@property getter]
JSONValue[string] object [@property setter]

Value getter/setter for JSONType.object.

objectNoRef
inout(JSONValue[string]) objectNoRef [@property getter]

Value getter for JSONType.object. Unlike object, this retrieves the object by value and can be used in @safe code.

str
string str [@property getter]
string str [@property setter]

Value getter/setter for JSONType.string.

type
JSONType type [@property getter]

Returns the JSONType of the value stored in this structure.

uinteger
ulong uinteger [@property getter]
ulong uinteger [@property setter]

Value getter/setter for JSONType.uinteger.

Unions

Store
union Store
Undocumented in source.

Variables

objectKeyOrder
string[] objectKeyOrder;
Undocumented in source.

Meta