diff options
Diffstat (limited to 'rbutil/rbutilqt/quazip/quazipfileinfo.h')
-rw-r--r-- | rbutil/rbutilqt/quazip/quazipfileinfo.h | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/rbutil/rbutilqt/quazip/quazipfileinfo.h b/rbutil/rbutilqt/quazip/quazipfileinfo.h index 4e142a4eb5..43665b4ac2 100644 --- a/rbutil/rbutilqt/quazip/quazipfileinfo.h +++ b/rbutil/rbutilqt/quazip/quazipfileinfo.h | |||
@@ -25,12 +25,16 @@ Original ZIP package is copyrighted by Gilles Vollant and contributors, | |||
25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. | 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <QByteArray> | 28 | #include <QtCore/QByteArray> |
29 | #include <QDateTime> | 29 | #include <QtCore/QDateTime> |
30 | #include <QFile> | 30 | #include <QtCore/QFile> |
31 | #include <QtCore/QHash> | ||
31 | 32 | ||
32 | #include "quazip_global.h" | 33 | #include "quazip_global.h" |
33 | 34 | ||
35 | /// The typedef to store extra field parse results | ||
36 | typedef QHash<quint16, QList<QByteArray> > QuaExtraFieldHash; | ||
37 | |||
34 | /// Information about a file inside archive. | 38 | /// Information about a file inside archive. |
35 | /** | 39 | /** |
36 | * \deprecated Use QuaZipFileInfo64 instead. Not only it supports large files, | 40 | * \deprecated Use QuaZipFileInfo64 instead. Not only it supports large files, |
@@ -171,8 +175,52 @@ struct QUAZIP_EXPORT QuaZipFileInfo64 { | |||
171 | * @return The NTFS creation time, UTC | 175 | * @return The NTFS creation time, UTC |
172 | */ | 176 | */ |
173 | QDateTime getNTFScTime(int *fineTicks = NULL) const; | 177 | QDateTime getNTFScTime(int *fineTicks = NULL) const; |
178 | /// Returns the extended modification timestamp | ||
179 | /** | ||
180 | * The getExt*Time() functions only work if there is an extended timestamp | ||
181 | * extra field (ID 0x5455) present. Otherwise, they all return invalid null | ||
182 | * timestamps. | ||
183 | * | ||
184 | * QuaZipFileInfo64 only contains the modification time because it's extracted | ||
185 | * from @ref extra, which contains the global extra field, and access and | ||
186 | * creation time are in the local header which can be accessed through | ||
187 | * @ref QuaZipFile. | ||
188 | * | ||
189 | * @sa dateTime | ||
190 | * @sa QuaZipFile::getExtModTime() | ||
191 | * @sa QuaZipFile::getExtAcTime() | ||
192 | * @sa QuaZipFile::getExtCrTime() | ||
193 | * @return The extended modification time, UTC | ||
194 | */ | ||
195 | QDateTime getExtModTime() const; | ||
174 | /// Checks whether the file is encrypted. | 196 | /// Checks whether the file is encrypted. |
175 | bool isEncrypted() const {return (flags & 1) != 0;} | 197 | bool isEncrypted() const {return (flags & 1) != 0;} |
198 | /// Parses extra field | ||
199 | /** | ||
200 | * The returned hash table contains a list of data blocks for every header ID | ||
201 | * in the provided extra field. The number of data blocks in a hash table value | ||
202 | * equals to the number of occurrences of the appropriate header id. In most cases, | ||
203 | * a block with a specific header ID only occurs once, and therefore the returned | ||
204 | * hash table will contain a list consisting of a single element for that header ID. | ||
205 | * | ||
206 | * @param extraField extra field to parse | ||
207 | * @return header id to list of data block hash | ||
208 | */ | ||
209 | static QuaExtraFieldHash parseExtraField(const QByteArray &extraField); | ||
210 | /// Extracts extended time from the extra field | ||
211 | /** | ||
212 | * Utility function used by various getExt*Time() functions, but can be used directly | ||
213 | * if the extra field is obtained elsewhere (from a third party library, for example). | ||
214 | * | ||
215 | * @param extra the extra field for a file | ||
216 | * @param flag 1 - modification time, 2 - access time, 4 - creation time | ||
217 | * @return the extracted time or null QDateTime if not present | ||
218 | * @sa getExtModTime() | ||
219 | * @sa QuaZipFile::getExtModTime() | ||
220 | * @sa QuaZipFile::getExtAcTime() | ||
221 | * @sa QuaZipFile::getExtCrTime() | ||
222 | */ | ||
223 | static QDateTime getExtTime(const QByteArray &extra, int flag); | ||
176 | }; | 224 | }; |
177 | 225 | ||
178 | #endif | 226 | #endif |