JR_STR
- Macro
- August 22, 2025
Table of Contents
JR_STR
JR_STR
Description
Read a JSON string value from stream and assign to target. The resulting string is dynamically allocated in Str
format.
Parameters
Name | Direction | Description |
---|---|---|
si | in,out | JSON stream iterator to read from. |
str | out | Destination Str to store the string. |
Usage example (from documentation)
JR_STR(si, name);
Success
str
contains the read string
Failure
si
updated to failure state on parse error
Usage example (Cross-references)
- In
MisraDoc.c:48
:
JR_ARR_KV(json, "test_directories", { \
Str s = StrInit(); \
JR_STR(json, s); \
VecPushBack(&p.test_directories, s); \
}); \
- In
MisraDoc.c:53
:
JR_ARR_KV(json, "source_directories", { \
Str s = StrInit(); \
JR_STR(json, s); \
VecPushBack(&p.source_directories, s); \
}); \
JR_ARR_KV(si, "languages", {
Str lang = StrInit();
JR_STR(si, lang);
VecPushBack(&languages, lang);
});
JR_ARR_KV(si, "tags", {
Str tag = StrInit();
JR_STR(si, tag);
VecPushBack(&product.tags, tag);
});
JR_ARR_KV(si2, "data", {
Str value = StrInit();
JR_STR(si2, value);
VecPushBack(&data, value);
});
- In
RoundTrip.c:392
:
JR_ARR_KV(si, "strings", {
Str str = StrInit();
JR_STR(si, str);
VecPushBack(&parsed_strings, str);
});
- In
RoundTrip.c:583
:
JR_ARR_KV(si, "features", {
Str feature = StrInit();
JR_STR(si, feature);
VecPushBack(&parsed.config.features, feature);
});
- In
RoundTrip.c:683
:
JR_ARR_KV(si, "empty_strings", {
Str str = StrInit();
JR_STR(si, str);
VecPushBack(&parsed_strings, str);
});