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.
Parameters
| Name | Direction | Description |
|---|---|---|
mi |
in | Pointer to the StrIter to query. |
Success
Returns a pointer to the character at the current cursor position, or the NULL_ITER_DATA(mi) sentinel when the iterator is exhausted.
Failure
Macro cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:848:
}
StrIter spec_start_fsi = fsi;
Zstr spec_start = (Zstr)StrIterPos(&fsi);
char sc = 0;
while (StrIterPeek(&fsi, &sc) && sc != '}') {- In
Io.c:1045:
}
StrIter spec_start_fsi = fsi;
Zstr spec_start = (Zstr)StrIterPos(&fsi);
char sc = 0;
while (StrIterPeek(&fsi, &sc) && sc != '}') {- In
JSON.c:511:
if (StrIterRemainingLength(&si) >= 4) {
if (StrIterPeek(&si, &c) && c == 't') {
Zstr pos = StrIterPos(&si);
if (pos && ZstrCompareN(pos, "true", 4) == 0) {
StrIterMustMove(&si, 4);- In
JSON.c:523:
if (StrIterRemainingLength(&si) >= 5) {
if (StrIterPeek(&si, &c) && c == 'f') {
Zstr pos = StrIterPos(&si);
if (pos && ZstrCompareN(pos, "false", 5) == 0) {
StrIterMustMove(&si, 5);- In
JSON.c:561:
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