jsonizer

serialize and deserialize between JSONValues and other D types

Members

Functions

extract
T extract(JSONValue json)

extract a boolean from a json value

extract
T extract(JSONValue json)

extract a string type from a json value

extract
T extract(JSONValue json)

extract a numeric type from a json value

extract
T extract(JSONValue json)

extract an enumerated type from a json value

extract
T extract(JSONValue json)

extract an array from a JSONValue

extract
T extract(JSONValue json)

extract an associative array from a JSONValue

extract
T extract(JSONValue json, string key)

extract a value from a json object by its key

extract
T extract(JSONValue json, string key, T defaultVal)

extract a value from a json object by its key, return defaultVal if key not found

extract
T extract(JSONValue json)

extract a user-defined class or struct from a JSONValue

hasCustomJsonCtor
bool hasCustomJsonCtor()
Undocumented in source. Be warned that the author may not have intended to support it.
jsonizeKey
string jsonizeKey()
Undocumented in source. Be warned that the author may not have intended to support it.
readJSON
T readJSON(string file)

read a json-constructable object from a file

readJSON
auto readJSON(string file)

shortcut to read file directly into JSONValue

toJSON
JSONValue toJSON(T val)

convert a bool to a JSONValue

toJSON
JSONValue toJSON(T val)

convert a string to a JSONValue

toJSON
JSONValue toJSON(T val)

convert a floating point value to a JSONValue

toJSON
JSONValue toJSON(T val)

convert a signed integer to a JSONValue

toJSON
JSONValue toJSON(T val)

convert an unsigned integer to a JSONValue

toJSON
JSONValue toJSON(T val)

convert an enum name to a JSONValue

toJSON
JSONValue toJSON(T args)

convert a homogenous array into a JSONValue array

toJSON
JSONValue toJSON(T args)

convert a set of heterogenous values into a JSONValue array

toJSON
JSONValue toJSON(T map)

convert a associative array into a JSONValue object

toJSON
JSONValue toJSON(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.
writeJSON
void writeJSON(T obj, string file)

write a jsonizeable object to a file

Manifest constants

jsonizeClassKeyword
enum jsonizeClassKeyword;

json member used to map a json object to a D type

Mixin templates

JsonizeMe
mixintemplate JsonizeMe()
Undocumented in source.

Structs

jsonize
struct jsonize

use @jsonize to mark members to be (de)serialized from/to json use @jsonize to mark a single contructor to use when creating an object using extract use @jsonize("name") to make a member use the json key "name"

Meta