#include <bzip2.hpp>
Inheritance diagram for CBZip2Compression:


Define a base methods for compression/decompression memory buffers and files.
Definition at line 90 of file bzip2.hpp.
Public Types | |
| typedef CBZip2Compression::TFlags | TBZip2Flags |
| Bitwise OR of EFlags. | |
| enum | EFlags { fAllowTransparentRead = (1<<0) } |
| Compression/decompression flags. More... | |
Public Member Functions | |
| CBZip2Compression (ELevel level=eLevel_Default, int verbosity=0, int work_factor=0, int small_decompress=0) | |
| Constructor. | |
| virtual | ~CBZip2Compression (void) |
| Destructor. | |
| virtual CVersionInfo | GetVersion (void) const |
| Return name and version of the compression library. | |
| virtual ELevel | GetLevel (void) const |
| Get compression level. | |
| virtual ELevel | GetDefaultLevel (void) const |
| Return 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. | |
| 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. | |
Protected Member Functions | |
| const char * | GetBZip2ErrorDescription (int errcode) |
| Get error description for specified error code. | |
| 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_Verbosity |
| Verbose monitoring/debugging output level. | |
| int | m_WorkFactor |
| See description above. | |
| int | m_SmallDecompress |
| Use memory-frugal decompression algorithm. | |
|
|
Bitwise OR of EFlags.
|
|
|
||||||||||||||||||||
|
Constructor.
Definition at line 60 of file bzip2.cpp. References m_Stream. |
|
|
Destructor.
Definition at line 74 of file bzip2.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 98 of file bzip2.cpp. References BZ2_bzBuffToBuffCompress(), BZ_OK, BZ_PARAM_ERROR, ERR_COMPRESS, FormatErrorMessage(), GetBZip2ErrorDescription(), GetLevel(), kMax_UInt, LIMIT_SIZE_PARAM_U, and CCompression::SetError(). |
|
||||||||||||||||
|
Compress file.
Implements ICompression. Definition at line 189 of file bzip2.cpp. References CCompressionFile::eMode_Write, CCompression::GetErrorCode(), CCompression::GetErrorDescription(), CCompression::GetFlags(), GetLevel(), m_SmallDecompress, m_Verbosity, m_WorkFactor, CBZip2CompressionFile::Open(), CCompression::SetError(), and CCompression::SetFlags(). |
|
||||||||||||||||||||||||
|
Decompress data in the buffer.
Implements ICompression. Definition at line 140 of file bzip2.cpp. References BZ2_bzBuffToBuffDecompress(), BZ_DATA_ERROR, BZ_DATA_ERROR_MAGIC, BZ_OK, BZ_PARAM_ERROR, ERR_COMPRESS, F_ISSET, fAllowTransparentRead, FormatErrorMessage(), GetBZip2ErrorDescription(), kMax_UInt, LIMIT_SIZE_PARAM_U, and CCompression::SetError(). |
|
||||||||||||||||
|
Decompress file.
Implements ICompression. Definition at line 217 of file bzip2.cpp. References CCompressionFile::eMode_Read, CCompression::GetErrorCode(), CCompression::GetErrorDescription(), CCompression::GetFlags(), GetLevel(), m_SmallDecompress, m_Verbosity, m_WorkFactor, CBZip2CompressionFile::Open(), CCompression::SetError(), and CCompression::SetFlags(). |
|
||||||||||||
|
Format string with last error description.
Definition at line 269 of file bzip2.cpp. References CCompression::GetErrorCode(), CCompression::GetErrorDescription(), NStr::IntToString(), STREAM, and NStr::UInt8ToString(). Referenced by CBZip2CompressionFile::Close(), CompressBuffer(), DecompressBuffer(), CBZip2Decompressor::End(), CBZip2Compressor::End(), CBZip2Compressor::Finish(), CBZip2Compressor::Flush(), CBZip2Decompressor::Init(), CBZip2Compressor::Init(), CBZip2CompressionFile::Open(), CBZip2Decompressor::Process(), CBZip2Compressor::Process(), CBZip2CompressionFile::Read(), and CBZip2CompressionFile::Write(). |
|
|
Get error description for specified error code.
Definition at line 247 of file bzip2.cpp. Referenced by CBZip2CompressionFile::Close(), CompressBuffer(), DecompressBuffer(), CBZip2Compressor::End(), CBZip2Compressor::Finish(), CBZip2Compressor::Flush(), CBZip2Decompressor::Init(), CBZip2Compressor::Init(), CBZip2CompressionFile::Open(), CBZip2Decompressor::Process(), CBZip2Compressor::Process(), CBZip2CompressionFile::Read(), and CBZip2CompressionFile::Write(). |
|
|
Return default compression level for a compression algorithm.
Implements ICompression. Definition at line 126 of file bzip2.hpp. References ICompression::eLevel_VeryHigh. |
|
|
Get compression level. NOTE: BZip2 algorithm do not support zero level compression. So the "eLevel_NoCompression" will be translated to "eLevel_Lowest". Reimplemented from CCompression. Definition at line 87 of file bzip2.cpp. References ICompression::eLevel_Lowest, ICompression::eLevel_NoCompression, and CCompression::GetLevel(). Referenced by CompressBuffer(), CompressFile(), DecompressFile(), CBZip2Compressor::Init(), and CBZip2CompressionFile::Open(). |
|
|
Return name and version of the compression library.
Implements CCompression. Definition at line 81 of file bzip2.cpp. References BZ2_bzlibVersion(). |
|
|
Use memory-frugal decompression algorithm.
Definition at line 228 of file bzip2.hpp. Referenced by CompressFile(), DecompressFile(), CBZip2Decompressor::Init(), and CBZip2CompressionFile::Open(). |
|
|
Compressor stream.
Definition at line 225 of file bzip2.hpp. Referenced by CBZip2Compression(). |
|
|
Verbose monitoring/debugging output level.
Definition at line 226 of file bzip2.hpp. Referenced by CompressFile(), DecompressFile(), CBZip2Decompressor::Init(), CBZip2Compressor::Init(), and CBZip2CompressionFile::Open(). |
|
|
See description above.
Definition at line 227 of file bzip2.hpp. Referenced by CompressFile(), DecompressFile(), CBZip2Compressor::Init(), and CBZip2CompressionFile::Open(). |
1.4.6
Modified on Mon Dec 07 16:22:46 2009 by modify_doxy.py rev. 173732