-
-
Notifications
You must be signed in to change notification settings - Fork 116
BitAbstractArchiveHandler
Abstract class representing a generic archive handler.
#include <bit7z/bitabstractarchivehandler.hpp>
Return type | Name |
---|---|
const Bit7zLibrary & | library() const noexcept |
const BitInFormat & | format() const = 0 |
tstring | password() const |
bool | retainDirectories() const noexcept |
bool | isPasswordDefined() const noexcept |
TotalCallback | totalCallback() const |
ProgressCallback | progressCallback() const |
RatioCallback | ratioCallback() const |
FileCallback | fileCallback() const |
PasswordCallback | passwordCallback() const |
OverwriteMode | overwriteMode() const |
void | setPassword( const tstring& password ) |
void | clearPassword() noexcept |
void | setRetainDirectories( bool retain ) noexcept |
void | setTotalCallback( const TotalCallback& callback ) |
void | setProgressCallback( const ProgressCallback& callback ) |
void | setRatioCallback( const RatioCallback& callback ) |
void | setFileCallback( const FileCallback& callback ) |
void | setPasswordCallback( const PasswordCallback& callback ) |
void | setOverwriteMode( OverwriteMode mode ) |
const Bit7zLibrary & library() const noexcept
Returns the Bit7zLibrary object used by the handler.
[pure virtual] const BitInFormat & format() const = 0
Returns the format used by the handler for extracting or compressing.
tstring password() const
Returns the password used to open, extract, or encrypt the archive.
Returns a boolean value indicating whether the directory structure must be preserved while extracting or compressing the archive.
Returns a boolean value indicating whether a password is defined or not.
TotalCallback totalCallback() const
Returns the current total callback.
ProgressCallback progressCallback() const
Returns the current progress callback.
RatioCallback ratioCallback() const
Returns the current ratio callback.
FileCallback fileCallback() const
Returns the current file callback.
PasswordCallback passwordCallback() const
Returns the current password callback.
OverwriteMode overwriteMode() const
Returns the current OverwriteMode.
[virtual] void setPassword( const tstring& password )
Sets up a password to be used by the archive handler. The password will be used to encrypt/decrypt archives by using the default cryptographic method of the archive format.
Note: Calling setPassword when the input archive is not encrypted does not have any effect on the extraction process.
Parameters:
-
password: the password to be used.
Clear the current password used by the handler. Calling clearPassword() will disable the encryption/decryption of archives.
Note: This is equivalent to calling setPassword(L"").
Sets whether the operations' output will preserve the input's directory structure or not.
Parameters:
-
retain: the setting for preserving or not the input directory structure
void setTotalCallback( const TotalCallback& callback )
Sets the function to be called when the total size of an operation is available.
Parameters:
-
callback: the total callback to be used.
void setProgressCallback( const ProgressCallback& callback )
Sets the function to be called when the processed size of the ongoing operation is updated.
Note: The completion percentage of the current operation can be obtained by calculating static_cast<int>( ( 100.0 * processed_size ) / total_size )
.
Parameters:
-
callback: the progress callback to be used.
void setRatioCallback( const RatioCallback& callback )
Sets the function to be called when the input processed size and current output size of the ongoing operation are known.
Note: The ratio percentage of a compression operation can be obtained by calculating static_cast<int>( ( 100.0 * output_size ) / input_size )
.
Parameters:
-
callback: the ratio callback to be used.
void setFileCallback( const FileCallback& callback )
Sets the function to be called when the current file being processed changes.
Parameters:
-
callback: the file callback to be used.
void setPasswordCallback( const PasswordCallback& callback )
Sets the function to be called when a password is needed to complete the ongoing operation.
Parameters:
-
callback: the password callback to be used.
void setOverwriteMode( OverwriteMode mode )
Sets how the handler should behave when it tries to output to an existing file or buffer.
Parameters:
-
mode: the OverwriteMode to be used by the handler.
Copyright © 2014 - 2024 Riccardo Ostani (@rikyoz)
- Bit7zLibrary
- BitArchiveEditor
- BitArchiveReader
- BitArchiveWriter
- BitException
- BitFileCompressor
- BitFileExtractor
- BitMemCompressor
- BitMemExtractor
- BitStreamCompressor
- BitStreamExtractor
- BitInFormat