32 #ifndef GZipCodec_INCLUDE_ONCE 33 #define GZipCodec_INCLUDE_ONCE 48 static const int CHUNK_SIZE = 128*1024;
66 virtual bool isOpen()
const {
return mReadBytes != -1; }
69 virtual bool exists()
const {
return mStream ? mStream->exists() :
false; }
75 virtual long long size()
const;
101 long long uncompressedSize();
107 float compressionRatio()
const;
114 virtual long long read_Implementation(
void* buffer,
long long bytes_to_read);
115 virtual long long write_Implementation(
const void* buffer,
long long byte_count);
116 virtual long long position_Implementation()
const;
118 bool seekSet_Implementation(
long long pos);
119 bool fillUncompressedBuffer();
129 unsigned char mZipBufferIn[CHUNK_SIZE];
130 unsigned char mZipBufferOut[CHUNK_SIZE];
135 enum {
ZNone, ZCompress, ZDecompress } mMode;
int mUncompressedBufferPtr
long long compressedSize() const
Returns the size of the compressed stream as returned by stream()->size().
An abstract class representing a file.
void setWarnOnSeek(bool warn_on)
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
long long mUncompressedSize
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
void setCompressionLevel(int level)
Sets the compression level used during write operations.
Visualization Library main namespace.
std::vector< char > mUncompressedBuffer
virtual bool exists() const
Returns true if the input or output stream file exists.
The GZipCodec class is a VirtualFile that transparently encodes and decodes a stream of data using th...
virtual long long size() const =0
Returns the size of the file in bytes.
VirtualFile * stream()
Returns the VirtualFile representing the GZip file to be read or to be written.
virtual bool isOpen() const
Returns true if the file is open for read or writing.
The ref<> class is used to reference-count an Object.
ref< VirtualFile > mStream
int compressionLevel() const
const VirtualFile * stream() const
Returns the VirtualFile representing the GZip file to be read or to be written.