|
CX Framework
Cross-platform C utility framework
|
Functions | |
| bool | sbufFileOut (StreamBuffer *sb, VFSFile *file, bool close) |
| bool | sbufFileCRegisterPush (StreamBuffer *sb, VFSFile *file, bool close) |
Functions for using VFS files as stream buffer data sinks.
| bool sbufFileCRegisterPush | ( | StreamBuffer * | sb, |
| VFSFile * | file, | ||
| bool | close | ||
| ) |
bool sbufFileCRegisterPush(StreamBuffer *sb, VFSFile *file, bool close)
Registers a VFS 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 sbufFileOut() when you need the producer and consumer to operate asynchronously.
| sb | The stream buffer |
| file | VFS file to write to (optionally closed when consumer finishes) |
| close | If true, the file is closed when the consumer finishes |
| bool sbufFileOut | ( | StreamBuffer * | sb, |
| VFSFile * | file, | ||
| bool | close | ||
| ) |
bool sbufFileOut(StreamBuffer *sb, VFSFile *file, bool close)
Consumes all available data from the buffer and writes it to a VFS 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 | VFS file to write to (optionally closed based on close parameter) |
| close | If true, the file is closed after writing |
Example: