Function compress

Summary

#include <include/bitmemcompressor.hpp>

(1) void compress(const vector< byte_t > &in_buffer, const wstring &out_file, const wstring &in_buffer_name=L"") const

(2) void compress(const vector< byte_t > &in_buffer, vector< byte_t > &out_buffer, const wstring &in_buffer_name=L"") const

(3) void compress(const vector< byte_t > &in_buffer, ostream &out_stream, const wstring &in_buffer_name=L"") const

Function overload

Synopsis

#include <include/bitmemcompressor.hpp>

void compress(const vector< byte_t > &in_buffer, const wstring &out_file, const wstring &in_buffer_name=L"") const

Description

Compresses the given buffer to an archive on the filesystem.

Parameters

in_buffer - the buffer to be compressed.

out_file - the output archive path.

in_buffer_name - (optional) the buffer name used to give a name to the content of the archive.

Source

Lines 36-43 in src/bitmemcompressor.cpp. Line 59 in include/bitmemcompressor.hpp.

void BitMemCompressor::compress( const vector< byte_t >& in_buffer,
                                 const wstring& out_file,
                                 const wstring& in_buffer_name ) const {
    const wstring& name = in_buffer_name.empty() ? fsutil::filename( out_file ) : in_buffer_name;

    CMyComPtr< UpdateCallback > update_callback = new BufferUpdateCallback( *this, in_buffer, name );
    BitArchiveCreator::compressToFile( out_file, update_callback );
}

Synopsis

#include <include/bitmemcompressor.hpp>

void compress(const vector< byte_t > &in_buffer, vector< byte_t > &out_buffer, const wstring &in_buffer_name=L"") const

Description

Compresses the given input buffer to the output buffer.

Note
If the format of the output doesn't support in memory compression, a BitException is thrown.
Parameters

in_buffer - the buffer to be compressed.

out_buffer - the buffer going to contain the output archive.

in_buffer_name - (optional) the buffer name used to give a name to the content of the archive.

Source

Lines 45-50 in src/bitmemcompressor.cpp. Line 72 in include/bitmemcompressor.hpp.

void BitMemCompressor::compress( const vector< byte_t >& in_buffer,
                                 vector< byte_t >& out_buffer,
                                 const wstring& in_buffer_name ) const {
    CMyComPtr< UpdateCallback > update_callback = new BufferUpdateCallback( *this, in_buffer, in_buffer_name );
    BitArchiveCreator::compressToBuffer( out_buffer, update_callback );
}

Synopsis

#include <include/bitmemcompressor.hpp>

void compress(const vector< byte_t > &in_buffer, ostream &out_stream, const wstring &in_buffer_name=L"") const

Description

Compresses the given input buffer to the output standard stream.

Note
If the format of the output doesn't support in memory compression, a BitException is thrown.
Parameters

in_buffer - the buffer to be compressed.

out_stream - the (binary) stream going to contain the output archive.

in_buffer_name - (optional) the buffer name used to give a name to the content of the archive.

Source

Lines 52-57 in src/bitmemcompressor.cpp. Line 85 in include/bitmemcompressor.hpp.

void BitMemCompressor::compress( const vector< byte_t >& in_buffer,
                                 std::ostream& out_stream,
                                 const std::wstring& in_buffer_name ) const {
    CMyComPtr< UpdateCallback > update_callback = new BufferUpdateCallback( *this, in_buffer, in_buffer_name );
    BitArchiveCreator::compressToStream( out_stream, update_callback );
}





Add Discussion as Guest

Log in