NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CBZip2Compression Class Reference

Search Toolkit Book for CBZip2Compression

CBZip2Compression –. More...

#include <util/compress/bzip2.hpp>

+ Inheritance diagram for CBZip2Compression:
+ Collaboration diagram for CBZip2Compression:

Public Types

enum  EFlags { fAllowTransparentRead = (1<<0) , fAllowEmptyData = (1<<1) }
 Compression/decompression flags. More...
 
typedef CBZip2Compression::TFlags TBZip2Flags
 Bitwise OR of EFlags. More...
 
- Public Types inherited from ICompression
enum  ELevel {
  eLevel_Default = -1 , eLevel_NoCompression = 0 , eLevel_Lowest = 1 , eLevel_VeryLow = 2 ,
  eLevel_Low = 3 , eLevel_MediumLow = 4 , eLevel_Medium = 5 , eLevel_MediumHigh = 6 ,
  eLevel_High = 7 , eLevel_VeryHigh = 8 , eLevel_Best = 9
}
 Compression level. More...
 
enum  ESupportFeature { eFeature_NoCompression , eFeature_Dictionary , eFeature_EstimateCompressionBufferSize }
 Supported features. More...
 
typedef unsigned int TFlags
 Compression flags. More...
 

Public Member Functions

 CBZip2Compression (ELevel level=eLevel_Default)
 Constructor. More...
 
virtual ~CBZip2Compression (void)
 Destructor. More...
 
virtual CVersionInfo GetVersion (void) const
 Return name and version of the compression library. More...
 
virtual ELevel GetLevel (void) const
 Get compression level. More...
 
virtual ELevel GetDefaultLevel (void) const
 Return default compression level for a compression algorithm. More...
 
virtual bool HaveSupport (ESupportFeature feature)
 Check if compression have support for a specified feature. More...
 
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. More...
 
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. More...
 
virtual size_t EstimateCompressionBufferSize (size_t)
 
virtual bool CompressFile (const string &src_file, const string &dst_file, size_t file_io_bufsize=kCompressionDefaultBufSize, size_t compression_in_bufsize=kCompressionDefaultBufSize, size_t compression_out_bufsize=kCompressionDefaultBufSize)
 Compress file. More...
 
virtual bool DecompressFile (const string &src_file, const string &dst_file, size_t file_io_bufsize=kCompressionDefaultBufSize, size_t decompression_in_bufsize=kCompressionDefaultBufSize, size_t decompression_out_bufsize=kCompressionDefaultBufSize)
 Decompress file. More...
 
virtual bool SetDictionary (CCompressionDictionary &dict, ENcbiOwnership own=eNoOwnership)
 
void SetWorkFactor (int work_factor)
 Work factor. More...
 
int GetWorkFactor (void) const
 
void SetSmallDecompress (bool small_decompres)
 Small decompress. More...
 
bool GetSmallDecompress (void) const
 
- Public Member Functions inherited from CCompression
 CCompression (ELevel level=eLevel_Default)
 
virtual ~CCompression (void)
 
virtual void SetLevel (ELevel level)
 Get/set compression level. More...
 
virtual int GetErrorCode (void) const
 Get compressor's internal status/error code and description for the last operation. More...
 
virtual string GetErrorDescription (void) const
 
virtual TFlags GetFlags (void) const
 Get/set flags. More...
 
virtual void SetFlags (TFlags flags)
 
- Public Member Functions inherited from ICompression
virtual ~ICompression (void)
 Destructor. More...
 

Static Public Member Functions

static bool Initialize (void)
 Initialize compression library (for API compatibility, bz2 don't need it). More...
 
static SRecommendedBufferSizes GetRecommendedBufferSizes (size_t round_up=0)
 Get recommended buffer sizes for stream/file I/O. More...
 
static int GetWorkFactorDefault (void)
 
static int GetWorkFactorMin (void)
 
static int GetWorkFactorMax (void)
 
static bool GetSmallDecompressDefault (void)
 

Protected Member Functions

const char * GetBZip2ErrorDescription (int errcode)
 Get error description for specified error code. More...
 
string FormatErrorMessage (string where, bool use_stream_data=true) const
 Format string with last error description. More...
 
- Protected Member Functions inherited from CCompression
void SetError (int status, const char *description=0)
 Set last action error/status code and description. More...
 
void SetError (int status, const string &description)
 
virtual bool x_CompressFile (const string &src_file, CCompressionFile &dst_file, size_t file_io_bufsize=kCompressionDefaultBufSize)
 Universal file compression function. More...
 
virtual bool x_DecompressFile (CCompressionFile &src_file, const string &dst_file, size_t file_io_bufsize=kCompressionDefaultBufSize)
 Universal file decompression function. More...
 

Protected Attributes

void * m_Stream
 Compressor stream. More...
 
int m_c_WorkFactor
 See description above. More...
 
int m_d_SmallDecompress
 Use memory-frugal decompression algorithm. More...
 
- Protected Attributes inherited from CCompression
EDecompressMode m_DecompressMode
 Decompress mode (Decompress/TransparentRead/Unknown) More...
 
CCompressionDictionarym_Dict
 Dictionary for compression/decompression. More...
 
ENcbiOwnership m_DictOwn
 Dictionary ownership. More...
 

Private Member Functions

 CBZip2Compression (const CBZip2Compression &)
 Private copy constructor to prohibit copy. More...
 
CBZip2Compressionoperator= (const CBZip2Compression &)
 Private assignment operator to prohibit assignment. More...
 

Additional Inherited Members

- Protected Types inherited from CCompression
enum  EDecompressMode { eMode_Unknown , eMode_Decompress , eMode_TransparentRead }
 Decompression mode (see fAllowTransparentRead flag). More...
 

Detailed Description

CBZip2Compression –.

Define a base methods for compression/decompression memory buffers and files.

Definition at line 55 of file bzip2.hpp.


The documentation for this class was generated from the following file:
Modified on Fri Feb 23 11:45:21 2024 by modify_doxy.py rev. 669887