-
-
Notifications
You must be signed in to change notification settings - Fork 114
BitAbstractArchiveHandler
Abstract class representing a generic archive handler.
#include <bit7z/bitabstractarchivehandler.hpp>
Return type | Name |
---|---|
void | clearPassword() noexcept |
FileCallback | fileCallback() const |
const BitInFormat &=0 | format() const |
bool | isPasswordDefined() const noexcept |
const Bit7zLibrary & | library() const noexcept |
OverwriteMode | overwriteMode() const |
tstring | password() const |
PasswordCallback | passwordCallback() const |
ProgressCallback | progressCallback() const |
RatioCallback | ratioCallback() const |
bool | retainDirectories() const noexcept |
void | setFileCallback( const FileCallback& callback ) |
void | setOverwriteMode( OverwriteMode mode ) |
void | setPassword( const tstring& password ) |
void | setPasswordCallback( const PasswordCallback& callback ) |
void | setProgressCallback( const ProgressCallback& callback ) |
void | setRatioCallback( const RatioCallback& callback ) |
void | setRetainDirectories( bool retain ) noexcept |
void | setTotalCallback( const TotalCallback& callback ) |
TotalCallback | totalCallback() const |
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"").
auto fileCallback() const -> FileCallback
Returns the current file callback.
[pure virtual] auto format() const -> const BitInFormat& = 0
Returns the format used by the handler for extracting or compressing.
Returns a boolean value indicating whether a password is defined or not.
auto library() const noexcept -> const Bit7zLibrary&
Returns the Bit7zLibrary object used by the handler.
auto overwriteMode() const -> OverwriteMode
Returns the current OverwriteMode.
auto password() const -> tstring
Returns the password used to open, extract, or encrypt the archive.
auto passwordCallback() const -> PasswordCallback
Returns the current password callback.
auto progressCallback() const -> ProgressCallback
Returns the current progress callback.
auto ratioCallback() const -> RatioCallback
Returns the current ratio callback.
Returns a boolean value indicating whether the directory structure must be preserved while extracting or compressing the archive.
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 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.
[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.
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 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.
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.
auto totalCallback() const -> TotalCallback
Returns the current total callback.
Copyright © 2014 - 2024 Riccardo Ostani (@rikyoz)
- Bit7zLibrary
- BitArchiveEditor
- BitArchiveReader
- BitArchiveWriter
- BitException
- BitFileCompressor
- BitFileExtractor
- BitMemCompressor
- BitMemExtractor
- BitStreamCompressor
- BitStreamExtractor
- BitInFormat