Function skipValue
Skips a single JSON value in a parser stream.
void skipValue(R)
(
ref R nodes
)
if (isJSONParserNodeInputRange!R);
The value pointed to by nodes
will be skipped. All JSON types will
be skipped, which means in particular that arrays and objects will be
skipped recursively.
Parameters
Name | Description |
---|---|
nodes | An input range of JSON parser nodes |
Example
auto j = parseJSONStream(q{
[
[1, 2, 3],
"foo"
]
});
assert(j .front .kind == JSONParserNodeKind .arrayStart);
j .popFront();
// skips the whole [1, 2, 3] array
j .skipValue();
string value = j .readString;
assert(value == "foo");
assert(j .front .kind == JSONParserNodeKind .arrayEnd);
j .popFront();
assert(j .empty);