|
QuaZip quazip-1-6
|
#include <QuaCompress.h>
Public Types | |
| typedef JlCompress::Options::CompressionStrategy | CompressionStrategy |
| Compression strategy - shared with JlCompress::Options::CompressionStrategy. | |
Public Member Functions | |
| QuaCompress () | |
| Construct a QuaCompress instance. | |
| QuaCompress & | withUtf8Enabled (bool enabled=true) |
| Enable or disable UTF-8 encoding for file names and comments. | |
| QuaCompress & | withStrategy (CompressionStrategy strategy) |
| Set the compression strategy/level. | |
| QuaCompress & | withDateTime (const QDateTime &dateTime) |
| Set the date/time to use for compressed files. | |
| QuaCompress & | withPassword (const QByteArray &password) |
| Set the password for encryption. | |
| bool | compressFile (const QString &newArchive, const QString &file) const |
| Compress a single file. | |
| bool | compressFiles (const QString &newArchive, const QStringList &files) const |
| Compress multiple files. | |
| bool | compressDir (const QString &newArchive, const QString &dir=QString(), bool recursive=true, QDir::Filters filters=QDir::AllEntries|QDir::NoDotAndDotDot) const |
| Compress a directory. | |
| bool | addFile (const QString &existingArchive, const QString &file) const |
| Add a single file to an existing archive. | |
| bool | addFiles (const QString &existingArchive, const QStringList &files) const |
| Add multiple files to an existing archive. | |
| bool | addDir (const QString &existingArchive, const QString &dir=QString(), bool recursive=true, QDir::Filters filters=QDir::AllEntries|QDir::NoDotAndDotDot) const |
| Add a directory to an existing archive. | |
Static Public Attributes | |
| static constexpr CompressionStrategy | Storage = JlCompress::Options::Storage |
| static constexpr CompressionStrategy | Fastest = JlCompress::Options::Fastest |
| static constexpr CompressionStrategy | Faster = JlCompress::Options::Faster |
| static constexpr CompressionStrategy | Standard = JlCompress::Options::Standard |
| static constexpr CompressionStrategy | Better = JlCompress::Options::Better |
| static constexpr CompressionStrategy | Best = JlCompress::Options::Best |
| static constexpr CompressionStrategy | Default = JlCompress::Options::Default |
QuaCompress provides a fluent API for ZIP compression operations.
Example usage:
| QuaCompress & QuaCompress::withUtf8Enabled | ( | bool | enabled = true | ) |
Enable or disable UTF-8 encoding for file names and comments.
| enabled | If true, use UTF-8 encoding. If false, use the configured codec (or system default). |
References QuaCompress().
| QuaCompress & QuaCompress::withStrategy | ( | CompressionStrategy | strategy | ) |
Set the compression strategy/level.
| strategy | The compression level to use. |
References QuaCompress().
| QuaCompress & QuaCompress::withDateTime | ( | const QDateTime & | dateTime | ) |
Set the date/time to use for compressed files.
| dateTime | The date/time to set. Default is to use current time. |
References QuaCompress().
| QuaCompress & QuaCompress::withPassword | ( | const QByteArray & | password | ) |
Set the password for encryption.
| password | The password to use for encrypting files during compression. |
References QuaCompress().
| bool QuaCompress::compressFile | ( | const QString & | newArchive, |
| const QString & | file ) const |
Compress a single file.
| newArchive | The name of the archive to create. |
| file | The file to compress. |
References JlCompress::compressFile().
| bool QuaCompress::compressFiles | ( | const QString & | newArchive, |
| const QStringList & | files ) const |
Compress multiple files.
| newArchive | The name of the archive to create. |
| files | List of files to compress. |
References JlCompress::compressFiles().
| bool QuaCompress::compressDir | ( | const QString & | newArchive, |
| const QString & | dir = QString(), | ||
| bool | recursive = true, | ||
| QDir::Filters | filters = QDir::AllEntries | QDir::NoDotAndDotDot ) const |
Compress a directory.
| newArchive | The name of the archive to create. |
| dir | The directory to compress. If empty, uses current directory. |
| recursive | If true, include subdirectories recursively. |
| filters | QDir filters to apply when selecting files. |
References JlCompress::compressDir().
| bool QuaCompress::addFile | ( | const QString & | existingArchive, |
| const QString & | file ) const |
Add a single file to an existing archive.
| existingArchive | The existing archive to add to. |
| file | The file to add. |
References JlCompress::addFile().
| bool QuaCompress::addFiles | ( | const QString & | existingArchive, |
| const QStringList & | files ) const |
Add multiple files to an existing archive.
| existingArchive | The existing archive to add to. |
| files | List of files to add. |
References JlCompress::addFiles().
| bool QuaCompress::addDir | ( | const QString & | existingArchive, |
| const QString & | dir = QString(), | ||
| bool | recursive = true, | ||
| QDir::Filters | filters = QDir::AllEntries | QDir::NoDotAndDotDot ) const |
Add a directory to an existing archive.
| existingArchive | The existing archive to add to. |
| dir | The directory to add. If empty, uses current directory. |
| recursive | If true, include subdirectories recursively. |
| filters | QDir filters to apply when selecting files. |
References JlCompress::addDir().