Fghj.opIndex

Searches for a value recursively in an FGHJ object.

struct Fghj
pure
opIndex
(
in char[][] keys...
)

Parameters

keys char[][]

list of keys keys Returns FGHJ value if it was found (first win) or FGHJ with empty plain data.

Examples

import fghj.jsonparser;
auto fghjData = `{"foo":"bar","inner":{"a":true,"b":false,"c":"32323","d":null,"e":{}}}`.parseJson;
assert(fghjData["inner", "a"] == true);
assert(fghjData["inner", "b"] == false);
assert(fghjData["inner", "c"] == "32323");
assert(fghjData["inner", "d"] == null);
assert(fghjData["no", "such", "keys"] == Fghj.init);

Meta