sfCompressor Class Reference

sfCompressor provides compression and decompression of data using the DEFLATE algorithm (used by gzip) More...

#include <Compressor.hpp>

List of all members.


Public Member Functions

bool Compress (const char *Source, std::size_t Size, unsigned int Level=9)
 Compress the specified data.
bool Uncompress (const char *Source, std::size_t Size, std::size_t UncompressedSize)
 Uncompress the specified data.
const char * GetData () const
 Get the data after compression or decompression (size is given by GetDataSize()).
std::size_t GetDataSize () const
 Tell the size of the compressed / uncompressed data (data is given by GetData()).

Detailed Description

sfCompressor provides compression and decompression of data using the DEFLATE algorithm (used by gzip)

Definition at line 39 of file Compressor.hpp.


Member Function Documentation

bool sfCompressor::Compress ( const char *  Source,
std::size_t  Size,
unsigned int  Level = 9 
)

Compress the specified data.

Parameters:
Source : Pointer to the data to compress
Size : Size of the data to compress (in bytes)
Level : Level of compression (between 0 and 9 : 0 means no compression, 9 means best compression) (9 by default)
Returns:
True on success

Definition at line 36 of file Compressor.cpp.

bool sfCompressor::Uncompress ( const char *  Source,
std::size_t  Size,
std::size_t  UncompressedSize 
)

Uncompress the specified data.

Parameters:
Source : Pointer to the data to uncompress
Size : Size of the data to uncompress (in bytes)
UncompressedSize : Size of the uncompressed data ; you have to provide it as the algorithm cannot compute it before decompression
Returns:
True on success

Definition at line 80 of file Compressor.cpp.

const char * sfCompressor::GetData (  )  const

Get the data after compression or decompression (size is given by GetDataSize()).

This pointer is valid until the next call to Compress or Uncompress

Returns:
Const pointer to the data

Definition at line 122 of file Compressor.cpp.

std::size_t sfCompressor::GetDataSize (  )  const

Tell the size of the compressed / uncompressed data (data is given by GetData()).

Returns:
Size of data, in bytes

Definition at line 132 of file Compressor.cpp.


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