NCBI C++ ToolKit
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
CCompression Class Referenceabstract

Search Toolkit Book for CCompression

#include <util/compress/compress.hpp>

+ Inheritance diagram for CCompression:
+ Collaboration diagram for CCompression:

Classes

struct  SRecommendedBufferSizes
 Structure to get information about recommended buffer sizes for file/stream I/O to tune up a (de)compression performance. More...
 

Public Member Functions

 CCompression (ELevel level=eLevel_Default)
 
virtual ~CCompression (void)
 
virtual CVersionInfo GetVersion (void) const =0
 Return name and version of the compression library. More...
 
virtual void SetLevel (ELevel level)
 Get/set compression level. More...
 
virtual ELevel GetLevel (void) const
 
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...
 
virtual ELevel GetDefaultLevel (void) const =0
 Return the default compression level for current compression algorithm. More...
 
virtual bool HaveSupport (ESupportFeature feature)=0
 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)=0
 (De)compress the source buffer into the destination buffer. More...
 
virtual bool DecompressBuffer (const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)=0
 
virtual size_t EstimateCompressionBufferSize (size_t src_len)=0
 Estimate buffer size for data compression (if supported). More...
 
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)=0
 (De)compress file "src_file" and put result to file "dst_file". More...
 
virtual bool DecompressFile (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)=0
 
virtual bool SetDictionary (CCompressionDictionary &dict, ENcbiOwnership own=eNoOwnership)=0
 Set a dictionary for all compression/decompression operations (if supported). More...
 

Protected Types

enum  EDecompressMode { eMode_Unknown , eMode_Decompress , eMode_TransparentRead }
 Decompression mode (see fAllowTransparentRead flag). More...
 

Protected Member Functions

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

EDecompressMode m_DecompressMode
 Decompress mode (Decompress/TransparentRead/Unknown) More...
 
CCompressionDictionarym_Dict
 Dictionary for compression/decompression. More...
 
ENcbiOwnership m_DictOwn
 Dictionary ownership. More...
 

Private Attributes

ELevel m_Level
 Compression level. More...
 
int m_ErrorCode
 Last compressor action error/status. More...
 
string m_ErrorMsg
 Last compressor action error message. More...
 
TFlags m_Flags
 Bitwise OR of flags. More...
 

Friends

class CCompressionStreambuf
 

Additional Inherited Members

- 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...
 

Detailed Description

Definition at line 269 of file compress.hpp.


The documentation for this class was generated from the following files:
Modified on Sat Apr 13 11:50:42 2024 by modify_doxy.py rev. 669887