#include <zlib.h>
#include <snappy.h>
+#include "os.hpp"
+
#include <iostream>
using namespace Trace;
}
m_isOpened = rawOpen(filename, mode);
m_mode = mode;
+
return m_isOpened;
}
}
}
-void File::flush()
+void File::flush(FlushType type)
{
- rawFlush();
+ rawFlush(type);
}
int File::getc()
}
}
-void ZLibFile::rawFlush()
+void ZLibFile::rawFlush(FlushType type)
{
gzflush(m_gzFile, Z_SYNC_FLUSH);
}
sizeToRead -= chunkSize;
if (sizeToRead > 0)
flushCache();
+ if (!m_cacheSize)
+ break;
}
}
m_cachePtr = NULL;
}
-void SnappyFile::rawFlush()
+void SnappyFile::rawFlush(FlushType type)
{
+ if (type == FlushDeep) {
+ flushCache();
+ }
m_stream.flush();
}