Add ::seek().
authorCarl Hetherington <cth@carlh.net>
Wed, 13 Apr 2022 21:37:19 +0000 (23:37 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 5 May 2022 19:46:30 +0000 (21:46 +0200)
src/file.cc
src/file.h

index f7c865b221141b3735d0d10ee68c5aa0327ae539..9ee91fe709aa03c36503d6c03eb1c6834b89f624 100644 (file)
@@ -143,6 +143,18 @@ File::take()
 }
 
 
+int
+File::seek(int64_t offset, int whence)
+{
+       DCP_ASSERT(_file);
+#ifdef LIBDCP_WINDOWS
+       return fseeki64(_file, offset, whence);
+#else
+       return fseek(_file, offset, whence);
+#endif
+}
+
+
 /** Windows can't "by default" cope with paths longer than 260 characters, so if you pass such a path to
  *  any boost::filesystem method it will fail.  There is a "fix" for this, which is to prepend
  *  the string \\?\ to the path.  This will make it work, so long as:
index 7dae44a61ec29ad9ddcf9b3fa1b8c782025d1dc9..1817dc9cc3461a048a2feb30c9c8aeffddd595b1 100644 (file)
@@ -63,6 +63,8 @@ public:
        int eof();
        /** fgets() wrapper */
        char *gets(char *s, int size);
+       /** fseek/fseeki64 wrapper */
+       int seek(int64_t offset, int whence);
 
        void checked_write(void const * ptr, size_t size);
        void checked_read(void* ptr, size_t size);