X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_file_zlib.cpp;h=c4eed33dd2df650d9f63826981999b3498a500ad;hb=ef7013981f3bf403b375a998faf49f4b8f59083c;hp=3a01df359046721542edd909640cf6318a99ba23;hpb=05fa80124e0546b6d7cc4701ffe37efc3ced5521;p=apitrace diff --git a/common/trace_file_zlib.cpp b/common/trace_file_zlib.cpp index 3a01df3..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 @@ -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); -} -