]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/seekable.h
Wrap seek in a helper function and make it compatible with 64-bit offsets
[libs/core.git] / source / io / seekable.h
index cabb9dcdfc7ffc50b979163e447443fdd100e3e2..9522311f55b32ae2f75bd2f62f9e233a3f28a6fd 100644 (file)
@@ -6,6 +6,14 @@
 namespace Msp {
 namespace IO {
 
+class Handle;
+
+#ifdef MSVC
+typedef __int64 SeekOffset;
+#else
+typedef long long SeekOffset;
+#endif
+
 enum SeekType
 {
        S_BEG,
@@ -13,8 +21,6 @@ enum SeekType
        S_END
 };
 
-int sys_seek_type(SeekType);
-
 
 class Seekable: public Base
 {
@@ -23,12 +29,15 @@ protected:
 
 public:
        /** Changes the read/write offset.  Returns the new offset. */
-       virtual unsigned seek(int, SeekType) = 0;
+       virtual SeekOffset seek(SeekOffset, SeekType) = 0;
        
        /** Returns the current read/write offset. */
-       virtual unsigned tell() const = 0;
+       virtual SeekOffset tell() const = 0;
 };
 
+
+SeekOffset sys_seek(Handle &, SeekOffset, SeekType);
+
 } // namespace IO
 } // namespace Msp