]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/seekable.h
Add an intermediate Seekable interface class
[libs/core.git] / source / io / seekable.h
diff --git a/source/io/seekable.h b/source/io/seekable.h
new file mode 100644 (file)
index 0000000..cabb9dc
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef MSP_IO_SEEKABLE_H_
+#define MSP_IO_SEEKABLE_H_
+
+#include "base.h"
+
+namespace Msp {
+namespace IO {
+
+enum SeekType
+{
+       S_BEG,
+       S_CUR,
+       S_END
+};
+
+int sys_seek_type(SeekType);
+
+
+class Seekable: public Base
+{
+protected:
+       Seekable() { }
+
+public:
+       /** Changes the read/write offset.  Returns the new offset. */
+       virtual unsigned seek(int, SeekType) = 0;
+       
+       /** Returns the current read/write offset. */
+       virtual unsigned tell() const = 0;
+};
+
+} // namespace IO
+} // namespace Msp
+
+#endif