ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
JlCompress.h
Go to the documentation of this file.
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 <QDir>
30 #include <QFile>
31 #include <QFileInfo>
32 #include <QString>
33 
34 #include "quazip.h"
35 #include "quazipfile.h"
36 #include "quazipfileinfo.h"
37 
39 
44 private:
45  static QStringList extractDir(QuaZip &zip, const QString &dir);
46  static QStringList getFileList(QuaZip *zip);
47  static QString extractFile(QuaZip &zip, QString fileName, QString fileDest);
48  static QStringList extractFiles(QuaZip &zip,
49  const QStringList &files,
50  const QString &dir);
52 
58  static bool compressFile(QuaZip *zip, QString fileName, QString fileDest);
60 
69  static bool compressSubDir(QuaZip *parentZip,
70  QString dir,
71  QString parentDir,
72  bool recursive,
73  QDir::Filters filters);
75 
81  static bool extractFile(QuaZip *zip, QString fileName, QString fileDest);
83 
87  static bool removeFile(QStringList listFile);
88 
89 public:
91 
96  static bool compressFile(QString fileCompressed, QString file);
98 
103  static bool compressFiles(QString fileCompressed, QStringList files);
105 
115  static bool compressDir(QString fileCompressed,
116  QString dir = QString(),
117  bool recursive = true);
134  static bool compressDir(QString fileCompressed,
135  QString dir,
136  bool recursive,
137  QDir::Filters filters);
138 
139 public:
141 
149  static QString extractFile(QString fileCompressed,
150  QString fileName,
151  QString fileDest = QString());
153 
161  static QStringList extractFiles(QString fileCompressed,
162  QStringList files,
163  QString dir = QString());
165 
172  static QStringList extractDir(QString fileCompressed,
173  QString dir = QString());
175 
180  static QStringList getFileList(QString fileCompressed);
182 
190  static QString extractFile(QIODevice *ioDevice,
191  QString fileName,
192  QString fileDest = QString());
194 
202  static QStringList extractFiles(QIODevice *ioDevice,
203  QStringList files,
204  QString dir = QString());
206 
213  static QStringList extractDir(QIODevice *ioDevice, QString dir = QString());
215 
220  static QStringList getFileList(QIODevice *ioDevice);
221 };
222 
223 #endif /* JLCOMPRESSFOLDER_H_ */
Utility class for typical operations.
Definition: JlCompress.h:43
ZIP archive.
Definition: quazip.h:128
#define QUAZIP_EXPORT
Definition: quazip_global.h:46