34 #ifndef SOMAIO_DATASOURCE_FDDATASOURCE_H
35 #define SOMAIO_DATASOURCE_FDDATASOURCE_H
61 virtual long readBlock(
char* data,
unsigned long maxlen );
62 virtual long writeBlock(
const char* data,
unsigned long len );
Abstraction layer for various data sources (file, buffer, socket...).
int mode() const
access mode(s) (read/write): bitwise OR of Mode values
File Descriptor data source: base class for all sources based on a file descriptor.
virtual bool allowsMemoryMapping() const
in the general case, memory mapping is not possible
virtual DataSource * clone() const
virtual long writeBlock(const char *data, unsigned long len)
virtual bool isOpen() const
virtual bool at(offset_t pos)
virtual int iterateMode() const
possible iteration mode(s): bitwise OR of IterateMode values
virtual bool ungetch(int ch)
virtual int putch(int ch)
void setDescriptor(int fd)
virtual offset_t at() const
virtual offset_t size() const
virtual bool open(int mode)
useless for a file descriptor: a fd is already open
FDDataSource(int fd=-1, int mode=Read)
virtual long readBlock(char *data, unsigned long maxlen)
unsigned long long offset_t
Offsets are 64 bits if supported.