Json.JsonValue

Represents a json value that is one of the seven types specified via the Json.Type enum

Members

Aliases

set
alias set = reset
Undocumented in source.

Functions

opEquals
equals_t opEquals(Type t)

return true if this node is of the given type

opEquals
equals_t opEquals(JsonValue rhs)

explicitly provide same opEquals as auto-generated one to avoid deprecation warning being printed (compiler can't know if previous one was intentional or a typo)

print
const(T)[] print(const(T)[] space, int decimals)

Return a text representation of this value

print
Value print(OutputStream s, const(T)[] space, int decimals)

Emit a text representation of this value to the given OutputStream

print
Value print(void delegate(const(T)[]) append, const(T)[] space, int decimals)

Emit a text representation of this value to the provided delegate

reset
Value reset()

Set this value to represent null

set
Value set(const(T)[] str, bool escaped)

Set this value to represent a string. If 'escaped' is set, the string is assumed to have pre-converted escaping of reserved characters (such as \t).

set
Value set(Composite obj)

Set this value to represent an object.

set
Value set(real num)

Set this value to represent a number.

set
Value set(bool b)

Set this value to represent a boolean.

set
Value set(Value[] a)

Set this value to represent an array of values.

toArray
Value[] toArray()

Return the content as an array. Returns null where the value is not an array.

toBool
bool toBool()

Return true if this value represent True

toNumber
real toNumber()

Return the content as a double. Returns nan where the value is not numeric.

toObject
Composite toObject()

Return the content as a Composite/Object. Returns null if this value is not a Composite.

toString
const(T)[] toString(T[] dst)

Return the string content. Returns null if this value is not a string.

toString
bool toString(void delegate(const(T)[]) dg)

Emit the string content to the given delegate, with escape conversion as required.

Variables

type
Type type;

the type of this node

Meta