QuaZIP  quazip-0-7-3
JlCompress.h
1 #ifndef JLCOMPRESSFOLDER_H_
2 #define JLCOMPRESSFOLDER_H_
3 
4 /*
5 Copyright (C) 2010 Roberto Pompermaier
6 Copyright (C) 2005-2016 Sergey A. Tachenov
7 
8 This file is part of QuaZIP.
9 
10 QuaZIP is free software: you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation, either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 QuaZIP is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with QuaZIP. If not, see <http://www.gnu.org/licenses/>.
22 
23 See COPYING file for the full LGPL text.
24 
25 Original ZIP package is copyrighted by Gilles Vollant and contributors,
26 see quazip/(un)zip.h files for details. Basically it's the zlib license.
27 */
28 
29 #include "quazip.h"
30 #include "quazipfile.h"
31 #include "quazipfileinfo.h"
32 #include <QString>
33 #include <QDir>
34 #include <QFileInfo>
35 #include <QFile>
36 
38 
42 class QUAZIP_EXPORT JlCompress {
43 private:
44  static QStringList extractDir(QuaZip &zip, const QString &dir);
45  static QStringList getFileList(QuaZip *zip);
46  static QString extractFile(QuaZip &zip, QString fileName, QString fileDest);
47  static QStringList extractFiles(QuaZip &zip, const QStringList &files, const QString &dir);
49 
55  static bool compressFile(QuaZip* zip, QString fileName, QString fileDest);
57 
66  static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive,
67  QDir::Filters filters);
69 
75  static bool extractFile(QuaZip* zip, QString fileName, QString fileDest);
77 
81  static bool removeFile(QStringList listFile);
82 
83 public:
85 
90  static bool compressFile(QString fileCompressed, QString file);
92 
97  static bool compressFiles(QString fileCompressed, QStringList files);
99 
108  static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true);
125  static bool compressDir(QString fileCompressed, QString dir,
126  bool recursive, QDir::Filters filters);
127 
128 public:
130 
137  static QString extractFile(QString fileCompressed, QString fileName, QString fileDest = QString());
139 
146  static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir = QString());
148 
154  static QStringList extractDir(QString fileCompressed, QString dir = QString());
156 
161  static QStringList getFileList(QString fileCompressed);
163 
170  static QString extractFile(QIODevice *ioDevice, QString fileName, QString fileDest = QString());
172 
179  static QStringList extractFiles(QIODevice *ioDevice, QStringList files, QString dir = QString());
181 
187  static QStringList extractDir(QIODevice *ioDevice, QString dir = QString());
189 
194  static QStringList getFileList(QIODevice *ioDevice);
195 };
196 
197 #endif /* JLCOMPRESSFOLDER_H_ */
ZIP archive.
Definition: quazip.h:84
Utility class for typical operations.
Definition: JlCompress.h:42