31 #include "zipglobal.h"
33 #include <QtCore/QMap>
34 #include <QtCore/QtGlobal>
45 OSDAB_BEGIN_NAMESPACE(
Zip)
70 Deflate1 = 1, Deflate2, Deflate3, Deflate4,
71 Deflate5, Deflate6, Deflate7, Deflate8, Deflate9,
72 AutoCPU, AutoMIME, AutoFull
79 RelativePaths = 0x0001,
81 AbsolutePaths = 0x0002,
92 SkipBadFiles = 0x0020,
98 CheckForDuplicates = 0x0040
100 Q_DECLARE_FLAGS(CompressionOptions, CompressionOption)
107 void setPassword(const QString& pwd);
108 void clearPassword();
109 QString password() const;
111 ErrorCode createArchive(const QString& file,
bool overwrite = true);
112 ErrorCode createArchive(QIODevice* device);
114 QString archiveComment() const;
115 void setArchiveComment(const QString& comment);
117 ErrorCode addDirectoryContents(const QString& path,
118 CompressionLevel level = AutoFull);
119 ErrorCode addDirectoryContents(const QString& path, const QString& root,
120 CompressionLevel level = AutoFull);
122 ErrorCode addDirectory(const QString& path,
123 CompressionLevel level = AutoFull);
124 ErrorCode addDirectory(const QString& path, const QString& root,
125 CompressionLevel level = AutoFull);
126 ErrorCode addDirectory(const QString& path, const QString& root,
127 CompressionOptions options, CompressionLevel level = AutoFull,
128 int* addedFiles = 0);
130 ErrorCode addFile(const QString& path,
131 CompressionLevel level = AutoFull);
132 ErrorCode addFile(const QString& path, const QString& root,
133 CompressionLevel level = AutoFull);
134 ErrorCode addFile(const QString& path, const QString& root,
135 CompressionOptions options,
136 CompressionLevel level = AutoFull);
138 ErrorCode addFiles(const QStringList& paths,
139 CompressionLevel level = AutoFull);
140 ErrorCode addFiles(const QStringList& paths, const QString& root,
141 CompressionLevel level = AutoFull);
142 ErrorCode addFiles(const QStringList& paths, const QString& root,
143 CompressionOptions options,
144 CompressionLevel level = AutoFull,
145 int* addedFiles = 0);
147 ErrorCode closeArchive();
149 QString formatError(ErrorCode c) const;
155 Q_DECLARE_OPERATORS_FOR_FLAGS(Zip::CompressionOptions)
159 #endif // OSDAB_ZIP__H
CompressionLevel
Definition: zip.h:67
Zip file compression.
Definition: zip.h:49
ErrorCode
Definition: zip.h:52
CompressionOption
Definition: zip.h:75