CppCMS
|
This class is a base class of generic I/O device that can be used in very simple manner with booster::streambuf allowing to create iostreams easily. More...
#include <booster/booster/streambuf.h>
Public Types | |
enum | pos_type { set, cur, end } |
Public Member Functions | |
virtual size_t | read (char *, size_t) |
virtual size_t | write (char const *, size_t) |
virtual long long | seek (long long, pos_type=set) |
This class is a base class of generic I/O device that can be used in very simple manner with booster::streambuf allowing to create iostreams easily.
virtual size_t booster::io_device::read | ( | char * | , |
size_t | |||
) | [inline, virtual] |
Read length bytes from the stream to buffer pos, return number of bytes actually read. If return value is less then length, it is considered end of file
If the stream is write only, do not implement (returns EOF by default)
virtual long long booster::io_device::seek | ( | long | long, |
pos_type | = set |
||
) | [inline, virtual] |
Seek the device to position relatively to pos. Return current position in file.
If error occurs return -1.
If the stream is not seekable do not reimplement, returns -1 by default.
virtual size_t booster::io_device::write | ( | char const * | , |
size_t | |||
) | [inline, virtual] |
Write length bytes to the devise from buffer pos, return number of bytes actually written, if the result is less then length, considered as EOF.
If the stream is read only, do not implement (returns EOF by default)