CppCMS
Public Types | Public Member Functions
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>

List of all members.

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

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


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