MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLCompression Class Reference

Detailed Description

General purpose compression and decompression utility.

The methods use zlib to perform compression and decompression.

Static Public Member Functions

static TSLCompressionResult compress (const unsigned char *uncompressedData, const TSLFileLength uncompressedDataLength, unsigned char **compressedData, TSLFileLength *compressedDataLength)
 
static TSLCompressionResult compressFile (const char *filename)
 
static TSLCompressionResult decompress (const unsigned char *compressedData, const TSLFileLength compressedDataLength, unsigned char **uncompressedData, TSLFileLength *uncompressedDataLength)
 
static TSLCompressionResult decompressFile (const char *filename)
 
static void freeBufferData (unsigned char *data)
 

Member Function Documentation

◆ compress()

static TSLCompressionResult TSLCompression::compress ( const unsigned char * uncompressedData,
const TSLFileLength uncompressedDataLength,
unsigned char ** compressedData,
TSLFileLength * compressedDataLength )
static

Compress data.

The data created includes the tag and the uncompressed length ready to save to file.

New data is allocated which must be deleted by the caller.

Parameters:

uncompressedData: Uncompressed data in memory provided to the routine.

uncompressedDataLength: Length of data in the uncompressedData buffer.

compressedData: Pass a pointer to the routine, which on return will point to compressed data allocated by the routine. The user must delete the data when no longer required, by calling freeBufferData.

compressedDataLength: Pass the address of a variable to the routine, which on return will contain the length of the compressed data in the compressedData buffer.

◆ compressFile()

static TSLCompressionResult TSLCompression::compressFile ( const char * filename)
static

Compress a file on the local hard drive or network drive (not remotely).

Parameters:

filename: fully qualified filename to compress.

◆ decompress()

static TSLCompressionResult TSLCompression::decompress ( const unsigned char * compressedData,
const TSLFileLength compressedDataLength,
unsigned char ** uncompressedData,
TSLFileLength * uncompressedDataLength )
static

Decompress data.

The data must include the tag and the uncompressed length as saved to file.

New data is allocated which must be deleted by the caller.

Parameters:

compressedData: Compressed data in memory provided to the routine.

compressedDataLength: Length of data in the compressedData buffer.

uncompressedData: Pass a pointer to the routine, which on return will point to decompressed data allocated by the routine. The user must delete the data when no longer required, by calling freeBufferData.

uncompressedDataLength: Pass the address of a variable to the routine, which on return will contain the length of the uncompressed data in the uncompressedData buffer.

◆ decompressFile()

static TSLCompressionResult TSLCompression::decompressFile ( const char * filename)
static

Decompress a file on the local hard drive or network drive (not remotely).

Parameters:

filename: fully qualified filename to decompress.

◆ freeBufferData()

static void TSLCompression::freeBufferData ( unsigned char * data)
static

Call this routine to free the data allocated by the compress or decompress routines.