]> git.cworth.org Git - apitrace/blobdiff - trace_file.hpp
Time scanning of the file and a few frame reads.
[apitrace] / trace_file.hpp
index fed30a0a8835f64a72c0d61f903279ae3f49b785..2129d1e388f197b9e2cd7e844ddcf836b3e4cbdc 100644 (file)
@@ -143,7 +143,7 @@ inline void File::flush(void)
 inline int File::getc()
 {
     if (!m_isOpened || m_mode != File::Read) {
-        return 0;
+        return -1;
     }
     return rawGetc();
 }
@@ -167,6 +167,40 @@ private:
     void *m_gzFile;
 };
 
+inline bool
+operator<(const File::Offset &one, const File::Offset &two)
+{
+    return one.chunk < two.chunk ||
+            (one.chunk == two.chunk && one.offsetInChunk < two.offsetInChunk);
+}
+
+inline bool
+operator==(const File::Offset &one, const File::Offset &two)
+{
+    return one.chunk == two.chunk &&
+            one.offsetInChunk == two.offsetInChunk;
+}
+
+inline bool
+operator>=(const File::Offset &one, const File::Offset &two)
+{
+    return one.chunk > two.chunk ||
+            (one.chunk == two.chunk && one.offsetInChunk >= two.offsetInChunk);
+}
+
+inline bool
+operator>(const File::Offset &one, const File::Offset &two)
+{
+    return two < one;
+}
+
+inline bool
+operator<=(const File::Offset &one, const File::Offset &two)
+{
+    return two >= one;
+}
+
+
 }
 
 #endif