diff options
Diffstat (limited to 'lib/base/idatasource.h')
| -rw-r--r-- | lib/base/idatasource.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/base/idatasource.h b/lib/base/idatasource.h new file mode 100644 index 00000000..0daa5267 --- /dev/null +++ b/lib/base/idatasource.h @@ -0,0 +1,19 @@ +#ifndef __lib_base_idatasource_h +#define __lib_base_idatasource_h + +#include <lib/base/object.h> + +class iDataSource: public iObject +{ +public: + /* NOTE: should only be used to get current position or filelength */ + virtual off_t lseek(off_t offset, int whence)=0; + + /* NOTE: you must be able to handle short reads! */ + virtual ssize_t read(off_t offset, void *buf, size_t count)=0; /* NOTE: this is what you in normal case have to use!! */ + + virtual off_t length()=0; + virtual int valid()=0; +}; + +#endif |
