Skip to content

BitAbstractArchiveHandler

Oz edited this page Jan 20, 2023 · 7 revisions

Abstract class representing a generic archive handler.

#include <bit7z/bitabstractarchivehandler.hpp>

List of all members

Public Members

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 )

Member Function Documentation

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.

bool retainDirectories() const noexcept

Returns a boolean value indicating whether the directory structure must be preserved while extracting or compressing the archive.

bool isPasswordDefined() const noexcept

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.

void clearPassword() noexcept

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"").

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

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:

Clone this wiki locally