QuaZIP quazip-0-7-2
JlCompress.h
00001 #ifndef JLCOMPRESSFOLDER_H_
00002 #define JLCOMPRESSFOLDER_H_
00003 
00004 /*
00005 Copyright (C) 2010 Roberto Pompermaier
00006 Copyright (C) 2005-2016 Sergey A. Tachenov
00007 
00008 This file is part of QuaZIP.
00009 
00010 QuaZIP is free software: you can redistribute it and/or modify
00011 it under the terms of the GNU Lesser General Public License as published by
00012 the Free Software Foundation, either version 2.1 of the License, or
00013 (at your option) any later version.
00014 
00015 QuaZIP is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU Lesser General Public License for more details.
00019 
00020 You should have received a copy of the GNU Lesser General Public License
00021 along with QuaZIP.  If not, see <http://www.gnu.org/licenses/>.
00022 
00023 See COPYING file for the full LGPL text.
00024 
00025 Original ZIP package is copyrighted by Gilles Vollant and contributors,
00026 see quazip/(un)zip.h files for details. Basically it's the zlib license.
00027 */
00028 
00029 #include "quazip.h"
00030 #include "quazipfile.h"
00031 #include "quazipfileinfo.h"
00032 #include <QString>
00033 #include <QDir>
00034 #include <QFileInfo>
00035 #include <QFile>
00036 
00038 
00042 class QUAZIP_EXPORT JlCompress {
00043 private:
00044     static QStringList extractDir(QuaZip &zip, const QString &dir);
00045     static QStringList getFileList(QuaZip *zip);
00046     static QString extractFile(QuaZip &zip, QString fileName, QString fileDest);
00047     static QStringList extractFiles(QuaZip &zip, const QStringList &files, const QString &dir);
00049 
00055     static bool compressFile(QuaZip* zip, QString fileName, QString fileDest);
00057 
00066     static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive,
00067                                QDir::Filters filters);
00069 
00075     static bool extractFile(QuaZip* zip, QString fileName, QString fileDest);
00077 
00081     static bool removeFile(QStringList listFile);
00082 
00083 public:
00085 
00090     static bool compressFile(QString fileCompressed, QString file);
00092 
00097     static bool compressFiles(QString fileCompressed, QStringList files);
00099 
00108     static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true);
00125     static bool compressDir(QString fileCompressed, QString dir,
00126                             bool recursive, QDir::Filters filters);
00127 
00128 public:
00130 
00137     static QString extractFile(QString fileCompressed, QString fileName, QString fileDest = QString());
00139 
00146     static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir = QString());
00148 
00154     static QStringList extractDir(QString fileCompressed, QString dir = QString());
00156 
00161     static QStringList getFileList(QString fileCompressed);
00163 
00170     static QString extractFile(QIODevice *ioDevice, QString fileName, QString fileDest = QString());
00172 
00179     static QStringList extractFiles(QIODevice *ioDevice, QStringList files, QString dir = QString());
00181 
00187     static QStringList extractDir(QIODevice *ioDevice, QString dir = QString());
00189 
00194     static QStringList getFileList(QIODevice *ioDevice); 
00195 };
00196 
00197 #endif /* JLCOMPRESSFOLDER_H_ */