Abstract class representing a generic archive handler.
More...
#include <bit7z/bitabstractarchivehandler.hpp>
Abstract class representing a generic archive handler.
◆ clearPassword()
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"").
◆ fileCallback()
- Returns
- the current file callback.
◆ format()
◆ isPasswordDefined()
auto isPasswordDefined |
( |
| ) |
const -> bool |
|
noexcept |
- Returns
- a boolean value indicating whether a password is defined or not.
◆ library()
◆ overwriteMode()
- Returns
- the current OverwriteMode.
◆ password()
- Returns
- the password used to open, extract, or encrypt the archive.
◆ passwordCallback()
- Returns
- the current password callback.
◆ progressCallback()
- Returns
- the current progress callback.
◆ ratioCallback()
- Returns
- the current ratio callback.
◆ retainDirectories()
auto retainDirectories |
( |
| ) |
const -> bool |
|
noexcept |
- Returns
- a boolean value indicating whether the directory structure must be preserved while extracting or compressing the archive.
◆ setFileCallback()
Sets the function to be called when the current file being processed changes.
- Parameters
-
callback | the file callback to be used. |
◆ setOverwriteMode()
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. |
◆ setPassword()
virtual void setPassword |
( |
const tstring & |
password | ) |
|
|
virtual |
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.
-
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).
-
After a password has been set, it will be used for every subsequent operation. To disable the use of the password, you need to call the clearPassword method, which is equivalent to calling setPassword(L"").
- Parameters
-
password | the password to be used. |
Reimplemented in BitAbstractArchiveCreator.
◆ setPasswordCallback()
Sets the function to be called when a password is needed to complete the ongoing operation.
- Parameters
-
callback | the password callback to be used. |
◆ setProgressCallback()
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. |
◆ setRatioCallback()
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. |
◆ setRetainDirectories()
void setRetainDirectories |
( |
bool |
retain | ) |
|
|
noexcept |
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 |
◆ setTotalCallback()
Sets the function to be called when the total size of an operation is available.
- Parameters
-
callback | the total callback to be used. |
◆ totalCallback()
- Returns
- the current total callback.
The documentation for this class was generated from the following file: