QuaZip quazip-1-4
|
Utility class for typical operations. More...
#include <JlCompress.h>
Classes | |
class | Options |
Static Public Member Functions | |
static bool | copyData (QIODevice &inFile, QIODevice &outFile) |
static QStringList | extractDir (QuaZip &zip, const QString &dir) |
static QStringList | getFileList (QuaZip *zip) |
static QString | extractFile (QuaZip &zip, QString fileName, QString fileDest) |
static QStringList | extractFiles (QuaZip &zip, const QStringList &files, const QString &dir) |
static bool | compressFile (QuaZip *zip, QString fileName, QString fileDest) |
Compress a single file. | |
static bool | compressFile (QuaZip *zip, QString fileName, QString fileDest, const Options &options) |
Compress a single file. | |
static bool | compressSubDir (QuaZip *parentZip, QString dir, QString parentDir, bool recursive, QDir::Filters filters) |
Compress a subdirectory. | |
static bool | compressSubDir (QuaZip *parentZip, QString dir, QString parentDir, bool recursive, QDir::Filters filters, const Options &options) |
Compress a subdirectory. | |
static bool | extractFile (QuaZip *zip, QString fileName, QString fileDest) |
Extract a single file. | |
static bool | removeFile (QStringList listFile) |
Remove some files. | |
static bool | compressFile (QString fileCompressed, QString file) |
Compress a single file. | |
static bool | compressFile (QString fileCompressed, QString file, const Options &options) |
Compress a single file with advanced options. | |
static bool | compressFiles (QString fileCompressed, QStringList files) |
Compress a list of files. | |
static bool | compressFiles (QString fileCompressed, QStringList files, const Options &options) |
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 bool | compressDir (QString fileCompressed, QString dir, bool recursive, QDir::Filters filters, const Options &options) |
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 | extractDir (QString fileCompressed, QTextCodec *fileNameCodec, 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 | extractDir (QIODevice *ioDevice, QTextCodec *fileNameCodec, 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.
|
static |
Compress a single file.
zip | Opened zip to compress the file to. |
fileName | The full path to the source file. |
fileDest | The full name of the file inside the archive. |
References compressFile().
Referenced by compressFile(), compressFile(), compressFile(), compressFiles(), and compressSubDir().
|
static |
Compress a single file.
zip | Opened zip to compress the file to. |
fileName | The full path to the source file. |
fileDest | The full name of the file inside the archive. |
options | Options for fixed file timestamp, compression level, encryption.. |
References QuaZipFile::close(), QuaZip::getMode(), QuaZipFile::getZipError(), QuaZip::mdAdd, QuaZip::mdAppend, QuaZip::mdCreate, and QuaZipFile::open().
|
static |
Compress a subdirectory.
parentZip | Opened zip containing the parent directory. |
dir | The full path to the directory to pack. |
parentDir | The full path to the directory corresponding to the root of the ZIP. |
recursive | Whether to pack sub-directories as well or only files. |
References compressSubDir().
Referenced by compressDir(), compressSubDir(), and compressSubDir().
|
static |
Compress a subdirectory.
\param parentZip Opened zip containing the parent directory. \param dir The full path to the directory to pack. \param parentDir The full path to the directory corresponding to the root of the ZIP. \param recursive Whether to pack sub-directories as well or only \param filters what to pack, filters are applied both when searching
for subdirs (if packing recursively) and when looking for files to pack
options | Options for fixed file timestamp, compression level, encryption.. files. |
References QuaZipFile::close(), compressFile(), compressSubDir(), QuaZip::getMode(), QuaZip::getZipName(), QuaZip::mdAdd, QuaZip::mdAppend, QuaZip::mdCreate, and QuaZipFile::open().
|
static |
Extract a single file.
zip | The opened zip archive to extract from. |
fileName | The full name of the file to extract. |
fileDest | The full path to the destination file. |
References QuaZipFile::close(), QuaZip::getCurrentFileInfo(), QuaZip::getMode(), QuaZipFileInfo64::getPermissions(), QuaZipFile::getZipError(), QuaZipFileInfo64::isSymbolicLink(), QuaZip::mdUnzip, QuaZipFile::open(), removeFile(), and QuaZip::setCurrentFile().
|
static |
Remove some files.
listFile | The list of files to remove. |
Referenced by extractFile().
|
static |
Compress a single file.
fileCompressed | The name of the archive. |
file | The file to compress. |
References compressFile().
|
static |
Compress a single file with advanced options.
fileCompressed | The name of the archive. |
file | The file to compress. |
options | Options for fixed file timestamp, compression level, encryption.. |
References QuaZip::close(), compressFile(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().
|
static |
Compress a list of files.
fileCompressed | The name of the archive. |
files | The file list to compress. |
References compressFiles().
Referenced by compressFiles().
|
static |
Compress a list of files.
fileCompressed | The name of the archive. |
files | The file list to compress. |
options | Options for fixed file timestamp, compression level, encryption.. |
References QuaZip::close(), compressFile(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().
|
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. |
References compressDir().
Referenced by compressDir(), and compressDir().
|
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 compressDir().
|
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 |
options | Options for fixed file timestamp, compression level, encryption.. |
References QuaZip::close(), compressSubDir(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().
|
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. |
|
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. |
|
static |
Extract a whole archive.
fileCompressed | The name of the archive. |
dir | The directory to extract to, the current directory if left empty. |
|
static |
Extract a whole archive.
fileCompressed | The name of the archive. |
fileNameCodec | The codec to use for file names. |
dir | The directory to extract to, the current directory if left empty. |
References QuaZip::setFileNameCodec().
|
static |
Get the file list.
|
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. |
|
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. |
|
static |
Extract a whole archive.
ioDevice | pointer to device with compressed data. |
dir | The directory to extract to, the current directory if left empty. |
|
static |
Extract a whole archive.
ioDevice | pointer to device with compressed data. |
fileNameCodec | The codec to use for file names. |
dir | The directory to extract to, the current directory if left empty. |
References QuaZip::setFileNameCodec().
|
static |
Get the file list.