Simple stream implementation that appends all data to a given std::string.
More...
#include <SyncStream.hxx>
|
| | StringAppendStream (std::string *output) |
| |
| void | set_output (std::string *output) |
| |
| ssize_t | write (const void *data, size_t len) override |
| | Main entry point to the data consumption.
|
| |
| virtual int | finalize (int status) |
| | Called once after all data has been written to close the stream and release resources.
|
| |
| ssize_t | write_all (const void *data, size_t len) |
| | Repeatedly writes until all data has been consumed or an error occurs.
|
| |
|
| static const uint8_t * | to_8 (const void *d) |
| | Converts a void pointer to an equivalent byte pointer.
|
| |
| static uint8_t * | to_8 (void *d) |
| | Converts a void pointer to an equivalent byte pointer.
|
| |
Simple stream implementation that appends all data to a given std::string.
Definition at line 330 of file SyncStream.hxx.
◆ StringAppendStream()
| StringAppendStream::StringAppendStream |
( |
std::string * |
output | ) |
|
|
inline |
- Parameters
-
| output | is the string to write the data to. Does NOT take ownership of the pointer. |
Definition at line 334 of file SyncStream.hxx.
◆ set_output()
| void StringAppendStream::set_output |
( |
std::string * |
output | ) |
|
|
inline |
◆ write()
| ssize_t StringAppendStream::write |
( |
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlineoverridevirtual |
Main entry point to the data consumption.
- Parameters
-
| data | is the pointer to a block of data to consume. |
| len | is the number of bytes to consume. |
- Returns
- 0 if the stream is completed/EOF (not consuming data anymore); negative value if there is an error; or the number of bytes consumed from the stream.
Implements SyncStream.
Definition at line 341 of file SyncStream.hxx.
◆ output_
| std::string* StringAppendStream::output_ |
|
private |
The documentation for this class was generated from the following file: