QuaExtract Class Reference

`#include <QuaExtract.h>`

## Public Member Functions

| QuaExtract ()
| Construct a QuaExtract instance.
QuaExtract & | withPassword (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:

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

## Member Function Documentation

## withPassword()

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

Set the password for decryption.

Parameters

  password | The password to use for decrypting files during extraction.

Returns
  Reference to this instance for method chaining.

References QuaExtract().

Referenced by QuaExtract().

## extractFile()

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

Extract a single file from an archive.

Parameters

  archive | The archive to extract from.
  fileName | The file to extract from the archive.
  fileDest | Where to extract the file. If empty, extracts to current directory.

Returns
  The full path to the extracted file, or empty string on failure.

Referenced by QuaExtract().

## 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

  archive | The archive to extract from.
  files | List of files to extract (empty = extract all).
  dir | Destination directory. If empty, uses current directory.

Returns
  List of extracted files, or empty list on failure.

Referenced by QuaExtract().

## extractDir() [1/4]

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

Extract entire archive.

Parameters

  archive | The archive to extract.
  dir | Destination directory. If empty, uses current directory.

Returns
  List of extracted files, or empty list on failure.

Referenced by QuaExtract().

## extractDir() [2/4]

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

Extract entire archive with custom codec.

Parameters

  archive | The archive to extract.
  fileNameCodec | The codec to use for file names.
  dir | Destination 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

  ioDevice | The QIODevice to read the archive from.
  files | List of files to extract (empty = extract all).
  dir | Destination 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

  ioDevice | The QIODevice to read the archive from.
  dir | Destination 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

  ioDevice | The QIODevice to read the archive from.
  fileNameCodec | The codec to use for file names.
  dir | Destination 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

  archive | The archive to read.

Returns
  List of file names in the archive, or empty list on failure.

Referenced by QuaExtract().

## getFileList() [2/2]

QStringList QuaExtract::getFileList | ( | QIODevice * | ioDevice | ) | const

Get list of files in an archive opened via QIODevice.

Parameters

  ioDevice | The 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:

- quazip/QuaExtract.h
- quazip/QuaExtract.cpp