Skip to content

StrIterLength

Description

Total character length of the region the StrIter covers. Alias- reframe of IterLength in string vocabulary. See IterLength for the full contract.

Usage example (Cross-references)

Usage examples (Cross-references)
        }
        // No digits consumed (cursor at entry) or trailing junk after digits.
        if (StrIterRemainingLength(&si) == StrIterLength(&si) || StrIterRemainingLength(&si) != 0)
            return false;
        if (v > hi)
        out->path        = (Zstr)StrIterDataAt(si, path_start_pos); // may be empty if anonymous
    
        if (line_terminator_pos < StrIterLength(si) && *StrIterDataAt(si, line_terminator_pos) == '\n') {
            // intentional bypass: in-place mutation of the iter's backing
            // buffer to NUL-terminate the path slice we just exposed via
        bool    result = true;
    
        result = result && (StrIterIndex(&si) == StrIterLength(&si));
        result = result && (MapPairCount(&cfg) == 3);
        result = result && KvConfigContains(&cfg, "host");
        bool    result = true;
    
        result = result && (StrIterIndex(&si) == StrIterLength(&si));
        result = result && (MapPairCount(&cfg) == 4);
        result = result && path && StrCmp(path, "/srv/my app") == 0;
            StrIter *iter1       = VecPtrAt(&iters, 0);
            char     buffer1[10] = {0};
            MemCopy(buffer1, iter1->data, StrIterLength(iter1));
            result = result && (ZstrCompare(buffer1, "Hello") == 0);
            StrIter *iter2       = VecPtrAt(&iters, 1);
            char     buffer2[10] = {0};
            MemCopy(buffer2, iter2->data, StrIterLength(iter2));
            result = result && (ZstrCompare(buffer2, "World") == 0);
            StrIter *iter3       = VecPtrAt(&iters, 2);
            char     buffer3[10] = {0};
            MemCopy(buffer3, iter3->data, StrIterLength(iter3));
            result = result && (ZstrCompare(buffer3, "Test") == 0);
        }
Last updated on