]> git.tdb.fi Git - libs/core.git/blob - source/io/seekable.h
Add an intermediate Seekable interface class
[libs/core.git] / source / io / seekable.h
1 #ifndef MSP_IO_SEEKABLE_H_
2 #define MSP_IO_SEEKABLE_H_
3
4 #include "base.h"
5
6 namespace Msp {
7 namespace IO {
8
9 enum SeekType
10 {
11         S_BEG,
12         S_CUR,
13         S_END
14 };
15
16 int sys_seek_type(SeekType);
17
18
19 class Seekable: public Base
20 {
21 protected:
22         Seekable() { }
23
24 public:
25         /** Changes the read/write offset.  Returns the new offset. */
26         virtual unsigned seek(int, SeekType) = 0;
27         
28         /** Returns the current read/write offset. */
29         virtual unsigned tell() const = 0;
30 };
31
32 } // namespace IO
33 } // namespace Msp
34
35 #endif