]> git.cworth.org Git - apitrace/blobdiff - trace_file.hpp
Actually save the edited calls.
[apitrace] / trace_file.hpp
index f6e77ae8b69802c88f96b8b31b48d6f3cd2c013c..4b1b70ddad6f6bd886ac7aa51c28f5604b281faf 100644 (file)
@@ -40,9 +40,9 @@ public:
         Write
     };
     struct Offset {
-        Offset()
-            : chunk(0),
-              offsetInChunk(0)
+        Offset(uint64_t _chunk = 0, uint32_t _offsetInChunk = 0)
+            : chunk(_chunk),
+              offsetInChunk(_offsetInChunk)
         {}
         uint64_t chunk;
         uint32_t offsetInChunk;
@@ -59,8 +59,6 @@ public:
     bool isOpened() const;
     File::Mode mode() const;
 
-    std::string filename() const;
-
     bool open(const std::string &filename, File::Mode mode);
     bool write(const void *buffer, size_t length);
     bool read(void *buffer, size_t length);
@@ -71,7 +69,7 @@ public:
     int percentRead();
 
     virtual bool supportsOffsets() const = 0;
-    virtual File::Offset currentOffset();
+    virtual File::Offset currentOffset() = 0;
     virtual void setCurrentOffset(const File::Offset &offset);
 protected:
     virtual bool rawOpen(const std::string &filename, File::Mode mode) = 0;
@@ -84,7 +82,6 @@ protected:
     virtual int rawPercentRead() = 0;
 
 protected:
-    std::string m_filename;
     File::Mode m_mode;
     bool m_isOpened;
 };
@@ -99,11 +96,6 @@ inline File::Mode File::mode() const
     return m_mode;
 }
 
-inline std::string File::filename() const
-{
-    return m_filename;
-}
-
 inline bool File::open(const std::string &filename, File::Mode mode)
 {
     if (m_isOpened) {
@@ -178,6 +170,7 @@ public:
 
 
     virtual bool supportsOffsets() const;
+    virtual File::Offset currentOffset();
 protected:
     virtual bool rawOpen(const std::string &filename, File::Mode mode);
     virtual bool rawWrite(const void *buffer, size_t length);