JW_BOOL

Table of Contents

JW_BOOL

Description

Append a boolean value to the JSON as unquoted true/false.

Parameters

NameDirectionDescription
jin,outThe target string to append to.
binBoolean value.

Usage example (from documentation)

  JW_BOOL(json, true);

Success

Appends “true” or “false” as unquoted boolean

Failure

Does not return on failure

Usage example (Cross-references)

    }                                                                                                              \
    StrAppendf(&(j), "\"%s\":", k);                                                                                \
    JW_BOOL(j, b);                                                                                                 \
    } while (0)
    JW_ARR_KV(json, "numbers", numbers, num, { JW_INT(json, num); });
    JW_ARR_KV(json, "strings", strings, str, { JW_STR(json, str); });
    JW_ARR_KV(json, "booleans", booleans, b, { JW_BOOL(json, b); });
    });
    });
    JW_ARR_KV(json, "numbers", original.numbers, num, { JW_INT(json, num); });
    JW_ARR_KV(json, "flags", original.flags, flag, { JW_BOOL(json, flag); });
    });

Share :

Related Posts

JW_OBJ

JW_OBJ Description Begin a JSON object and write key-value entries using JW_*_KV macros. This macro must be used as a wrapper for other JW_*_KV macros to generate a JSON object. Tracks whether commas are needed between entries using an internal flag.

Read More

JW_STR

JW_STR Description Append a string value (quoted) to the JSON.

Read More

JW_FLT_KV

JW_FLT_KV Description Write a key and float value to a JSON object.

Read More