xapian-core  1.4.27
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CompressionStream Class Reference

#include <compression_stream.h>

Public Member Functions

 CompressionStream (int compress_strategy_=Z_DEFAULT_STRATEGY)
 
 ~CompressionStream ()
 
const char * compress (const char *buf, size_t *p_size)
 
void decompress_start ()
 
bool decompress_chunk (const char *p, int len, std::string &buf)
 Returns true if this was the final chunk. More...
 

Private Member Functions

void lazy_alloc_deflate_zstream ()
 Allocate the zstream for deflating, if not already allocated. More...
 
void lazy_alloc_inflate_zstream ()
 Allocate the zstream for inflating, if not already allocated. More...
 

Private Attributes

int compress_strategy
 
size_t out_len
 
char * out
 
z_stream * deflate_zstream
 Zlib state object for deflating. More...
 
z_stream * inflate_zstream
 Zlib state object for inflating. More...
 

Detailed Description

Definition at line 29 of file compression_stream.h.

Constructor & Destructor Documentation

◆ CompressionStream()

CompressionStream::CompressionStream ( int  compress_strategy_ = Z_DEFAULT_STRATEGY)
inlineexplicit

Definition at line 54 of file compression_stream.h.

References compress(), and ~CompressionStream().

◆ ~CompressionStream()

CompressionStream::~CompressionStream ( )

Definition at line 34 of file compression_stream.cc.

Referenced by CompressionStream().

Member Function Documentation

◆ compress()

const char * CompressionStream::compress ( const char *  buf,
size_t *  p_size 
)

Definition at line 53 of file compression_stream.cc.

Referenced by CompressionStream().

◆ decompress_chunk()

bool CompressionStream::decompress_chunk ( const char *  p,
int  len,
std::string &  buf 
)

Returns true if this was the final chunk.

Definition at line 87 of file compression_stream.cc.

Referenced by Glass::LeafItem_base< uint8_t *>::decompress_chunk(), and decompress_start().

◆ decompress_start()

void CompressionStream::decompress_start ( )
inline

Definition at line 66 of file compression_stream.h.

References decompress_chunk(), and lazy_alloc_inflate_zstream().

◆ lazy_alloc_deflate_zstream()

void CompressionStream::lazy_alloc_deflate_zstream ( )
private

Allocate the zstream for deflating, if not already allocated.

Definition at line 118 of file compression_stream.cc.

References rare, Xapian::Internal::str(), and usual.

◆ lazy_alloc_inflate_zstream()

void CompressionStream::lazy_alloc_inflate_zstream ( )
private

Allocate the zstream for inflating, if not already allocated.

Definition at line 155 of file compression_stream.cc.

References rare, Xapian::Internal::str(), and usual.

Referenced by decompress_start().

Member Data Documentation

◆ compress_strategy

int CompressionStream::compress_strategy
private

Definition at line 30 of file compression_stream.h.

◆ deflate_zstream

z_stream* CompressionStream::deflate_zstream
private

Zlib state object for deflating.

Definition at line 37 of file compression_stream.h.

◆ inflate_zstream

z_stream* CompressionStream::inflate_zstream
private

Zlib state object for inflating.

Definition at line 40 of file compression_stream.h.

◆ out

char* CompressionStream::out
private

Definition at line 34 of file compression_stream.h.

◆ out_len

size_t CompressionStream::out_len
private

Definition at line 32 of file compression_stream.h.


The documentation for this class was generated from the following files: