XPCompression Class Reference

#include <XPCompression.h>

List of all members.

Public Member Functions

 XPCompression ()
virtual ~XPCompression ()
int CalculateMaximumMemory (int size)
bool Compress (void *source_data, int source_length, void *destination_data, int *destination_length, int level=10)
bool Decompress (void *source_data, int source_length, void *destination_data, int *destination_length)


Detailed Description

A general purpose lossless compression and decompression class

Constructor & Destructor Documentation

XPCompression (  ) 

The ctor performs some basic initialisation

virtual ~XPCompression (  )  [virtual]

The dtor makes sure everything is tidy


Member Function Documentation

int CalculateMaximumMemory ( int  size  ) 

Given an input size calculate the maximum absolute worse case for the compressed output

Parameters:
size the size of the data
Returns:
the worse case output length

bool Compress ( void *  source_data,
int  source_length,
void *  destination_data,
int *  destination_length,
int  level = 10 
)

Compress a block of memory

Parameters:
source_data the source data
source_length the source data length in bytes
destination_data the destination data
destination_length the pointer to the destination data length in bytes to fill in
level the compression level to use. 1 is fast and 10 is best but slower. The default for this parameter is 10
Returns:
true is no error else false for an error

bool Decompress ( void *  source_data,
int  source_length,
void *  destination_data,
int *  destination_length 
)

Decompress a block of memory

Parameters:
source_data the source data
source_length the source data length in bytes
destination_data the destination data
destination_length the pointer to the destination data length in bytes to fill in
Returns:
true is no error else false for an error


Generated on Sat Jun 28 22:02:28 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3