#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 | |
| enum | EFlags { fAllowTransparentRead = (1<<0), fCheckFileHeader = (1<<1), fWriteGZipFormat = (1<<2), fRestoreFileAttr = (1<<3) } |
| 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) |
| Compress 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, bool use_stream_data=true) 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... | |
|
|
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 493 of file zlib.cpp. References CCompressionFile::eMode_Write, CCompression::GetFlags(), CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CZipCompressionFile::Open(), s_CollectFileInfo(), and CCompression::SetFlags(). |
|
||||||||||||||||||||||||
|
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 372 of file zlib.cpp. References ERR_COMPRESS, F_ISSET, 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 526 of file zlib.cpp. References CCompressionFile::eMode_Read, F_ISSET, fRestoreFileAttr, CCompression::GetFlags(), CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CZipCompression::SFileInfo::name, CZipCompressionFile::Open(), and CCompression::SetFlags(). |
|
||||||||||||||||
|
Decompress file into specified directory.
Definition at line 570 of file zlib.cpp. References CCompressionFile::eMode_Read, F_ISSET, fRestoreFileAttr, CCompression::GetFlags(), CCompression::GetLevel(), m_MemLevel, m_Strategy, m_WindowBits, CDirEntry::MakePath(), CZipCompression::SFileInfo::name, CZipCompressionFile::Open(), 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 463 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.
Definition at line 624 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 150 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 320 of file zlib.hpp. Referenced by CompressBuffer(), CompressFile(), CZipCompression(), DecompressFile(), DecompressFileIntoDir(), EstimateCompressionBufferSize(), and CZipCompressor::Init(). |
|
|
The parameter to tune compression algorithm.
Definition at line 322 of file zlib.hpp. Referenced by CompressBuffer(), CompressFile(), CZipCompression(), DecompressFile(), DecompressFileIntoDir(), EstimateCompressionBufferSize(), and CZipCompressor::Init(). |
|
|
Compressor stream.
Definition at line 317 of file zlib.hpp. Referenced by CZipCompression(). |
|
|
The base two logarithm of the window size (the size of the history buffer).
Definition at line 318 of file zlib.hpp. Referenced by CompressBuffer(), CompressFile(), CZipCompression(), DecompressBuffer(), DecompressFile(), DecompressFileIntoDir(), EstimateCompressionBufferSize(), CZipDecompressor::Init(), CZipCompressor::Init(), and CZipDecompressor::Process(). |
1.4.6
Modified on Thu Sep 04 03:26:14 2008 by modify_doxy.py rev. 117643