From 8ef07ec6346a4f9c078184c9497e7c12f5b8c33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 13 Sep 2015 04:21:26 +0200 Subject: GH-1227 allow structured world zip import and drag and drop out of MultiMC --- logic/MMCZip.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'logic/MMCZip.h') diff --git a/logic/MMCZip.h b/logic/MMCZip.h index a3167079..f350e668 100644 --- a/logic/MMCZip.h +++ b/logic/MMCZip.h @@ -57,5 +57,32 @@ namespace MMCZip * 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()); -} \ No newline at end of file + 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 + */ + QString MULTIMC_LOGIC_EXPORT findFileInZip(QuaZip * zip, const QString & what, const QString &root = QString()); + + /** + * Find a multiple files of the same name in archive by file name + * If a file is found in a path, no deeper paths are searched + * + * \return true if anything was found + */ + bool MULTIMC_LOGIC_EXPORT findFilesInZip(QuaZip * zip, const QString & what, QStringList & result, const QString &root = QString()); + + /** + * 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); + + /** + * Extract a subdirectory from an archive + */ + QStringList MULTIMC_LOGIC_EXPORT extractSubDir(QuaZip *zip, const QString & subdir, const QString &target); +} -- cgit v1.2.3