diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-05-25 01:24:27 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-05-25 01:24:27 +0200 |
commit | 50b8412a2690e8b2cbbbbc5c8481e45df084603d (patch) | |
tree | 8e5edad64b4e4d2d4f9a111b41a5b11f81a6fdcc /api/logic/MMCZip.h | |
parent | 2a81e21f5eb2f2b3cf67e8d0194219057604b525 (diff) | |
download | MultiMC-50b8412a2690e8b2cbbbbc5c8481e45df084603d.tar MultiMC-50b8412a2690e8b2cbbbbc5c8481e45df084603d.tar.gz MultiMC-50b8412a2690e8b2cbbbbc5c8481e45df084603d.tar.lz MultiMC-50b8412a2690e8b2cbbbbc5c8481e45df084603d.tar.xz MultiMC-50b8412a2690e8b2cbbbbc5c8481e45df084603d.zip |
NOISSUE do not try to restore file permissions when importing modpacks
Diffstat (limited to 'api/logic/MMCZip.h')
-rw-r--r-- | api/logic/MMCZip.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/api/logic/MMCZip.h b/api/logic/MMCZip.h index f350e668..7608352c 100644 --- a/api/logic/MMCZip.h +++ b/api/logic/MMCZip.h @@ -50,16 +50,6 @@ namespace MMCZip bool MULTIMC_LOGIC_EXPORT createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<Mod>& mods); /** - * Extract a whole archive. - * - * \param fileCompressed The name of the archive. - * \param dir The directory to extract to, the current directory if - * left empty. - * \return The list of the full paths of the files extracted, empty on failure. - */ - QStringList MULTIMC_LOGIC_EXPORT extractDir(QString fileCompressed, QString dir = QString()); - - /** * Find a single file in archive by file name (not path) * * \return the path prefix where the file is @@ -74,15 +64,31 @@ namespace MMCZip */ bool MULTIMC_LOGIC_EXPORT findFilesInZip(QuaZip * zip, const QString & what, QStringList & result, const QString &root = QString()); + enum Option { + NoPermissions = 1 + }; + Q_DECLARE_FLAGS(Options, Option) + /** * Extract a single file to a destination * * \return true if it succeeds */ - bool MULTIMC_LOGIC_EXPORT extractFile(QuaZip *zip, const QString &fileName, const QString &fileDest); + bool MULTIMC_LOGIC_EXPORT extractFile(QuaZip *zip, const QString &fileName, const QString &fileDest, Options opts = 0); /** * Extract a subdirectory from an archive */ - QStringList MULTIMC_LOGIC_EXPORT extractSubDir(QuaZip *zip, const QString & subdir, const QString &target); + QStringList MULTIMC_LOGIC_EXPORT extractSubDir(QuaZip *zip, const QString & subdir, const QString &target, Options opts = 0); + + /** + * Extract a whole archive. + * + * \param fileCompressed The name of the archive. + * \param dir The directory to extract to, the current directory if left empty. + * \param opts Extra options. + * \return The list of the full paths of the files extracted, empty on failure. + */ + QStringList MULTIMC_LOGIC_EXPORT extractDir(QString fileCompressed, QString dir, Options opts = 0); + } |