Public Member Functions | |
fd_ctrl (int aFilDes, const visitor &aVisit, size_t aBufSz) | |
bool | not_empty (void) const |
Private Attributes | |
bool | _notEmpty |
rpa::fd_ctrl::fd_ctrl | ( | int | aFilDes, | |
const visitor & | aVisit, | |||
size_t | aBufSz | |||
) | [inline] |
This receive as parameter, an int file descriptor, and a visitor. This will read data from the file descriptor, in a loop, and pass each segment to the visitor.
Now we need a buffer for read/write cycles. This will be automatically freed if an exception is thrown.
Beware that the file position type might be different than size_t, if the files are 64 bits large.
If mispredict, this is an IO error.
bool rpa::fd_ctrl::not_empty | ( | void | ) | const [inline] |
Tells whether data was written or not. It is used to deduce whether it is necessary to clean up the input or not.
bool rpa::fd_ctrl::_notEmpty [private] |