1 #ifndef MSP_IO_SEEKABLE_H_
2 #define MSP_IO_SEEKABLE_H_
6 #include <msp/core/mspcore_api.h>
14 typedef std::int64_t SeekOffset;
24 class MSPCORE_API bad_seek: public std::runtime_error
27 bad_seek(SeekOffset, SeekType);
28 ~bad_seek() throw() override = default;
32 class MSPCORE_API Seekable: public Base
38 /** Changes the read/write offset. Returns the new offset. */
39 virtual SeekOffset seek(SeekOffset, SeekType) = 0;
41 /** Returns the current read/write offset. */
42 virtual SeekOffset tell() const = 0;
46 SeekOffset sys_seek(Handle &, SeekOffset, SeekType);