JW_ARR
- Macro
- August 22, 2025
Table of Contents
JW_ARR
JW_ARR
Description
Write a JSON array from a vector. Each item is rendered using the provided writer
. Handles inserting commas between elements.
Parameters
Name | Direction | Description |
---|---|---|
j | in,out | The target string to append to. |
arr | in | A vector to iterate over. |
item | out | Iterator variable for the current item. |
writer | in | Code block that appends JSON for each item . |
Usage example (from documentation)
JW_ARR(json, some_vec, s, {
JW_STR(json, s);
});
Success
Appends a JSON array to json
Failure
Does not return on failure
Usage example (Cross-references)
- In
JSON.h:772
:
} \
StrAppendf(&(j), "\"%s\":", k); \
JW_ARR(j, arr, item, writer); \
} while (0)