#include <zlib.hpp>
Inheritance diagram for CZipCompression:


Define a base methods for compression/decompression memory buffers and files.
Definition at line 107 of file zlib.hpp.
Public Types | |
| typedef CZipCompression::TFlags | TZipFlags |
| Bitwise OR of EFlags. | |
| enum | EFlags { fAllowTransparentRead = (1<<0), fCheckFileHeader = (1<<1), fWriteGZipFormat = (1<<2), fAllowConcatenatedGZip = (1<<3), fGZip = fCheckFileHeader | fWriteGZipFormat | fAllowConcatenatedGZip, fRestoreFileAttr = (1<<4) } |
| Compression/decompression flags. More... | |
Public Member Functions | |
| CZipCompression (ELevel level=eLevel_Default, int window_bits=kZlibDefaultWbits, int mem_level=kZlibDefaultMemLevel, int strategy=kZlibDefaultStrategy) | |
| Constructor. | |
| virtual | ~CZipCompression (void) |
| Destructor. | |
| virtual CVersionInfo | GetVersion (void) const |
| Return name and version of the compression library. | |
| virtual ELevel | GetDefaultLevel (void) const |
| Returns default compression level for a compression algorithm. | |
| virtual bool | CompressBuffer (const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len) |
| Compress data in the buffer. | |
| virtual bool | DecompressBuffer (const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len) |
| Decompress data in the buffer. | |
| long | EstimateCompressionBufferSize (size_t src_len) |
| Estimate buffer size for data compression. | |
| virtual bool | CompressFile (const string &src_file, const string &dst_file, size_t buf_size=kCompressionDefaultBufSize) |
| Compress file. | |
| virtual bool | DecompressFile (const string &src_file, const string &dst_file, size_t buf_size=kCompressionDefaultBufSize) |
| Decompress file. | |
| virtual bool | DecompressFileIntoDir (const string &src_file, const string &dst_dir, size_t buf_size=kCompressionDefaultBufSize) |
| Decompress file into specified directory. | |
Protected Member Functions | |
| string | FormatErrorMessage (string where, unsigned long pos=0) const |
| Format string with last error description. | |
Protected Attributes | |
| void * | m_Stream |
| Compressor stream. | |
| int | m_WindowBits |
| The base two logarithm of the window size (the size of the history buffer). | |
| int | m_MemLevel |
| The allocation memory level for the internal compression state. | |
| int | m_Strategy |
| The parameter to tune compression algorithm. | |
Classes | |
| struct | SFileInfo |
| Structure to keep compressed file information. More... | |
|
|
Bitwise OR of EFlags.
|
|
|
Compression/decompression flags.
|
|
||||||||||||||||||||
|
Constructor.
Definition at line 86 of file zlib.cpp. References DEF_MEM_LEVEL, kZlibDefaultMemLevel, kZlibDefaultStrategy, kZlibDefaultWbits, m_MemLevel, m_Strategy, m_Stream, m_WindowBits, MAX_WBITS, and Z_DEFAULT_STRATEGY. |
|
|
Destructor.
Definition at line 105 of file zlib.cpp. References STREAM. |
|
||||||||||||||||||||||||
|
Compress data in the buffer. Altogether, the total size of the destination buffer must be little more then size of the source buffer.
Implements ICompression. Definition at line 274 of file zlib.cpp. References crc32(), deflate(), deflateEnd(), deflateInit2_(), ERR_COMPRESS, F_ISSET, FormatErrorMessage(), fWriteGZipFormat, CCompression::GetLevel(), kMax_UInt, LIMIT_SIZE_PARAM_U, m_MemLevel, m_Strategy, m_WindowBits, s_WriteGZipFooter(), s_WriteGZipHeader(), CCompression::SetError(), STREAM, Z_BUF_ERROR, Z_DEFLATED, Z_FINISH, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, zError(), and ZLIB_VERSION. Referenced by CId2Compressor::CompressChunk(), and CPdfObject::x_PrintTo(). |
|
||||||||||||||||
|
Compress file.
Implements ICompression. Definition at line 510 of file zlib.cpp. References CCompressionFile::eMode_Write, CCompression::GetErrorCode(), CCompression::GetErrorDescription(), CCompression::GetFlags(), CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CZipCompressionFile::Open(), s_CollectFileInfo(), CCompression::SetError(), and CCompression::SetFlags(). |
|
||||||||||||||||||||||||
|
Decompress data in the buffer.
Implements ICompression. Definition at line 372 of file zlib.cpp. References check_header(), ERR_COMPRESS, F_ISSET, fAllowConcatenatedGZip, fAllowTransparentRead, fCheckFileHeader, FormatErrorMessage(), inflate(), inflateEnd(), inflateInit2_(), kMax_UInt, LIMIT_SIZE_PARAM_U, m_WindowBits, s_CheckGZipHeader(), CCompression::SetError(), STREAM, Z_BUF_ERROR, Z_FINISH, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, zError(), and ZLIB_VERSION. |
|
||||||||||||||||
|
Decompress file.
Implements ICompression. Definition at line 543 of file zlib.cpp. References CCompressionFile::eMode_Read, F_ISSET, fRestoreFileAttr, CCompression::GetErrorCode(), CCompression::GetErrorDescription(), CCompression::GetFlags(), CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CZipCompression::SFileInfo::name, CZipCompressionFile::Open(), CCompression::SetError(), and CCompression::SetFlags(). |
|
||||||||||||||||
|
Decompress file into specified directory.
Definition at line 587 of file zlib.cpp. References CCompressionFile::eMode_Read, F_ISSET, fRestoreFileAttr, CCompression::GetErrorCode(), CCompression::GetErrorDescription(), CCompression::GetFlags(), CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CDirEntry::MakePath(), CZipCompression::SFileInfo::name, CZipCompressionFile::Open(), CCompression::SetError(), CCompression::SetFlags(), and CDirEntry::SplitPath(). |
|
|
Estimate buffer size for data compression. The function shall estimate the size of buffer required to compress specified number of bytes of data using the CompressBuffer() function. This function may return a conservative value that may be larger than 'src_len'.
Definition at line 480 of file zlib.cpp. References deflateBound(), deflateEnd(), deflateInit2_(), F_ISSET, fWriteGZipFormat, CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CCompression::SetError(), STREAM, Z_DEFLATED, Z_OK, zError(), and ZLIB_VERSION. |
|
||||||||||||
|
Format string with last error description. If pos equl to 0, that use internal m_Stream's position to report. Definition at line 640 of file zlib.cpp. References CCompression::GetErrorCode(), CCompression::GetErrorDescription(), NStr::IntToString(), STREAM, and NStr::UIntToString(). Referenced by CompressBuffer(), DecompressBuffer(), CZipDecompressor::End(), CZipCompressor::End(), CZipCompressor::Finish(), CZipCompressor::Flush(), CZipDecompressor::Init(), CZipCompressor::Init(), CZipDecompressor::Process(), and CZipCompressor::Process(). |
|
|
Returns default compression level for a compression algorithm.
Implements ICompression. Definition at line 160 of file zlib.hpp. References kZlibDefaultCompression. |
|
|
Return name and version of the compression library.
Implements CCompression. Definition at line 268 of file zlib.cpp. References ZLIB_VERSION. |
|
|
The allocation memory level for the internal compression state.
Definition at line 336 of file zlib.hpp. Referenced by CompressBuffer(), CompressFile(), CZipCompression(), DecompressFile(), DecompressFileIntoDir(), EstimateCompressionBufferSize(), and CZipCompressor::Init(). |
|
|
The parameter to tune compression algorithm.
Definition at line 338 of file zlib.hpp. Referenced by CompressBuffer(), CompressFile(), CZipCompression(), DecompressFile(), DecompressFileIntoDir(), EstimateCompressionBufferSize(), and CZipCompressor::Init(). |
|
|
Compressor stream.
Reimplemented in CZipCompressionFile. Definition at line 333 of file zlib.hpp. Referenced by CZipCompression(). |
|
|
The base two logarithm of the window size (the size of the history buffer).
Definition at line 334 of file zlib.hpp. Referenced by CompressBuffer(), CompressFile(), CZipCompression(), DecompressBuffer(), DecompressFile(), DecompressFileIntoDir(), EstimateCompressionBufferSize(), CZipDecompressor::Init(), and CZipCompressor::Init(). |
1.4.6
Modified on Mon Dec 07 16:24:23 2009 by modify_doxy.py rev. 173732