www.digitalmars.com

D Programming Language 2.0

Last update Wed Apr 11 21:24:31 2012

std.json

JavaScript Object Notation

License:
Boost License 1.0.

Authors:
Jeremie Pelletier

References:
http://json.org/

Source:
std/json.d

enum JSON_TYPE;
JSON type enumeration

STRING
INTEGER
FLOAT
OBJECT
ARRAY
TRUE
FALSE
NULL
Indicates the type of a JSONValue.

struct JSONValue;
JSON value node

string str;
Value when type is JSON_TYPE.STRING

long integer;
Value when type is JSON_TYPE.INTEGER

real floating;
Value when type is JSON_TYPE.FLOAT

JSONValue[string] object;
Value when type is JSON_TYPE.OBJECT

JSONValue[] array;
Value when type is JSON_TYPE.ARRAY

JSON_TYPE type;
Specifies the type of the value stored in this structure.

JSONValue parseJSON(T)(T json, int maxDepth = -1);
Parses a serialized string and returns a tree of JSON values.

string toJSON(in JSONValue* root);
Takes a tree of JSON values and returns the serialized string.

class JSONException: object.Exception;
Exception thrown on JSON errors