|
CX Framework
Cross-platform C utility framework
|
Functions | |
| bool | sbufFSFileOut (StreamBuffer *sb, FSFile *file, bool close) |
| bool | sbufFSFileCRegisterPush (StreamBuffer *sb, FSFile *file, bool close) |
Functions for using low-level filesystem files as stream buffer data sinks.
| bool sbufFSFileCRegisterPush | ( | StreamBuffer * | sb, |
| FSFile * | file, | ||
| bool | close | ||
| ) |
bool sbufFSFileCRegisterPush(StreamBuffer *sb, FSFile *file, bool close)
Registers a filesystem file as a consumer with the stream buffer in push mode.
In push mode, data is automatically written to the file as it becomes available from the producer. Use this instead of sbufFSFileOut() when you need the producer and consumer to operate asynchronously.
| sb | The stream buffer |
| file | Filesystem file to write to (optionally closed when consumer finishes) |
| close | If true, the file is closed when the consumer finishes |
| bool sbufFSFileOut | ( | StreamBuffer * | sb, |
| FSFile * | file, | ||
| bool | close | ||
| ) |
bool sbufFSFileOut(StreamBuffer *sb, FSFile *file, bool close)
Consumes all available data from the buffer and writes it to a filesystem file.
Reads data from the stream buffer until the producer finishes (EOF) and writes it to the file in chunks.
IMPORTANT: The stream buffer is invalidated after this call.
| sb | The stream buffer (invalidated after call) |
| file | Filesystem file to write to (optionally closed based on close parameter) |
| close | If true, the file is closed after writing |
Example: