The DataConsumer class.
More...
#include <Io.h>
Inherited by libcdoc::ChainedConsumer, libcdoc::MultiDataConsumer, libcdoc::OStreamConsumer, and libcdoc::VectorConsumer.
The DataConsumer class.
An abstact base class for ouput objects
◆ DataConsumer() [1/2]
libcdoc::DataConsumer::DataConsumer |
( |
| ) |
|
|
default |
◆ ~DataConsumer()
virtual libcdoc::DataConsumer::~DataConsumer |
( |
| ) |
|
|
virtualdefault |
◆ DataConsumer() [2/2]
libcdoc::DataConsumer::DataConsumer |
( |
const DataConsumer & |
| ) |
|
|
delete |
◆ close()
virtual result_t libcdoc::DataConsumer::close |
( |
| ) |
|
|
pure virtual |
◆ getLastErrorStr()
virtual std::string libcdoc::DataConsumer::getLastErrorStr |
( |
result_t |
code | ) |
const |
|
virtual |
get textual description of the last error
Implementation can decide whether to store the actual error string or return the generic text based on error code. It is undefined what will be returned if the last error code is not the one used as the argument.
- Parameters
-
code | the last returned error code |
- Returns
- error text
◆ isError()
virtual bool libcdoc::DataConsumer::isError |
( |
| ) |
|
|
pure virtual |
◆ operator=()
◆ write() [1/3]
result_t libcdoc::DataConsumer::write |
( |
const std::string & |
src | ) |
|
|
inline |
write all bytes in string
- Parameters
-
- Returns
- string length or error code
◆ write() [2/3]
result_t libcdoc::DataConsumer::write |
( |
const std::vector< uint8_t > & |
src | ) |
|
|
inline |
write all bytes in vector
- Parameters
-
- Returns
- vector size or error code
◆ write() [3/3]
virtual result_t libcdoc::DataConsumer::write |
( |
const uint8_t * |
src, |
|
|
size_t |
size |
|
) |
| |
|
pure virtual |
◆ writeAll()
write all data from input object
Copies all bytes from input source (until EOF or error) to the consumer. If error occurs while reading source, the source objects' error code is returned.
- Parameters
-
- Returns
- the number of bytes copied or error
Referenced by libcdoc::DataSource::readAll().
The documentation for this struct was generated from the following file: