View source code
Display the source code in std/json.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla 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 usinglocal clone.
Struct std.json.JSONValue
JSON value node
struct JSONValue;
Constructors
| Name | Description |
|---|---|
this
(arg)
|
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 JSONType
or JSONType 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
| Name | Type | Description |
|---|---|---|
array[get, set]
|
inout(JSONValue[]) | Value getter/setter for JSONType.
|
arrayNoRef[get]
|
inout(JSONValue[]) | Value getter for JSONType.
Unlike array, this retrieves the array by value and can be used in @safe code.
|
boolean[get, set]
|
bool | Value getter/setter for boolean stored in JSON. |
floating[get, set]
|
double | Value getter/setter for JSONType. Note that despite
the name, this is a 64-bit double, not a 32-bit float.
|
get[get]
|
inout(T) | A convenience getter that returns this JSONValue as the specified D type.
|
integer[get, set]
|
long | Value getter/setter for JSONType.
|
isNull[get]
|
bool | Test whether the type is JSONType
|
isOrdered[get]
|
bool | Returns true if the order of keys of the represented object is being preserved.
|
object[get, set]
|
inout(JSONValue[string]) | Value getter/setter for unordered JSONType.
|
objectNoRef[get]
|
inout(JSONValue[string]) | Value getter for unordered JSONType.
Unlike object, this retrieves the object by value
and can be used in @safe code.
|
orderedObject[get, set]
|
inout(Tuple!(string,"key",std.json.JSONValue,"value")[]) | Value getter/setter for ordered JSONType.
|
orderedObjectNoRef[get]
|
inout(Tuple!(string,"key",std.json.JSONValue,"value")[]) | Value getter for ordered JSONType.
Unlike orderedObject, this retrieves the object by value
and can be used in @safe code.
|
str[get, set]
|
string | Value getter/setter for JSONType.
|
type[get]
|
JSONType | Returns the JSONType of the value stored in this structure. |
uinteger[get, set]
|
ulong | Value getter/setter for JSONType.
|
Methods
| Name | Description |
|---|---|
opApply
(dg)
|
Implements the foreach opApply interface for json arrays.
|
opApply
(dg)
|
Implements the foreach opApply interface for json objects.
|
opBinaryRight
(k)
|
Provides support for the in operator.
|
opEquals
(rhs)
|
Compare two JSONValues for equality |
opIndex
(i)
|
Array syntax for JSON arrays. |
opIndex
(k)
|
Hash syntax for JSON objects. |
opIndexAssign
(value, key)
|
Provides support for index assignments, which sets the
corresponding value of the JSON object's key field to value.
|
toPrettyString
(sink, options)
|
|
toPrettyString
(options)
|
Implicitly calls toJSON on this JSONValue, like toString, but
also passes true as pretty argument.
|
toString
(options)
|
Implicitly calls toJSON on this JSONValue.
|
toString
(sink, options)
|
Authors
Jeremie Pelletier, David Herberth
License
Copyright © 1999-2025 by the D Language Foundation | Page generated by ddox.