JR_BOOL

Table of Contents

JR_BOOL

Description

Read a JSON boolean value from stream and assign to target.

Parameters

NameDirectionDescription
siin,outJSON stream iterator to read from.
boutBoolean variable to store the value.

Usage example (from documentation)

  JR_BOOL(si, is_active);

Success

b contains the parsed boolean

Failure

si updated to failure state on parse error

Usage example (Cross-references)

    JR_ARR_KV(si, "flags", {
    bool flag = false;
    JR_BOOL(si, flag);
    VecPushBack(&parsed.flags, flag);
    });

Share :

Related Posts

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.

Read More

JR_FLT_KV

JR_FLT_KV Description Read a float key-value pair if key matches.

Read More

JReadBool

JReadBool Description Read a boolean value (“true” or “false”) from input string.

Read More