Skip to content

StrIterRead

Description

Read the current character into *out and advance the cursor. Propagating alias for IterRead; see IterRead for the full contract.

Parameters

Name Direction Description
mi in Pointer to the StrIter to read from.
out out Destination char *; receives the current character.

Success

*out is set, the cursor advances by one in the iteration direction, returns true.

Failure

Iterator is exhausted; *out is not written, the cursor is unchanged, returns false.

Usage example (Cross-references)

Usage examples (Cross-references)
            StrIter aug_it = StrIterFromZstr(augmentation + 1);
            char    a;
            while (StrIterRead(&aug_it, &a)) {
                switch (a) {
                    case 'L' : {
        }
        char c = 0;
        if (!StrIterRead(&si, &c) || c != 'a') {
            return false;
        }
            return false;
        }
        if (!StrIterRead(&si, &c) || c != 'b') {
            return false;
        }
            return false;
        }
        if (!StrIterRead(&si, &c) || c != 'c') {
            return false;
        }
        }
        // The NUL terminator is not part of the range: a fourth read fails.
        return !StrIterRead(&si, &c);
    }
        }
        char c = 0;
        if (!StrIterRead(&si, &c) || c != 'a') {
            return false;
        }
            return false;
        }
        if (!StrIterRead(&si, &c) || c != 'b') {
            return false;
        }
        }
        // 'c'/'d' are past the capped length even though they are in memory.
        return !StrIterRead(&si, &c);
    }
Last updated on