D Programming Language 2.0

- Comments
- D
- Search
- Home

Last update Wed Aug 1 09:43:25 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
    Indicates the type of a JSONValue.

  UINTEGER
  FLOAT
  OBJECT
  ARRAY
  TRUE
  FALSE
  NULL
    integers > 2^63-1

struct JSONValue;
  JSON value node

  string str;
    Value when type is JSON_TYPE.STRING

  long integer;
    Value when type is JSON_TYPE.INTEGER

  ulong uinteger;
    Value when type is JSON_TYPE.UINTEGER

  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.

  ref JSONValue opIndex(size_t i);
    array syntax for json arrays

  ref JSONValue opIndex(string k);
    hash syntax for json objects

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

Copyright Jeremie Pelletier 2008 - 2009. | Page generated by Ddoc.