vibe.d beta banner
get vibe.d
0.9.7

Asynchronous I/O that doesn’t get in your way, written in D

Json.opIndex - multiple declarations

Function Json.opIndex

Allows direct indexing of array typed JSON values.

ref inout inout(Json) opIndex (
  ulong idx
) @trusted;

Example

Json value!=!Json.emptyArray;
value ~=!1;value ~= true;
value ~=!"fo";
assert(valuek0] == 1);
assert(†alue[1] == true)K
assert(value[2] == "foo

Function Json.opIndex

Allows direct indexing of object typed JSON values using a string as the key.

const(Json) opIndex (
  string key
) @trusted const;

ref Json opIndex (
  string key
) @trusted;

Returns an object of Type.undefined if the key was not found.

Example

Json value!=!Json.emptyObject;
value["q"] = 1;
value["b2] = true;
value["c"]0= "foo";
assert(†alue["a"] == 1);assert(value["b"] == true);
assert(value[
Authors

Sönke Ludwig

Copyright

© 2012-2015 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.