-
-
Notifications
You must be signed in to change notification settings - Fork 119
BitMemCompressor
The BitMemCompressor class allows to compress memory buffers to the filesystem or to other memory buffers. It let decide various properties of the produced archive file, such as the password protection and the compression level desired.
#include "bitmemcompressor.hpp"
Return type | Name |
---|---|
BitMemCompressor( Bit7zLibrary const &lib, BitInOutFormat const &format ) | |
const BitInOutFormat & | compressionFormat() |
void | setPassword( const wstring &password, bool crypt_headers=false ) |
void | setCompressionLevel( BitCompressionLevel compression_level ) |
void | setSolidMode( bool solid_mode ) |
void | compress( const vector< byte_t > &in_buffer, const wstring &out_archive, wstring in_buffer_name=L"" ) const |
void | compress( const vector< byte_t > &in_buffer, vector< byte_t > &out_buffer, wstring in_buffer_name=L"" ) const |
BitMemCompressor( Bit7zLibrary const &lib, BitInOutFormat const &format )
Constructs a BitMemCompressor object.
The Bit7zLibrary parameter is needed in order to have access to the functionalities of the 7z DLLs. On the other hand, the BitInOutFormat is required in order to know the format of the output archive.
#### const [BitInOutFormat](./BitInOutFormat)& compressionFormat() Returns The archive format used by the compressor
#### void setPassword( const wstring &password, bool crypt_headers=false ) Sets up a password for the output archive.
When setting a password, the produced archive will be encrypted using the default cryptographic method of the output format. If the format is 7z and the option "crypt_headers" is set to true, also the headers of the archive will be encrypted, resulting in a password request everytime the output file will be opened.
Note: Calling setPassword when the output format doesn't support archive encryption (e.g. GZip, BZip2, etc...) does not have any effects (in other words, it doesn't throw exceptions and it has no effects on compression operations).
#### void setCompressionLevel( [BitCompressionLevel](./bit7z) compression_level ) Sets the compression level to use when creating an archive.
#### void setSolidMode( bool solid_mode ) Sets whether to use solid compression or not.
Note: Setting the solid compression mode to true has effect only when using the 7z format.
#### void compress( const vector< [byte_t](./bit7z) > &in_buffer, const wstring &out_archive, wstring in_buffer_name=L"" ) const Compresses the given buffer to an archive on the filesystem.
#### void compress( const vector< [byte_t](./bit7z) > &in_buffer, vector< [byte_t](./bit7z) > &out_buffer, wstring in_buffer_name=L"" ) const Compresses the given input buffer to the output buffer.
Note: If the format of the output archive doesn't support in memory compression, a
Copyright © 2014 - 2024 Riccardo Ostani (@rikyoz)
- Bit7zLibrary
- BitArchiveEditor
- BitArchiveReader
- BitArchiveWriter
- BitException
- BitFileCompressor
- BitFileExtractor
- BitMemCompressor
- BitMemExtractor
- BitStreamCompressor
- BitStreamExtractor
- BitInFormat