]> git.cworth.org Git - apitrace/blobdiff - trace_snappyfile.hpp
Make sure that the snappyfile doesn't try to read past the end of file.
[apitrace] / trace_snappyfile.hpp
index e84b0eafb5f7f651ff8827373e6c57ab3804c693..c8c415bf57b47dacf0ee47e4138fdd6f25063ab0 100644 (file)
@@ -58,7 +58,7 @@ protected:
     virtual bool rawRead(void *buffer, int length);
     virtual int rawGetc();
     virtual void rawClose();
-    virtual void rawFlush(FlushType type);
+    virtual void rawFlush();
 
 private:
     inline int freeCacheSize() const
@@ -68,6 +68,10 @@ private:
         else
             return 0;
     }
+    inline bool endOfData() const
+    {
+        return m_stream.eof() && freeCacheSize() == 0;
+    }
     void flushCache();
     void createCache(size_t size);
     void writeCompressedLength(uint32_t  num);