X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=trace_file.hpp;h=2129d1e388f197b9e2cd7e844ddcf836b3e4cbdc;hb=e0df952b67f3ae38aeb0fd7e32942f8fa53ac49f;hp=e3d797d3b20d3228f06711cfc9b3d31eef86c7a5;hpb=8216d8efc428dd336957433d743af5c4ac2d0d05;p=apitrace diff --git a/trace_file.hpp b/trace_file.hpp index e3d797d..2129d1e 100644 --- a/trace_file.hpp +++ b/trace_file.hpp @@ -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