booster::io_device Class Reference

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)

## Detailed Description

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.

## Member Enumeration Documentation

enum booster::io_device::pos_type

Seek reference

Enumerator
set | Set actual position (i.e. SEEK_CUR)
cur | Set relatively to current position (i.e. SEEK_CUR)
end | Set relatively to end of file (i.e. SEEK_END)

## Member Function Documentation

virtual size_t booster::io_device::read | ( | char * | ,
|  | size_t |
| ) |  |

inlinevirtual

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`
| ) |  |

inlinevirtual

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 |
| ) |  |

inlinevirtual

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)

The documentation for this class was generated from the following file:

- booster/streambuf.h