View source code Display the source code in std/json.d from which this page was generated on github. 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. Page wiki View or edit the community-maintained wiki page associated with this page.

std.json.json_value.type - multiple declarations

Function JSONValue.type

Returns the JSON_TYPE of the value stored in this structure.

Prototype

JSON_TYPE type() pure nothrow @property @nogc @safe const;

Example

string s = "{ \"language\": \"D\" }";
JSONValue j = parseJSON(s);
assert(j.type == JSON_TYPE.OBJECT);
assert(j["language"].type == JSON_TYPE.STRING);


Function JSONValue.type

Deprecated. Instead, please assign the value with the adequate type to JSONValue directly. This will be removed in June 2015.

Sets the type of this JSONValue. Previous content is cleared.

Prototype

deprecated JSON_TYPE type(
  JSON_TYPE newType
) @property;

Authors

Jeremie Pelletier, David Herberth

License

Boost License 1.0.

Comments