|
libcdoc 0.1.8
|
#include <Io.h>
Inherits libcdoc::MultiDataConsumer.
Public Member Functions | |
| FileListConsumer (const std::string &base_path) | |
| result_t | write (const uint8_t *src, size_t size) override final |
| write write bytes to output object | |
| result_t | close () override final |
| informs DataConsumer that the writing is finished | |
| bool | isError () override final |
| checks whether DataSource is in error state | |
| result_t | open (const std::string &name, int64_t size) override final |
| create a new named sub-stream | |
Public Member Functions inherited from libcdoc::MultiDataConsumer | |
| virtual | ~MultiDataConsumer ()=default |
Public Member Functions inherited from libcdoc::DataConsumer | |
| DataConsumer ()=default | |
| virtual | ~DataConsumer ()=default |
| virtual std::string | getLastErrorStr (result_t code) const |
| get textual description of the last error | |
| result_t | write (const std::vector< uint8_t > &src) |
| write all bytes in vector | |
| result_t | write (const std::string &src) |
| write all bytes in string | |
| result_t | writeAll (DataSource &src) |
| write all data from input object | |
| DataConsumer (const DataConsumer &)=delete | |
| DataConsumer & | operator= (const DataConsumer &)=delete |
Protected Attributes | |
| std::filesystem::path | base |
| std::ofstream | ofs |
|
inline |
References base.
|
inlinefinaloverridevirtual |
informs DataConsumer that the writing is finished
Implements libcdoc::DataConsumer.
References ofs, libcdoc::OK, and libcdoc::OUTPUT_STREAM_ERROR.
|
inlinefinaloverridevirtual |
checks whether DataSource is in error state
Implements libcdoc::DataConsumer.
References ofs.
|
inlinefinaloverridevirtual |
create a new named sub-stream
Creates a new named sub-stream. It is up to implementation to handle the name and optional size.
| name | the name of sub-stream |
| size | the size of sub-stream or -1 if unknown at creation time |
Implements libcdoc::MultiDataConsumer.
References base, ofs, libcdoc::OK, and libcdoc::OUTPUT_STREAM_ERROR.
|
inlinefinaloverridevirtual |
write write bytes to output object
The following invariant holds: If there was no error then result == size If there was an error then result < 0
| src | source block |
| size | the number of bytes to write |
Implements libcdoc::DataConsumer.
References ofs, and libcdoc::OUTPUT_STREAM_ERROR.
|
protected |
Referenced by FileListConsumer(), and open().
|
protected |