-class iDataSource: public iObject
-{
-public:
- virtual off_t lseek(off_t offset, int whence)=0;
- virtual ssize_t read(void *buf, size_t count)=0; /* NOTE: you must be able to handle short reads! */
- virtual off_t length()=0;
- virtual off_t position()=0;
- virtual int valid()=0;
- virtual eSingleLock &getLock()=0;
- virtual bool is_shared()=0;
-};
-
-class iDataSourcePositionRestorer
-{
- ePtr<iDataSource> &m_source;
- off_t m_position;
-public:
- iDataSourcePositionRestorer(ePtr<iDataSource> &source)
- :m_source(source)
- {
- if (m_source->is_shared())
- m_position = m_source->position();
- }
- ~iDataSourcePositionRestorer()
- {
- if (m_source->is_shared())
- m_source->lseek(m_position, SEEK_SET);
- }
-};
-
-class eRawFile: public iDataSource