Json.singleKey

Skips all keys of an object except the first occurence with the given key name.

struct Json(uint vl = validateUsed, bool validateUtf8 = vl > trustedSource)
@property
SingleKey
singleKey
(
string name
)
()
if (
vl > trustedSource ||
!validateUtf8
)

Parameters

name

the key name of interest

Return Value

Type: SingleKey

A temporary struct, a proxy to the parser, that will automatically seek to the end of the current JSON object on destruction.

Throws

JSONException when the key is not found in the object or parsing errors occur.

Note: Since this is an on the fly parser, you can only get one key from an object with this method. Use keySwitch or foreach(key; json) to get values from multiple keys.

See Also

keySwitch

Meta