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

Search Toolkit Book for CLZOCompressionFile

CLZOCompressionFile class –. More...

#include <util/compress/lzo.hpp>

+ Inheritance diagram for CLZOCompressionFile:
+ Collaboration diagram for CLZOCompressionFile:

Public Member Functions

 CLZOCompressionFile (const string &file_name, EMode mode, ELevel level=eLevel_Default, size_t compression_in_bufsize=kCompressionDefaultBufSize, size_t compression_out_bufsize=kCompressionDefaultBufSize)
 Constructor. More...
 
 CLZOCompressionFile (ELevel level=eLevel_Default)
 Conventional constructor. More...
 
 ~CLZOCompressionFile (void)
 Destructor. More...
 
virtual bool Open (const string &file_name, EMode mode, size_t compression_in_bufsize=kCompressionDefaultBufSize, size_t compression_out_bufsize=kCompressionDefaultBufSize)
 Opens a compressed file for reading or writing. More...
 
virtual bool Open (const string &file_name, EMode mode, SFileInfo *info, size_t compression_in_bufsize=kCompressionDefaultBufSize, size_t compression_out_bufsize=kCompressionDefaultBufSize)
 Opens a compressed file for reading or writing. More...
 
virtual long Read (void *buf, size_t len)
 Read data from compressed file. More...
 
virtual long Write (const void *buf, size_t len)
 Write data to compressed file. More...
 
virtual bool Close (void)
 Close compressed file. More...
 
- Public Member Functions inherited from CLZOCompression
 CLZOCompression (ELevel level=eLevel_Default)
 Constructor. More...
 
virtual ~CLZOCompression (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
 Returns 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 src_len)
 Estimate buffer size for data compression. 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)
 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 SetBlockSize (size_t block_size)
 Block size. More...
 
size_t GetBlockSize (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...
 
- Public Member Functions inherited from CCompressionFile
 CCompressionFile (void)
 
 CCompressionFile (const string &path, EMode mode, size_t compression_in_bufsize=0, size_t compression_out_bufsize=0)
 
virtual ~CCompressionFile (void)
 

Protected Member Functions

void GetStreamError (void)
 Get error code/description of last stream operation (m_Stream). More...
 
- Protected Member Functions inherited from CLZOCompression
void InitCompression (ELevel level)
 Initialize compression parameters. More...
 
const char * GetLZOErrorDescription (int errcode)
 Get error description for specified error code. More...
 
string FormatErrorMessage (string where) const
 Format string with last error description. More...
 
int CompressBlock (const void *src_buf, size_t src_len, void *dst_buf, size_t *dst_len)
 Compress block of data. More...
 
int CompressBlockStream (const void *src_buf, size_t src_len, void *dst_buf, size_t *dst_len)
 Compress block of data for stream format (fStreamFormat flag). More...
 
int DecompressBlock (const void *src_buf, size_t src_len, void *dst_buf, size_t *dst_len, TLZOFlags flags)
 Decompress block of data. More...
 
int DecompressBlockStream (const void *src_buf, size_t src_len, void *dst_buf, size_t *dst_len, TLZOFlags flags, size_t *processed)
 Decompress block of data for stream format (fStreamFormat flag). 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

EMode m_Mode
 I/O mode (read/write). More...
 
CNcbiFstreamm_File
 File stream. More...
 
CCompressionIOStreamm_Stream
 [De]compression stream. More...
 
- Protected Attributes inherited from CLZOCompression
size_t m_BlockSize
 Block size for (de)compression. More...
 
AutoArray< char > m_WorkMem
 Working memory for compressor. More...
 
unique_ptr< SCompressionParamm_Param
 Compression parameters. 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...
 
- Protected Attributes inherited from CCompressionFile
TFile m_File
 File handler. More...
 
EMode m_Mode
 File open mode. More...
 

Private Member Functions

 CLZOCompressionFile (const CLZOCompressionFile &)
 Private copy constructor to prohibit copy. More...
 
CLZOCompressionFileoperator= (const CLZOCompressionFile &)
 Private assignment operator to prohibit assignment. More...
 

Additional Inherited Members

- Public Types inherited from CLZOCompression
enum  EFlags {
  fAllowTransparentRead = (1<<0) , fAllowEmptyData = (1<<1) , fChecksum = (1<<2) , fStreamFormat = (1<<3) ,
  fStoreFileInfo = (1<<4) | fStreamFormat
}
 Compression/decompression flags. More...
 
typedef CLZOCompression::TFlags TLZOFlags
 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 Types inherited from CCompressionFile
enum  EMode { eMode_Read , eMode_Write }
 File open mode. More...
 
typedef void * TFile
 Compression file handler. More...
 
- Static Public Member Functions inherited from CLZOCompression
static bool Initialize (void)
 Initialize LZO library. More...
 
static size_t EstimateCompressionBufferSize (size_t src_len, size_t blocksize, TLZOFlags flags)
 Estimate buffer size for data compression (advanced version). More...
 
static SRecommendedBufferSizes GetRecommendedBufferSizes (size_t round_up=0)
 Get recommended buffer sizes for stream/file I/O. More...
 
static size_t GetBlockSizeDefault (void)
 We use 24K default block size to reduce overhead with a stream processor's methods calls, because compression/decompression output streams use by default (16Kb - 1) as output buffer size. More...
 
static size_t GetBlockSizeMin (void)
 This is an artifical limit. More...
 
static size_t GetBlockSizeMax (void)
 LZO can compress/decompress data limited by its 'lzo_uint' type. More...
 
- Protected Types inherited from CCompression
enum  EDecompressMode { eMode_Unknown , eMode_Decompress , eMode_TransparentRead }
 Decompression mode (see fAllowTransparentRead flag). More...
 

Detailed Description

CLZOCompressionFile class –.

Throw exceptions on critical errors.

Definition at line 472 of file lzo.hpp.


The documentation for this class was generated from the following files:
Modified on Fri Mar 01 10:06:54 2024 by modify_doxy.py rev. 669887