rili::stream::ReadableFileProxy::ReadableFileProxy |
( |
FILE * |
readableFile | ) |
|
|
inlineexplicit |
ReadableFileProxy check if file is not nullptr and construct stream with prefferedChunkSize = 1024, otherwise throw std::invalid_argument exception.
- Parameters
-
readableFile | ready to use open readable FILE* |
rili::stream::ReadableFileProxy::ReadableFileProxy |
( |
FILE * |
readableFile, |
|
|
std::size_t |
preferedChunkSize |
|
) |
| |
|
inline |
ReadableFileProxy check if file is not nullptr and construct stream with given prefferedChunkSize, otherwise throw exception.
- Parameters
-
readableFile | ready to use open readable FILE* |
preferedChunkSize | number of bytes which will be tried to fetch at one shot from file if other size not explicitely asked for pull(std::size_t count) method. In case of unreliable/unpredictiable blocking data sources it's better to keep it relatively small. Otherwise read operation will block until whole chunk is avaliable even if higher level Reader do not need whole chunk. For reliable data sources like normal files bigger values will benefit in better preformance. |
void rili::stream::ReadableFileProxy::consume |
( |
std::size_t |
size | ) |
|
|
overridevirtual |
consume remove given number of bytes from front of view
- Parameters
-
size | number of bytes to remove |
Implements rili::stream::Readable.
std::exception_ptr rili::stream::ReadableFileProxy::pull |
( |
std::size_t |
count | ) |
|
|
overridevirtual |
pull used to pull from stream underlying sink at least given number of bytes
- Parameters
-
count | number of bytes to retrieve from sink |
- Returns
- error exception if occured
- Note
- implementation of this function do not should provide at least count number of bytes to view.
-
count equal to 0 means implementation should provide zero or more bytes to view and implementation should choose easiest amount to provide.
Implements rili::stream::Readable.
view::Base const& rili::stream::ReadableFileProxy::readableView |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following file:
- rili/stream/CstdioWrappers.hpp