X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_file_zlib.cpp;h=c4eed33dd2df650d9f63826981999b3498a500ad;hb=bd6b0c166872c38289375b7acb807ee790e87096;hp=5d47d5387b366d472777f3577980386f06f80c2a;hpb=76d6c051cd4ff8a631c378d09a670d93051025b4;p=apitrace diff --git a/common/trace_file_zlib.cpp b/common/trace_file_zlib.cpp index 5d47d53..c4eed33 100644 --- a/common/trace_file_zlib.cpp +++ b/common/trace_file_zlib.cpp @@ -33,6 +33,14 @@ #include #include +// for lseek +#ifdef _WIN32 +#include +#else +#include +#include +#endif + #include "os.hpp" #include @@ -60,7 +68,7 @@ protected: virtual bool rawSkip(size_t length); virtual int rawPercentRead(); private: - void *m_gzFile; + gzFile m_gzFile; double m_endOffset; }; @@ -149,19 +157,3 @@ int ZLibFile::rawPercentRead() File * File::createZLib(void) { return new ZLibFile; } - -bool File::isZLibCompressed(const std::string &filename) -{ - std::fstream stream(filename.c_str(), - std::fstream::binary | std::fstream::in); - if (!stream.is_open()) - return false; - - unsigned char byte1, byte2; - stream >> byte1; - stream >> byte2; - stream.close(); - - return (byte1 == 0x1f && byte2 == 0x8b); -} -