QuaZip quazip-1-4
JlCompress.h
1#ifndef JLCOMPRESSFOLDER_H_
2#define JLCOMPRESSFOLDER_H_
3
4/*
5Copyright (C) 2010 Roberto Pompermaier
6Copyright (C) 2005-2016 Sergey A. Tachenov
7
8This file is part of QuaZip.
9
10QuaZip is free software: you can redistribute it and/or modify
11it under the terms of the GNU Lesser General Public License as published by
12the Free Software Foundation, either version 2.1 of the License, or
13(at your option) any later version.
14
15QuaZip is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public License
21along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
22
23See COPYING file for the full LGPL text.
24
25Original ZIP package is copyrighted by Gilles Vollant and contributors,
26see 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 "quazip_qt_compat.h"
33#include <QtCore/QString>
34#include <QtCore/QDir>
35#include <QtCore/QFileInfo>
36#include <QtCore/QFile>
37
39
43class QUAZIP_EXPORT JlCompress {
44public:
45 static bool copyData(QIODevice &inFile, QIODevice &outFile);
46 static QStringList extractDir(QuaZip &zip, const QString &dir);
47 static QStringList getFileList(QuaZip *zip);
48 static QString extractFile(QuaZip &zip, QString fileName, QString fileDest);
49 static QStringList extractFiles(QuaZip &zip, const QStringList &files, const QString &dir);
51
57 static bool compressFile(QuaZip* zip, QString fileName, QString fileDest);
59
68 static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive,
69 QDir::Filters filters);
71
77 static bool extractFile(QuaZip* zip, QString fileName, QString fileDest);
79
83 static bool removeFile(QStringList listFile);
84
86
91 static bool compressFile(QString fileCompressed, QString file);
93
98 static bool compressFiles(QString fileCompressed, QStringList files);
100
109 static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true);
126 static bool compressDir(QString fileCompressed, QString dir,
127 bool recursive, QDir::Filters filters);
128
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
163 static QStringList extractDir(QString fileCompressed, QTextCodec* fileNameCodec, QString dir = QString());
165
170 static QStringList getFileList(QString fileCompressed);
172
179 static QString extractFile(QIODevice *ioDevice, QString fileName, QString fileDest = QString());
181
188 static QStringList extractFiles(QIODevice *ioDevice, QStringList files, QString dir = QString());
190
196 static QStringList extractDir(QIODevice *ioDevice, QString dir = QString());
198
205 static QStringList extractDir(QIODevice* ioDevice, QTextCodec* fileNameCodec, QString dir = QString());
207
212 static QStringList getFileList(QIODevice *ioDevice);
213};
214
215#endif /* JLCOMPRESSFOLDER_H_ */
Utility class for typical operations.
Definition: JlCompress.h:43
ZIP archive.
Definition: quazip.h:84
typedef Filters