#include <Io.h>
Inherits libcdoc::DataSource.
◆ IStreamSource() [1/2]
libcdoc::IStreamSource::IStreamSource |
( |
std::istream * |
ifs, |
|
|
bool |
take_ownership = false |
|
) |
| |
|
inline |
◆ IStreamSource() [2/2]
libcdoc::IStreamSource::IStreamSource |
( |
const std::string & |
path | ) |
|
◆ ~IStreamSource()
libcdoc::IStreamSource::~IStreamSource |
( |
| ) |
|
|
inline |
◆ isEof()
bool libcdoc::IStreamSource::isEof |
( |
| ) |
|
|
inlinevirtual |
◆ isError()
bool libcdoc::IStreamSource::isError |
( |
| ) |
|
|
inlinevirtual |
◆ read()
result_t libcdoc::IStreamSource::read |
( |
uint8_t * |
dst, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
read bytes from input object
The following invariant holds:
- if there is neither error nor eof then result == size
- if there is no errors but end of stream is reached then 0 <= result <= size
- if there is error then result < 0
- Parameters
-
dst | the destination block |
size | the number of bytes to read |
- Returns
- the number of bytes read or error code
Reimplemented from libcdoc::DataSource.
References libcdoc::INPUT_STREAM_ERROR.
◆ seek()
result_t libcdoc::IStreamSource::seek |
( |
size_t |
pos | ) |
|
|
inlinevirtual |
set stream input pointer
Positions the read pointer at the specific distance from the stream start. If the stream does not support seeking NOT_IMPLEMENTED is returned.
- Parameters
-
pos | the position from the beggining of data |
- Returns
- error code or OK
Reimplemented from libcdoc::DataSource.
References libcdoc::INPUT_STREAM_ERROR, and libcdoc::OK.
◆ _ifs
std::istream* libcdoc::IStreamSource::_ifs |
|
protected |
◆ _owned
bool libcdoc::IStreamSource::_owned |
|
protected |
The documentation for this struct was generated from the following file: