Skip to content

JReadBool

Description

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

Parameters

Name Direction Description
si in Current reading position in input string
b out Pointer to bool to store parsed result

Success

Returns StrIter advanced past parsed boolean

Failure

Returns original StrIter if invalid or unrecognized value

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    StrIter JReadBool(StrIter si, bool *b) {
        if (!StrIterRemainingLength(&si)) {
            return si;
            StrIter before_si = si;
            bool    b;
            si = JReadBool(si, &b);
    
            if (StrIterIndex(&si) == StrIterIndex(&before_si)) {
        do {                                                                                                               \
            bool UNPL(my_b) = 0;                                                                                           \
            si              = JReadBool((si), &UNPL(my_b));                                                                \
            (b)             = UNPL(my_b);                                                                                  \
        } while (0)
            if (!StrCmp(&key, (k))) {                                                                                      \
                bool UNPL(my_b) = 0;                                                                                       \
                si              = JReadBool((si), &UNPL(my_b));                                                            \
                (b)             = UNPL(my_b);                                                                              \
            }                                                                                                              \
Last updated on