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

Search Toolkit Book for CZipCloudflareCompressionFile

CZipCloudflareCompressionFile –. More...

#include <util/compress/zlib_cloudflare.hpp>

+ Inheritance diagram for CZipCloudflareCompressionFile:
+ Collaboration diagram for CZipCloudflareCompressionFile:

Public Member Functions

 CZipCloudflareCompressionFile (const string &file_name, EMode mode, ELevel level=eLevel_Default, size_t compression_in_bufsize=kCompressionDefaultBufSize, size_t compression_out_bufsize=kCompressionDefaultBufSize)
 Constructor. More...
 
 CZipCloudflareCompressionFile (ELevel level=eLevel_Default)
 Conventional constructor. More...
 
 ~CZipCloudflareCompressionFile (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 CZipCloudflareCompression
 CZipCloudflareCompression (ELevel level=eLevel_Default)
 Constructor. More...
 
virtual ~CZipCloudflareCompression (void)
 Destructor. More...
 
virtual CVersionInfo GetVersion (void) const
 Return name and version of the compression library. 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 DecompressFileIntoDir (const string &src_file, const string &dst_dir, size_t file_io_bufsize=kCompressionDefaultBufSize, size_t decompression_in_bufsize=kCompressionDefaultBufSize, size_t decompression_out_bufsize=kCompressionDefaultBufSize)
 Decompress file into specified directory. More...
 
virtual bool SetDictionary (CCompressionDictionary &dict, ENcbiOwnership own=eNoOwnership)
 Set a dictionary for all compression/decompression operations. More...
 
void SetStrategy (int strategy)
 Compression strategy. More...
 
int GetStrategy (void) const
 
void SetMemoryLevel (int mem_level)
 Memory level. More...
 
int GetMemoryLevel (void) const
 
void SetWindowBits (int window_bits)
 Window bits. More...
 
int GetWindowBits (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 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...
 
- 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 CZipCloudflareCompression
string FormatErrorMessage (string where, size_t pos=0) 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

EMode m_Mode
 I/O mode (read/write). More...
 
CNcbiFstreamm_File
 File stream. More...
 
CCompressionIOStreamm_Stream
 [De]comression stream. More...
 
- Protected Attributes inherited from CZipCloudflareCompression
void * m_Stream
 Compressor stream. More...
 
int m_cd_WindowBits
 The base two logarithm of the window size. More...
 
int m_c_MemLevel
 The allocation memory level for the compression. More...
 
int m_c_Strategy
 The parameter to tune up a compression 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...
 
- Protected Attributes inherited from CCompressionFile
TFile m_File
 File handler. More...
 
EMode m_Mode
 File open mode. More...
 

Private Member Functions

 CZipCloudflareCompressionFile (const CZipCloudflareCompressionFile &)
 Private copy constructor to prohibit copy. More...
 
CZipCloudflareCompressionFileoperator= (const CZipCloudflareCompressionFile &)
 Private assignment operator to prohibit assignment. More...
 

Additional Inherited Members

- Public Types inherited from CZipCloudflareCompression
enum  EFlags {
  fAllowTransparentRead = (1<<0) , fAllowEmptyData = (1<<1) , fCheckFileHeader = (1<<2) , fWriteGZipFormat = (1<<3) ,
  fAllowConcatenatedGZip = (1<<4) , fGZip = fCheckFileHeader | fWriteGZipFormat | fAllowConcatenatedGZip , fRestoreFileAttr = (1<<5)
}
 Compression/decompression flags. More...
 
typedef CZipCloudflareCompression::TFlags TZipFlags
 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 CZipCloudflareCompression
static bool Initialize (void)
 Initialize compression library (for API compatibility, zlib 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 GetStrategyDefault (void)
 
static int GetStrategyMin (void)
 
static int GetStrategyMax (void)
 
static int GetMemoryLevelDefault (void)
 
static int GetMemoryLevelMin (void)
 
static int GetMemoryLevelMax (void)
 
static int GetWindowBitsDefault (void)
 
static int GetWindowBitsMin (void)
 
static int GetWindowBitsMax (void)
 
- Protected Types inherited from CCompression
enum  EDecompressMode { eMode_Unknown , eMode_Decompress , eMode_TransparentRead }
 Decompression mode (see fAllowTransparentRead flag). More...
 

Detailed Description

CZipCloudflareCompressionFile –.

Allow read/write operations on files in zlib or gzip (.gz) formats. Throw exceptions on critical errors.

Definition at line 503 of file zlib_cloudflare.hpp.


The documentation for this class was generated from the following file:
Modified on Sun Mar 03 03:14:35 2024 by modify_doxy.py rev. 669887