Value

Simple class to represent a JSON object.

Constructors

this
this()

Construct as a NULL type

this
this(bool b)

Construct as a BOOL (boolean) type.

this
this(int i)

Construct as a INT (integer) type.

this
this(double n)

Construct as a REAL (double) type.

this
this(string s)

Construct as a STRING (string) type.

this
this(ubyte[] v)

Construct as a BINARY (ubyte[]) type.

this
this(Value[] a)

Construct as an ARRAY (Value[]) type.

this
this(Value[string] o)

Construct as an OBJECT (Valuestring) type.

Members

Functions

arrayLen
size_t arrayLen()

Get the length of the array if this is an array.

get
Value get(int idx)

Lookup value from an array.

get
Value get(string key)

Lookup value from a key-value pair.

getNumberAsDouble
double getNumberAsDouble()

Use this function if you want to have number value as double.

getNumberAsInt
int getNumberAsInt()

Use this function if you want to have number value as int.

has
bool has(string key)

Valid only for object type.

isArray
bool isArray()

Gets if it's an array.

isBinary
bool isBinary()

Gets if it's a binary.

isBool
bool isBool()

Gets if it's a bool.

isInt
bool isInt()

Gets if it's an integer.

isNumber
bool isNumber()

Gets if it's a number.

isObject
bool isObject()

Gets if it's an object.

isReal
bool isReal()

Gets if it's a double.

isString
bool isString()

Gets if it's a string.

keys
string[] keys()

List keys

size
size_t size()
Undocumented in source. Be warned that the author may not have intended to support it.
type
Type type()

Get what Type this Value is.

Variables

array_value_
Value[] array_value_;
Undocumented in source.
binary_value_
ubyte[] binary_value_;
Undocumented in source.
boolean_value_
bool boolean_value_;
Undocumented in source.
int_value_
int int_value_;
Undocumented in source.
object_value_
Value[string] object_value_;
Undocumented in source.
real_value_
double real_value_;
Undocumented in source.
string_value_
string string_value_;
Undocumented in source.
type_
Type type_;
Undocumented in source.

Meta