CPPMyth
Library to interoperate with MythTV server
NSROOT::Compressor Class Reference

Public Types

typedef int(* STREAM_READER) (void *handle, void *buf, int sz)
 

Public Member Functions

 Compressor (STREAM_READER reader, void *handle, int level=-1)
 
 Compressor (const char *input, size_t len, int level=-1)
 
bool HasOutputData ()
 More data can be read from output stream. More...
 
bool IsCompleted ()
 Output stream is completed. More...
 
bool HasBufferError ()
 Data cannot be read from input. More...
 
bool HasStreamError ()
 Data error occurred from stream. More...
 
size_t ReadOutput (char *buf, size_t len)
 Copy data from output stream to the given pointer until size limit. More...
 
size_t FetchOutput (const char **data)
 Fetch next chunk of data from output stream. No copy of data is performed and result can be used as is. More...
 

Private Types

enum  { MEM_BUFFER, FCB_READER }
 

Private Member Functions

size_t NextChunk ()
 

Static Private Member Functions

static int _init (void *zp, void *out, size_t len, int level)
 

Private Attributes

int m_status
 
int m_flush
 
bool m_stop
 
size_t m_chunk_size
 
enum NSROOT::Compressor:: { ... }  m_type_in
 
size_t m_input_len
 
const char * m_input
 
STREAM_READER m_rstream
 
void * m_rstream_hdl
 
char * m_rstream_buf
 
char * m_output
 
size_t m_output_pos
 
size_t m_output_len
 
void * _opaque
 

Detailed Description

Definition at line 33 of file compressor.h.

Member Function Documentation

◆ FetchOutput()

size_t Compressor::FetchOutput ( const char **  data)

Fetch next chunk of data from output stream. No copy of data is performed and result can be used as is.

Parameters
datapointer to const data pointer
Returns
the byte count available from the pointer to const data

Definition at line 172 of file compressor.cpp.

Referenced by HasOutputData(), and NSROOT::Decompressor::HasOutputData().

Here is the caller graph for this function:

◆ HasBufferError()

bool Compressor::HasBufferError ( )

Data cannot be read from input.

Returns
Input status

Definition at line 107 of file compressor.cpp.

Referenced by HasOutputData(), and NSROOT::Decompressor::HasOutputData().

Here is the caller graph for this function:

◆ HasOutputData()

bool NSROOT::Compressor::HasOutputData ( )
inline

More data can be read from output stream.

Returns
Output status

Definition at line 46 of file compressor.h.

References FetchOutput(), HasBufferError(), HasStreamError(), IsCompleted(), and ReadOutput().

◆ HasStreamError()

bool Compressor::HasStreamError ( )

Data error occurred from stream.

Returns
stream status

Definition at line 112 of file compressor.cpp.

Referenced by HasOutputData(), and NSROOT::Decompressor::HasOutputData().

Here is the caller graph for this function:

◆ IsCompleted()

bool Compressor::IsCompleted ( )

Output stream is completed.

Returns
Output stream status

Definition at line 102 of file compressor.cpp.

Referenced by HasOutputData(), and NSROOT::Decompressor::HasOutputData().

Here is the caller graph for this function:

◆ ReadOutput()

size_t Compressor::ReadOutput ( char *  buf,
size_t  len 
)

Copy data from output stream to the given pointer until size limit.

Parameters
bufpointer to copy data
lenmax length of data
Returns
lenght of copied data

Definition at line 125 of file compressor.cpp.

Referenced by HasOutputData(), and NSROOT::Decompressor::HasOutputData().

Here is the caller graph for this function:

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