]> git.cworth.org Git - apitrace/blobdiff - trace_snappyfile.cpp
Actually save the edited calls.
[apitrace] / trace_snappyfile.cpp
index 1794a829c6635c2a57a11b33e446958dc908fe54..4dbe42dc364264a8db0e717a1af17681b9af271e 100644 (file)
@@ -93,6 +93,10 @@ bool SnappyFile::rawOpen(const std::string &filename, File::Mode mode)
 
     //read in the initial buffer if we're reading
     if (m_stream.is_open() && mode == File::Read) {
+        m_stream.seekg(0, std::ios::end);
+        m_endPos = m_stream.tellg();
+        m_stream.seekg(0, std::ios::beg);
+
         // read the snappy file identifier
         unsigned char byte1, byte2;
         m_stream >> byte1;
@@ -327,3 +331,8 @@ bool SnappyFile::rawSkip(size_t length)
 
     return true;
 }
+
+int SnappyFile::rawPercentRead()
+{
+    return 100 * (double(m_stream.tellg()) / double(m_endPos));
+}