JReadString
- Function
- August 22, 2025
Table of Contents
JReadString
JReadString
Description
Read a quoted string, handling escape sequences.
Note
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)
- 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"); \
- 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);