QuaZIP quazip-0-7-3
|
Utility class for typical operations. More...
#include <JlCompress.h>
Static Public Member Functions | |
static bool | compressFile (QString fileCompressed, QString file) |
Compress a single file. | |
static bool | compressFiles (QString fileCompressed, QStringList files) |
Compress a list of files. | |
static bool | compressDir (QString fileCompressed, QString dir=QString(), bool recursive=true) |
Compress a whole directory. | |
static bool | compressDir (QString fileCompressed, QString dir, bool recursive, QDir::Filters filters) |
Compress a whole directory. | |
static QString | extractFile (QString fileCompressed, QString fileName, QString fileDest=QString()) |
Extract a single file. | |
static QStringList | extractFiles (QString fileCompressed, QStringList files, QString dir=QString()) |
Extract a list of files. | |
static QStringList | extractDir (QString fileCompressed, QString dir=QString()) |
Extract a whole archive. | |
static QStringList | getFileList (QString fileCompressed) |
Get the file list. | |
static QString | extractFile (QIODevice *ioDevice, QString fileName, QString fileDest=QString()) |
Extract a single file. | |
static QStringList | extractFiles (QIODevice *ioDevice, QStringList files, QString dir=QString()) |
Extract a list of files. | |
static QStringList | extractDir (QIODevice *ioDevice, QString dir=QString()) |
Extract a whole archive. | |
static QStringList | getFileList (QIODevice *ioDevice) |
Get the file list. |
Utility class for typical operations.
This class contains a number of useful static functions to perform simple operations, such as mass ZIP packing or extraction.
bool JlCompress::compressFile | ( | QString | fileCompressed, |
QString | file | ||
) | [static] |
Compress a single file.
fileCompressed | The name of the archive. |
file | The file to compress. |
References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().
bool JlCompress::compressFiles | ( | QString | fileCompressed, |
QStringList | files | ||
) | [static] |
Compress a list of files.
fileCompressed | The name of the archive. |
files | The file list to compress. |
References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().
bool JlCompress::compressDir | ( | QString | fileCompressed, |
QString | dir = QString() , |
||
bool | recursive = true |
||
) | [static] |
Compress a whole directory.
Does not compress hidden files. See compressDir(QString, QString, bool, QDir::Filters).
fileCompressed | The name of the archive. |
dir | The directory to compress. |
recursive | Whether to pack the subdirectories as well, or just regular files. |
bool JlCompress::compressDir | ( | QString | fileCompressed, |
QString | dir, | ||
bool | recursive, | ||
QDir::Filters | filters | ||
) | [static] |
Compress a whole directory.
Unless filters are specified explicitly, packs only regular non-hidden files (and subdirs, if recursive
is true). If filters are specified, they are OR-combined with QDir::AllDirs|QDir::NoDotAndDotDot
when searching for dirs and with QDir::Files
when searching for files.
fileCompressed | path to the resulting archive |
dir | path to the directory being compressed |
recursive | if true, then the subdirectories are packed as well |
filters | what to pack, filters are applied both when searching for subdirs (if packing recursively) and when looking for files to pack |
References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().
QString JlCompress::extractFile | ( | QString | fileCompressed, |
QString | fileName, | ||
QString | fileDest = QString() |
||
) | [static] |
Extract a single file.
fileCompressed | The name of the archive. |
fileName | The file to extract. |
fileDest | The destination file, assumed to be identical to file if left empty. |
QStringList JlCompress::extractFiles | ( | QString | fileCompressed, |
QStringList | files, | ||
QString | dir = QString() |
||
) | [static] |
Extract a list of files.
fileCompressed | The name of the archive. |
files | The file list to extract. |
dir | The directory to put the files to, the current directory if left empty. |
QStringList JlCompress::extractDir | ( | QString | fileCompressed, |
QString | dir = QString() |
||
) | [static] |
Extract a whole archive.
fileCompressed | The name of the archive. |
dir | The directory to extract to, the current directory if left empty. |
QStringList JlCompress::getFileList | ( | QString | fileCompressed | ) | [static] |
Get the file list.
QString JlCompress::extractFile | ( | QIODevice * | ioDevice, |
QString | fileName, | ||
QString | fileDest = QString() |
||
) | [static] |
Extract a single file.
ioDevice | pointer to device with compressed data. |
fileName | The file to extract. |
fileDest | The destination file, assumed to be identical to file if left empty. |
QStringList JlCompress::extractFiles | ( | QIODevice * | ioDevice, |
QStringList | files, | ||
QString | dir = QString() |
||
) | [static] |
Extract a list of files.
ioDevice | pointer to device with compressed data. |
files | The file list to extract. |
dir | The directory to put the files to, the current directory if left empty. |
QStringList JlCompress::extractDir | ( | QIODevice * | ioDevice, |
QString | dir = QString() |
||
) | [static] |
Extract a whole archive.
ioDevice | pointer to device with compressed data. |
dir | The directory to extract to, the current directory if left empty. |
QStringList JlCompress::getFileList | ( | QIODevice * | ioDevice | ) | [static] |
Get the file list.