|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | lparseCreatePull(sb, ...) _lparseCreatePull(sb, opt_flags(__VA_ARGS__)) |
Functions | |
| bool | lparseLine (LineParser *lp, string *out) |
Pull-mode line parsing where the consumer explicitly requests each line.
| #define lparseCreatePull | ( | sb, | |
| ... | |||
| ) | _lparseCreatePull(sb, opt_flags(__VA_ARGS__)) |
LineParser *lparseCreatePull(StreamBuffer *sb, [flags])
Creates a line parser that reads on demand.
The parser is the driving consumer, so it registers nothing with the stream buffer; call lparseLine() for each line. Use this on a stream buffer that has a pull producer attached.
| sb | The stream buffer |
| ... | (flags) Configuration flags from LINEPARSER_FLAGS_ENUM |
Example:
Definition at line 143 of file lineparse.h.
| bool lparseLine | ( | LineParser * | lp, |
| string * | out | ||
| ) |
Retrieves the next line from the stream buffer.
Call this repeatedly after lparseCreatePull(). It returns false once the input runs out, which happens when the stream ends, when it fails, or when the producer detaches.
| lp | The line parser |
| out | String to receive the line content (cleared and populated) |