View source code
Display the source code in std/json.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Struct std.json.JSONValue

JSON value node

struct JSONValue ;

Constructors

NameDescription
this Constructor for JSONValue. If arg is a JSONValue its value and type will be copied to the new JSONValue. Note that this is a shallow copy: if type is JSON_TYPE.OBJECT or JSON_TYPE.ARRAY then only the reference to the data will be copied. Otherwise, arg must be implicitly convertible to one of the following types: typeof(null), string, ulong, long, double, an associative array V[K] for any V and K i.e. a JSON object, any array or bool. The type will be set accordingly.

Properties

NameTypeDescription
array[get, set] inout(JSONValue[])Value getter/setter for JSON_TYPE.ARRAY.
arrayNoRef[get] inout(JSONValue[])Value getter for JSON_TYPE.ARRAY. Unlike array, this retrieves the array by value and can be used in @safe code.
floating[get, set] inout(double)Value getter/setter for JSON_TYPE.FLOAT. Note that despite the name, this is a 64-bit double, not a 32-bit float.
integer[get, set] inout(long)Value getter/setter for JSON_TYPE.INTEGER.
isNull[get] boolTest whether the type is JSON_TYPE.NULL
object[get, set] inout(JSONValue[string])Value getter/setter for JSON_TYPE.OBJECT.
objectNoRef[get] inout(JSONValue[string])Value getter for JSON_TYPE.OBJECT. Unlike object, this retrieves the object by value and can be used in @safe code.
str[get, set] stringValue getter/setter for JSON_TYPE.STRING.
type[get] JSON_TYPEReturns the JSON_TYPE of the value stored in this structure.
uinteger[get, set] inout(ulong)Value getter/setter for JSON_TYPE.UINTEGER.

Methods

NameDescription
opApply Implements the foreach opApply interface for json arrays.
opApply Implements the foreach opApply interface for json objects.
opBinaryRight Support for the in operator.
opIndex Array syntax for json arrays.
opIndex Hash syntax for json objects.
opIndexAssign Operator sets value for element of JSON object by key.
toPrettyString Implicitly calls toJSON on this JSONValue, like toString, but also passes true as pretty argument.
toString Implicitly calls toJSON on this JSONValue.

Authors

Jeremie Pelletier, David Herberth

License

Boost License 1.0.