25 #include "zipglobal.h" 35 class ZIP_EXPORT
AbZip :
public QObject
39 AbZipPrivate*
const d_ptr;
40 Q_DECLARE_PRIVATE(
AbZip)
42 friend class ZipDirIteratorPrivate;
46 AbZip(QObject *parent = 0);
49 AbZip(
const QString& zipName, QObject *parent = 0);
52 AbZip(QIODevice *ioDevice, QObject *parent = 0);
99 CaseSensitive = 0x0002,
102 DontOverwrite = 0x0008,
103 IgnoreFolders = 0x0010,
104 IgnoreFiles = 0x0020,
106 BackupExisting = 0x0040,
110 ExtractPaths = 0x0080,
112 AddRelativePaths = 0x0100,
113 AddAbsolutePaths = 0x0200,
114 AddIgnorePaths = 0x0400,
115 AddReplaceFiles = 0x1000,
118 SkipExistingFiles = 0x2000,
119 ContinueOnError = 0x4000,
121 IgnoreStoreOnlyChecks = 0x8000,
124 useBZip2Compression = 0x10000,
125 useAESEncryption = 0x20000,
127 useLzmaCompression = 0x40000,
131 SortByName = 0x80000,
132 SortByTime = 0x100000,
133 SortByCompressedSize = 0x200000,
134 SortByUncompressedSize = 0x400000,
135 SortByType = 0x800000,
136 SortReversed = 0x1000000
139 Q_DECLARE_FLAGS(ZipOptions,
Option)
155 bool open(
Mode mode = modeOpenRead, ZipOptions options = None );
184 bool addFile(const QString& file, const QString& root, ZipOptions options = AddRelativePaths,
int level = -1 );
199 bool addFile(const QString& file, ZipOptions options = AddRelativePaths,
int level = -1 );
219 bool addDirectory(const QString& srcPath, const QString& root, ZipOptions options = AddRelativePaths,
int level = -1 );
234 bool addDirectory(const QString& srcPath, ZipOptions options = AddRelativePaths,
int level = -1 );
246 bool extractAll(const QString& destPath, ZipOptions options = ExtractPaths);
255 bool extractAll(const QString& destPath, const QString& fromRoot, ZipOptions options = ExtractPaths);
266 bool extractFile(const QString& filename, const QString& destPath, ZipOptions options = ExtractPaths);
278 bool extractFiles(const QStringList& listFiles, const QString& destPath, ZipOptions options = ExtractPaths);
292 bool deleteFile(const QString& filename, ZipOptions options =
AbZip::None);
302 bool renameFile(const QString& oldFilename, const QString& newFilename,
AbZip::ZipOptions options =
AbZip::None);
311 bool checkIntegrity();
320 bool repairArchive();
333 QList<
ZipFileInfo> findFile( const QString& filename, ZipOptions options = Recursive );
347 QList<
ZipFileInfo> findFile( const QString& filename, const QString& root, ZipOptions options = Recursive );
356 void setNameFilters( const QStringList& nameFilters );
363 void clearNameFilters( );
377 void setPassword( const QString& password );
384 void clearPassword( );
395 int errorCode() const;
406 int errorCount() const;
418 const QString& errorString() const;
430 bool setComment(const QString& comment);
439 QString getComment()const;
450 void setZipFileName( const QString& name );
452 Q_DECLARE_OPERATORS_FOR_FLAGS(
AbZip::ZipOptions)
The file to be extracted already exists and you have specified the AbZip::DontOverwrite option...
Definition: AbZip.h:77
An error occurred extracting the file data from the archive. See errorString() for more information...
Definition: AbZip.h:78
General error message.
Definition: AbZip.h:70
Option
Archive options.
Definition: AbZip.h:95
Corrupt data found during extraction. CRC or AES validation failed.
Definition: AbZip.h:85
Mode
Definition: AbZip.h:57
Unable to open the archive file or the file being added.
Definition: AbZip.h:72
The decompression method required to extract the file is not supported by this library.
Definition: AbZip.h:82
The Central Directory Header file does not match the Local File Header.
Definition: AbZip.h:90
This is a simple class to hold information about the archive.
Definition: ZipFileInfo.h:15
Failed to locate Local File Header in the zip file. Most likely a corrupt Central Directory record...
Definition: AbZip.h:75
Invalid WinZip AES extra data specified.
Definition: AbZip.h:87
An error occurred copying the temporary extracted file to the destination folder. ...
Definition: AbZip.h:80
The Archive is open in Read mode and you are trying to perform a write action. Close and re-open for ...
Definition: AbZip.h:76
The file to be added or extracted was not found.
Definition: AbZip.h:88
Unable to set the last modified time for the extracted file to that stored in the archive...
Definition: AbZip.h:81
Unable to create a temporary file for extraction.
Definition: AbZip.h:73
This class holds information about a file stored within the archive file.
Definition: ZipFileInfo.h:45
An error occurred writing to a temp archive while deleting files from the current archive...
Definition: AbZip.h:84
The decryption method required to extract the file is not supported by this library.
Definition: AbZip.h:83
An error occurred writing the Central Directory to file.
Definition: AbZip.h:89
ErrorCode
Error codes. For all errors other than Ok, call errorString() to retrieve the error message...
Definition: AbZip.h:67
No Error.
Definition: AbZip.h:69
A error occurred compressing and adding the data to the archive. See errorString() for more informati...
Definition: AbZip.h:79
Invalid password specified for decryption.
Definition: AbZip.h:86
Failed to create a new folder.
Definition: AbZip.h:71
Unable to read the Central Directory form the archive file. It's either correcpt or not a valid Zip f...
Definition: AbZip.h:74