|
CX Framework
Cross-platform C utility framework
|
Functions | |
| bool | sbufStrIn (StreamBuffer *sb, strref str) |
| bool | sbufStrPRegisterPull (StreamBuffer *sb, strref str) |
Functions for using strings as stream buffer data sources.
| bool sbufStrIn | ( | StreamBuffer * | sb, |
| strref | str | ||
| ) |
bool sbufStrIn(StreamBuffer *sb, strref str)
Pushes the entire contents of a string into a stream buffer.
Automatically chunks the data based on the stream buffer's target size for efficient operation. The stream buffer is automatically finished after all data is written.
IMPORTANT: The stream buffer is invalidated after this call.
| sb | The stream buffer (invalidated after call) |
| str | String to push into the buffer |
Example:
| bool sbufStrPRegisterPull | ( | StreamBuffer * | sb, |
| strref | str | ||
| ) |
bool sbufStrPRegisterPull(StreamBuffer *sb, strref str)
Registers a string as a producer with the stream buffer in pull mode.
In pull mode, the consumer pulls data as needed, and the string provides it in chunks. Use this instead of sbufStrIn() when you need finer control over when data is provided.
| sb | The stream buffer |
| str | String to use as data source |