JR_INT

Table of Contents

JR_INT

Description

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

Parameters

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

Usage example (from documentation)

  JR_INT(si, count);

Success

i contains the parsed integer

Failure

si updated to failure state on parse error

Usage example (Cross-references)

    JR_ARR_KV(si, "numbers", {
    i32 num = 0;
    JR_INT(si, num);
    VecPushBack(&parsed_numbers, num);
    });
    JR_ARR_KV(si, "numbers", {
    i32 num = 0;
    JR_INT(si, num);
    VecPushBack(&parsed.numbers, num);
    });
    JR_ARR_KV(si, "empty_numbers", {
    i32 num = 0;
    JR_INT(si, num);
    VecPushBack(&parsed_numbers, num);
    });
    JR_ARR_KV(si1, "items", {
    i32 value = 0;
    JR_INT(si1, value);
    VecPushBack(&items, value);
    });
    JR_ARR_KV(si, "filled_arr", {
    i32 item = 0;
    JR_INT(si, item);
    VecPushBack(&obj.filled_items, item);
    });

Share :

Related Posts

JSkipWhitespace

JSkipWhitespace Description Skip whitespace from current reading position.

Read More

JReadInteger

JReadInteger Description Strictly read an integer from input string.

Read More

JR_STR_KV

JR_STR_KV Description Read a string key-value pair if key matches.

Read More