Skip to content

StrIterPos

Description

Pointer to the character at the current cursor position, or the NULL_ITER_DATA(mi) sentinel when the iterator is exhausted. Alias-reframe of IterPos in string vocabulary. See IterPos for the full contract.

Usage example (Cross-references)

Usage examples (Cross-references)
            StrIterMustNext(&fsi); // step over '{'
            StrIter spec_start_fsi = fsi;
            Zstr    spec_start     = (Zstr)StrIterPos(&fsi);
            char    sc             = 0;
            while (StrIterPeek(&fsi, &sc) && sc != '}') {
            StrIterMustNext(&fsi); // step over '{'
            StrIter spec_start_fsi = fsi;
            Zstr    spec_start     = (Zstr)StrIterPos(&fsi);
            char    sc             = 0;
            while (StrIterPeek(&fsi, &sc) && sc != '}') {
        if (StrIterRemainingLength(&si) >= 4) {
            if (StrIterPeek(&si, &c) && c == 't') {
                Zstr pos = StrIterPos(&si);
                if (pos && ZstrCompareN(pos, "true", 4) == 0) {
                    StrIterMustMove(&si, 4);
            if (StrIterRemainingLength(&si) >= 5) {
                if (StrIterPeek(&si, &c) && c == 'f') {
                    Zstr pos = StrIterPos(&si);
                    if (pos && ZstrCompareN(pos, "false", 5) == 0) {
                        StrIterMustMove(&si, 5);
        if (StrIterRemainingLength(&si) >= 4) {
            if (StrIterPeek(&si, &c) && c == 'n') {
                Zstr pos = StrIterPos(&si);
                if (pos && ZstrCompareN(pos, "null", 4) == 0) {
                    StrIterMustMove(&si, 4);
Last updated on