|
CX Framework
Cross-platform C utility framework
|
Functions | |
| bool | striChar (striter *i, uint8 *out) |
| bool | striPeekChar (striter *i, uint8 *out) |
| bool | striAdvance (striter *i, uint32 by) |
These functions simplify iteration by handling run boundaries automatically. They are less efficient than processing runs directly, but much simpler for state machine-based parsing (like UTF-8 decoding) where you need to examine one byte at a time without worrying about where runs begin and end.
|
inline |
bool striAdvance(striter *i, uint32 by)
Advances the cursor by a specified number of bytes
Moves the cursor forward by 'by' bytes, automatically crossing run boundaries as needed. Returns false if advancing would go past the end of the string.
| i | Iterator to advance |
| by | Number of bytes to advance |
Example:
Definition at line 370 of file striter.h.
References striNext().
|
inline |
bool striChar(striter *i, uint8 *out)
Retrieves the next byte and advances cursor
Gets one byte from the current position and moves the cursor forward. Automatically advances to the next run if needed. Returns false when the end of the string is reached.
| i | Iterator to read from |
| out | Pointer to store the byte |
Example:
Definition at line 307 of file striter.h.
References striNext().
|
inline |
bool striPeekChar(striter *i, uint8 *out)
Retrieves the next byte without advancing cursor
Gets one byte from the current position but doesn't move the cursor. Useful for lookahead in parsers. Automatically advances to the next run if at a boundary.
| i | Iterator to read from |
| out | Pointer to store the byte |
Example:
Definition at line 339 of file striter.h.
References striNext().