Main MRPT website > C++ reference
MRPT logo
Functions

mrpt::compress::zip Namespace Reference


Detailed Description

Compression using the "zip" algorithm and from/to gzip (gz) files.

Functions

void BASE_IMPEXP compress (void *inData, size_t inDataSize, std::vector< unsigned char > &outData)
 Compress an array of bytes into another one.
void BASE_IMPEXP compress (const std::vector< unsigned char > &inData, std::vector< unsigned char > &outData)
 Compress an array of bytes into another one.
void BASE_IMPEXP compress (void *inData, size_t inDataSize, CStream &out)
 Compress an array of bytes and write the result into a stream.
void BASE_IMPEXP compress (const std::vector< unsigned char > &inData, CStream &out)
 Compress an array of bytes and write the result into a stream.
void BASE_IMPEXP decompress (void *inData, size_t inDataSize, std::vector< unsigned char > &outData, size_t outDataEstimatedSize)
 Decompress an array of bytes into another one

Exceptions:
std::exceptionIf the apriori estimated decompressed size is not enought.

void BASE_IMPEXP decompress (void *inData, size_t inDataSize, void *outData, size_t outDataBufferSize, size_t &outDataActualSize)
 Decompress an array of bytes into another one

Exceptions:
std::exceptionIf the apriori estimated decompressed size is not enought.

void BASE_IMPEXP decompress (CStream &inStream, size_t inDataSize, void *outData, size_t outDataBufferSize, size_t &outDataActualSize)
 Decompress an array of bytes into another one

Exceptions:
std::exceptionIf the apriori estimated decompressed size is not enought.

bool BASE_IMPEXP decompress_gz_file (const std::string &file_path, vector_byte &buffer)
 Decompress a gzip file (xxxx.gz) into a memory buffer.
bool BASE_IMPEXP compress_gz_file (const std::string &file_path, const vector_byte &buffer, const int compress_level=9)
 Compress a memory buffer into a gzip file (xxxx.gz).
bool BASE_IMPEXP compress_gz_data_block (const vector_byte &in_data, vector_byte &out_gz_data, const int compress_level=9)
 Compress a memory buffer in gz-file format and return it as a block a memory.
bool BASE_IMPEXP decompress_gz_data_block (const vector_byte &in_gz_data, vector_byte &out_data)
 Decompress an array of bytes storing a gz-compressed stream of data into a memory buffer.

Function Documentation

void BASE_IMPEXP mrpt::compress::zip::compress ( void *  inData,
size_t  inDataSize,
std::vector< unsigned char > &  outData 
)

Compress an array of bytes into another one.

void BASE_IMPEXP mrpt::compress::zip::compress ( const std::vector< unsigned char > &  inData,
std::vector< unsigned char > &  outData 
)

Compress an array of bytes into another one.

void BASE_IMPEXP mrpt::compress::zip::compress ( const std::vector< unsigned char > &  inData,
CStream &  out 
)

Compress an array of bytes and write the result into a stream.

void BASE_IMPEXP mrpt::compress::zip::compress ( void *  inData,
size_t  inDataSize,
CStream &  out 
)

Compress an array of bytes and write the result into a stream.

bool BASE_IMPEXP mrpt::compress::zip::compress_gz_data_block ( const vector_byte &  in_data,
vector_byte &  out_gz_data,
const int  compress_level = 9 
)

Compress a memory buffer in gz-file format and return it as a block a memory.

compress_level: 0=no compression, 1=best speed, 9=maximum

Returns:
true on success, false on error.
Note:
If in_data is empty, an empty buffer is returned in out_gz_data and no error is reported.
See also:
compress_gz_file, de
bool BASE_IMPEXP mrpt::compress::zip::compress_gz_file ( const std::string &  file_path,
const vector_byte &  buffer,
const int  compress_level = 9 
)

Compress a memory buffer into a gzip file (xxxx.gz).

compress_level: 0=no compression, 1=best speed, 9=maximum

Returns:
true on success, false on error.
See also:
decompress_gz_file, compress_gz_data_block
void BASE_IMPEXP mrpt::compress::zip::decompress ( CStream &  inStream,
size_t  inDataSize,
void *  outData,
size_t  outDataBufferSize,
size_t &  outDataActualSize 
)

Decompress an array of bytes into another one

Exceptions:
std::exceptionIf the apriori estimated decompressed size is not enought.

void BASE_IMPEXP mrpt::compress::zip::decompress ( void *  inData,
size_t  inDataSize,
std::vector< unsigned char > &  outData,
size_t  outDataEstimatedSize 
)

Decompress an array of bytes into another one

Exceptions:
std::exceptionIf the apriori estimated decompressed size is not enought.

void BASE_IMPEXP mrpt::compress::zip::decompress ( void *  inData,
size_t  inDataSize,
void *  outData,
size_t  outDataBufferSize,
size_t &  outDataActualSize 
)

Decompress an array of bytes into another one

Exceptions:
std::exceptionIf the apriori estimated decompressed size is not enought.

bool BASE_IMPEXP mrpt::compress::zip::decompress_gz_data_block ( const vector_byte &  in_gz_data,
vector_byte &  out_data 
)

Decompress an array of bytes storing a gz-compressed stream of data into a memory buffer.

If the input data is not recognized as a .gz file, the output data will be an exact copy of the input.

Returns:
true on success, false on error.
See also:
decompress_gz_file, compress_gz_data_block
bool BASE_IMPEXP mrpt::compress::zip::decompress_gz_file ( const std::string &  file_path,
vector_byte &  buffer 
)

Decompress a gzip file (xxxx.gz) into a memory buffer.

If the file is not a .gz file, it just read the whole file unmodified.

Returns:
true on success, false on error.
See also:
compress_gz_file, decompress_gz_data_block



Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011