QuaZIP quazip-0-7-1
JlCompress.h
1#ifndef JLCOMPRESSFOLDER_H_
2#define JLCOMPRESSFOLDER_H_
3
4/*
5Copyright (C) 2010 Roberto Pompermaier
6Copyright (C) 2005-2014 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 <QString>
33#include <QDir>
34#include <QFileInfo>
35#include <QFile>
36
38
42class QUAZIP_EXPORT JlCompress {
43private:
45
51 static bool compressFile(QuaZip* zip, QString fileName, QString fileDest);
53
62 static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive = true);
64
70 static bool extractFile(QuaZip* zip, QString fileName, QString fileDest);
72
76 static bool removeFile(QStringList listFile);
77
78public:
80
85 static bool compressFile(QString fileCompressed, QString file);
87
92 static bool compressFiles(QString fileCompressed, QStringList files);
94
101 static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true);
102
103public:
105
112 static QString extractFile(QString fileCompressed, QString fileName, QString fileDest = QString());
114
121 static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir = QString());
123
129 static QStringList extractDir(QString fileCompressed, QString dir = QString());
131
136 static QStringList getFileList(QString fileCompressed);
137};
138
139#endif /* JLCOMPRESSFOLDER_H_ */
Utility class for typical operations.
Definition JlCompress.h:42
static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir=QString())
Extract a list of files.
Definition JlCompress.cpp:412
static QStringList extractDir(QString fileCompressed, QString dir=QString())
Extract a whole archive.
Definition JlCompress.cpp:451
static bool compressDir(QString fileCompressed, QString dir=QString(), bool recursive=true)
Compress a whole directory.
Definition JlCompress.cpp:338
static bool compressFiles(QString fileCompressed, QStringList files)
Compress a list of files.
Definition JlCompress.cpp:298
static QStringList getFileList(QString fileCompressed)
Get the file list.
Definition JlCompress.cpp:492
ZIP archive.
Definition quazip.h:84