QuaExtract.h
#ifndef QUAEXTRACT_H
#define QUAEXTRACT_H
/*
Copyright (C) 2025 cen1
This file is part of QuaZip.
QuaZip is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
QuaZip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
See COPYING file for the full LGPL text.
*/
#include <QtCore/QString>
#include <QtCore/QStringList>
#include "quazip_global.h"
#include "quazip_textcodec.h"
class QIODevice;
class QUAZIP_EXPORT QuaExtract {
public:
QuaExtract();
QuaExtract& withPassword(const QByteArray& password);
// ==================== Extraction Methods ====================
QString extractFile(const QString& archive, const QString& fileName, const QString& fileDest = QString()) const;
QStringList extractFiles(const QString& archive, const QStringList& files = QStringList(),
const QString& dir = QString()) const;
QStringList extractDir(const QString& archive, const QString& dir = QString()) const;
QStringList extractDir(const QString& archive, QuazipTextCodec* fileNameCodec, const QString& dir = QString()) const;
// ==================== Extraction from QIODevice ====================
QStringList extractFiles(QIODevice* ioDevice, const QStringList& files = QStringList(),
const QString& dir = QString()) const;
QStringList extractDir(QIODevice* ioDevice, const QString& dir = QString()) const;
QStringList extractDir(QIODevice* ioDevice, QuazipTextCodec* fileNameCodec, const QString& dir = QString()) const;
// ==================== Information Methods ====================
QStringList getFileList(const QString& archive) const;
QStringList getFileList(QIODevice* ioDevice) const;
private:
QByteArray m_password;
};
#endif // QUAEXTRACT_H
QuaExtract::extractFile
QString extractFile(const QString &archive, const QString &fileName, const QString &fileDest=QString()) const
Extract a single file from an archive.
Definition QuaExtract.cpp:33
QuaExtract::extractFiles
QStringList extractFiles(const QString &archive, const QStringList &files=QStringList(), const QString &dir=QString()) const
Extract multiple files from an archive.
Definition QuaExtract.cpp:38
QuaExtract::withPassword
QuaExtract & withPassword(const QByteArray &password)
Set the password for decryption.
Definition QuaExtract.cpp:27
QuaExtract::QuaExtract
QuaExtract()
Construct a QuaExtract instance.
QuaExtract::extractDir
QStringList extractDir(const QString &archive, const QString &dir=QString()) const
Extract entire archive.
Definition QuaExtract.cpp:43
QuaExtract::getFileList
QStringList getFileList(const QString &archive) const
Get list of files in an archive.
Definition QuaExtract.cpp:68
QuazipTextCodec
Definition quazip_textcodec.h:40