NCBI C++ ToolKit
Public Member Functions | Protected Member Functions
CBZip2Decompressor Class Reference

Search Toolkit Book for CBZip2Decompressor

CBZip2Decompressor -- bzip2 based decompressor. More...

#include <util/compress/bzip2.hpp>

+ Inheritance diagram for CBZip2Decompressor:
+ Collaboration diagram for CBZip2Decompressor:

List of all members.

Public Member Functions

 CBZip2Decompressor (int verbosity=0, int small_decompress=0, TBZip2Flags flags=0)
 Constructor.
virtual ~CBZip2Decompressor (void)
 Destructor.

Protected Member Functions

virtual EStatus Init (void)
 Initialize the internal stream state for compression/decompression.
virtual EStatus Process (const char *in_buf, size_t in_len, char *out_buf, size_t out_size, size_t *in_avail, size_t *out_avail)
 Compress/decompress as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full.
virtual EStatus Flush (char *out_buf, size_t out_size, size_t *out_avail)
 Flush compressed/decompressed data from the output buffer.
virtual EStatus Finish (char *out_buf, size_t out_size, size_t *out_avail)
 Finish the compression/decompression process.
virtual EStatus End (int abandon=0)
 Free all dynamically allocated data structures.

Detailed Description

CBZip2Decompressor -- bzip2 based decompressor.

Used in CBZip2StreamCompressor.

See also:
CBZip2StreamCompressor, CBZip2Compression, CCompressionProcessor

Definition at line 382 of file bzip2.hpp.


Constructor & Destructor Documentation

CBZip2Decompressor::CBZip2Decompressor ( int  verbosity = 0,
int  small_decompress = 0,
TBZip2Flags  flags = 0 
)

Constructor.

Definition at line 639 of file bzip2.cpp.

References CCompression::SetFlags().

Destructor.

Definition at line 647 of file bzip2.cpp.


Member Function Documentation

CCompressionProcessor::EStatus CBZip2Decompressor::End ( int  abandon = 0) [protected, virtual]

Free all dynamically allocated data structures.

This function discards any unprocessed input and does not flush any pending output.

Parameters:
abandonIf this parameter is not zero that skip all error checks, always return eStatus_Success. Use it if Process/Flush/Finish where not called to perform any compression/decompression after Init().

Implements CCompressionProcessor.

Definition at line 780 of file bzip2.cpp.

References BZ2_bzDecompressEnd(), BZ_OK, CCompression::eMode_TransparentRead, ERR_COMPRESS, CCompressionProcessor::eStatus_Error, CCompressionProcessor::eStatus_Success, CBZip2Compression::FormatErrorMessage(), CCompression::m_DecompressMode, CCompressionProcessor::SetBusy(), and STREAM.

CCompressionProcessor::EStatus CBZip2Decompressor::Finish ( char *  out_buf,
size_t  out_size,
size_t *  out_avail 
) [protected, virtual]

Finish the compression/decompression process.

Process pending input, flush pending output. This function slightly like to Flush(), but it must be called only at the end of compression process just before End().

Implements CCompressionProcessor.

Definition at line 762 of file bzip2.cpp.

References CCompression::eMode_TransparentRead, CCompression::eMode_Unknown, CCompressionProcessor::eStatus_EndOfData, CCompressionProcessor::eStatus_Error, CCompressionProcessor::eStatus_Success, F_ISSET, CBZip2Compression::fAllowEmptyData, and CCompression::m_DecompressMode.

CCompressionProcessor::EStatus CBZip2Decompressor::Flush ( char *  out_buf,
size_t  out_size,
size_t *  out_avail 
) [protected, virtual]

Flush compressed/decompressed data from the output buffer.

Flushing may degrade compression for some compression algorithms and so it should be used only when necessary.

Implements CCompressionProcessor.

Definition at line 747 of file bzip2.cpp.

References CCompression::eMode_Unknown, CCompressionProcessor::eStatus_Error, CCompressionProcessor::eStatus_Success, F_ISSET, CBZip2Compression::fAllowEmptyData, and CCompression::m_DecompressMode.

CCompressionProcessor::EStatus CBZip2Decompressor::Process ( const char *  in_buf,
size_t  in_len,
char *  out_buf,
size_t  out_size,
size_t *  in_avail,
size_t *  out_avail 
) [protected, virtual]

The documentation for this class was generated from the following files:
Modified on Tue Sep 16 17:45:27 2014 by modify_doxy.py rev. 426318