QuaZip quazip-1-6
Public Member Functions | List of all members
QuaExtract Class Reference

#include <QuaExtract.h>

Public Member Functions

 QuaExtract ()
 Construct a QuaExtract instance.
 
QuaExtractwithPassword (const QByteArray &password)
 Set the password for decryption.
 
QString extractFile (const QString &archive, const QString &fileName, const QString &fileDest=QString()) const
 Extract a single file from an archive.
 
QStringList extractFiles (const QString &archive, const QStringList &files=QStringList(), const QString &dir=QString()) const
 Extract multiple files from an archive.
 
QStringList extractDir (const QString &archive, const QString &dir=QString()) const
 Extract entire archive.
 
QStringList extractDir (const QString &archive, QuazipTextCodec *fileNameCodec, const QString &dir=QString()) const
 Extract entire archive with custom codec.
 
QStringList extractFiles (QIODevice *ioDevice, const QStringList &files=QStringList(), const QString &dir=QString()) const
 Extract multiple files from an archive opened via QIODevice.
 
QStringList extractDir (QIODevice *ioDevice, const QString &dir=QString()) const
 Extract entire archive from QIODevice.
 
QStringList extractDir (QIODevice *ioDevice, QuazipTextCodec *fileNameCodec, const QString &dir=QString()) const
 Extract entire archive from QIODevice with custom codec.
 
QStringList getFileList (const QString &archive) const
 Get list of files in an archive.
 
QStringList getFileList (QIODevice *ioDevice) const
 Get list of files in an archive opened via QIODevice.
 

Detailed Description

QuaExtract provides a fluent API for ZIP extraction operations.

Example usage:

.withPassword("secret")
.extractDir("archive.zip", "output/");
QuaExtract()
Construct a QuaExtract instance.
Definition QuaExtract.cpp:25

Member Function Documentation

◆ withPassword()

QuaExtract & QuaExtract::withPassword ( const QByteArray &  password)

Set the password for decryption.

Parameters
passwordThe password to use for decrypting files during extraction.
Returns
Reference to this instance for method chaining.

◆ extractFile()

QString QuaExtract::extractFile ( const QString &  archive,
const QString &  fileName,
const QString &  fileDest = QString() 
) const

Extract a single file from an archive.

Parameters
archiveThe archive to extract from.
fileNameThe file to extract from the archive.
fileDestWhere to extract the file. If empty, extracts to current directory.
Returns
The full path to the extracted file, or empty string on failure.

◆ extractFiles() [1/2]

QStringList QuaExtract::extractFiles ( const QString &  archive,
const QStringList &  files = QStringList(),
const QString &  dir = QString() 
) const

Extract multiple files from an archive.

Parameters
archiveThe archive to extract from.
filesList of files to extract (empty = extract all).
dirDestination directory. If empty, uses current directory.
Returns
List of extracted files, or empty list on failure.

◆ extractDir() [1/4]

QStringList QuaExtract::extractDir ( const QString &  archive,
const QString &  dir = QString() 
) const

Extract entire archive.

Parameters
archiveThe archive to extract.
dirDestination directory. If empty, uses current directory.
Returns
List of extracted files, or empty list on failure.

◆ extractDir() [2/4]

QStringList QuaExtract::extractDir ( const QString &  archive,
QuazipTextCodec fileNameCodec,
const QString &  dir = QString() 
) const

Extract entire archive with custom codec.

Parameters
archiveThe archive to extract.
fileNameCodecThe codec to use for file names.
dirDestination directory. If empty, uses current directory.
Returns
List of extracted files, or empty list on failure.

◆ extractFiles() [2/2]

QStringList QuaExtract::extractFiles ( QIODevice *  ioDevice,
const QStringList &  files = QStringList(),
const QString &  dir = QString() 
) const

Extract multiple files from an archive opened via QIODevice.

Parameters
ioDeviceThe QIODevice to read the archive from.
filesList of files to extract (empty = extract all).
dirDestination directory. If empty, uses current directory.
Returns
List of extracted files, or empty list on failure.

◆ extractDir() [3/4]

QStringList QuaExtract::extractDir ( QIODevice *  ioDevice,
const QString &  dir = QString() 
) const

Extract entire archive from QIODevice.

Parameters
ioDeviceThe QIODevice to read the archive from.
dirDestination directory. If empty, uses current directory.
Returns
List of extracted files, or empty list on failure.

◆ extractDir() [4/4]

QStringList QuaExtract::extractDir ( QIODevice *  ioDevice,
QuazipTextCodec fileNameCodec,
const QString &  dir = QString() 
) const

Extract entire archive from QIODevice with custom codec.

Parameters
ioDeviceThe QIODevice to read the archive from.
fileNameCodecThe codec to use for file names.
dirDestination directory. If empty, uses current directory.
Returns
List of extracted files, or empty list on failure.

◆ getFileList() [1/2]

QStringList QuaExtract::getFileList ( const QString &  archive) const

Get list of files in an archive.

Parameters
archiveThe archive to read.
Returns
List of file names in the archive, or empty list on failure.

◆ getFileList() [2/2]

QStringList QuaExtract::getFileList ( QIODevice *  ioDevice) const

Get list of files in an archive opened via QIODevice.

Parameters
ioDeviceThe QIODevice to read the archive from.
Returns
List of file names in the archive, or empty list on failure.

The documentation for this class was generated from the following files: