25 lines
483 B
Plaintext
25 lines
483 B
Plaintext
:sig
|
|
void json_consume_space(String s, u32& i)
|
|
|
|
:params
|
|
s : JSON source string
|
|
i : current byte offset; advanced past JSON whitespace
|
|
|
|
:see
|
|
>string
|
|
json_encode
|
|
json_decode
|
|
|
|
:content
|
|
Advances `i` past JSON whitespace in `s`.
|
|
|
|
This helper is mainly useful when writing a parser that follows UCE's JSON parsing rules. Most page code should call `json_decode()` instead.
|
|
|
|
Example:
|
|
|
|
```uce
|
|
u32 i = 0;
|
|
json_consume_space(" \n {\"ok\":true}", i);
|
|
// i now points at the opening brace
|
|
```
|