JReadString
JReadString
Description
Read a quoted string, handling escape sequences.
Unicode escape sequences like
\uXXXX are not supported.
Parameters
| Name | Direction | Description |
|---|---|---|
si |
in | Current reading position in input string |
str |
out | Output string to store parsed result |
Success
Returns StrIter advanced past closing quote
Failure
Returns original StrIter on error (invalid escape, missing quote, etc.)
Usage example (Cross-references)
Usage examples (Cross-references)
- In
JSON.c:42:
// key start
read_si = JReadString(si, &key);
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to read string key in object. Invalid JSON");- In
JSON.c:166:
}
StrIter JReadString(StrIter si, Str *str) {
if (!StrIterRemainingLength(&si)) {
return si;- In
JSON.c:591:
StrIter before_si = si;
Str s = StrInit();
si = JReadString(si, &s);
StrDeinit(&s);- In
JSON.h:219:
do { \
Str my_str = StrInit(); \
si = JReadString((si), &my_str); \
(str) = my_str; \
} while (0)- In
JSON.h:242:
if (!StrCmpZstr(&key, (k))) { \
Str my_str = StrInit(); \
si = JReadString((si), &my_str); \
(str) = my_str; \
} \
- In
JSON.h:537:
\
/* key start */ \
read_si = JReadString(si, &key); \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to read string key in object. Invalid JSON"); \
Last updated on