Skip to content

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)

Usage examples (Cross-references)
            }                                                                                                              \
            StrAppendf(&(j), "\"%s\":", k);                                                                                \
            JW_ARR(j, arr, item, writer);                                                                                  \
        } while (0)
Last updated on