diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2015-03-08 19:07:42 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2015-05-02 16:52:14 +0200 |
commit | b230cf3aa24f3883b8b165bd5fd56620a9a95e47 (patch) | |
tree | 19e46e3697c98c3e51f7f4e91e3879f95bd0bc43 /rbutil/rbutilqt/quazip/quazipfileinfo.h | |
parent | d4fee369712f006785fd3a8904a5e2b5c529598b (diff) | |
download | rockbox-b230cf3aa24f3883b8b165bd5fd56620a9a95e47.tar.gz rockbox-b230cf3aa24f3883b8b165bd5fd56620a9a95e47.zip |
Update quazip to release 0.7.1.
Update to latest quazip release. Note that quazip is now LGPL and not GPL /
LGPL dual licensed anymore.
Change-Id: Ie1e975b5b546dd31218eef9df472527493fe81e0
Diffstat (limited to 'rbutil/rbutilqt/quazip/quazipfileinfo.h')
-rw-r--r-- | rbutil/rbutilqt/quazip/quazipfileinfo.h | 157 |
1 files changed, 131 insertions, 26 deletions
diff --git a/rbutil/rbutilqt/quazip/quazipfileinfo.h b/rbutil/rbutilqt/quazip/quazipfileinfo.h index 3216d776d5..4e142a4eb5 100644 --- a/rbutil/rbutilqt/quazip/quazipfileinfo.h +++ b/rbutil/rbutilqt/quazip/quazipfileinfo.h | |||
@@ -2,44 +2,43 @@ | |||
2 | #define QUA_ZIPFILEINFO_H | 2 | #define QUA_ZIPFILEINFO_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | -- A kind of "standard" GPL license statement -- | 5 | Copyright (C) 2005-2014 Sergey A. Tachenov |
6 | QuaZIP - a Qt/C++ wrapper for the ZIP/UNZIP package | ||
7 | Copyright (C) 2005-2007 Sergey A. Tachenov | ||
8 | 6 | ||
9 | This program is free software; you can redistribute it and/or modify it | 7 | This file is part of QuaZIP. |
10 | under the terms of the GNU General Public License as published by the | ||
11 | Free Software Foundation; either version 2 of the License, or (at your | ||
12 | option) any later version. | ||
13 | 8 | ||
14 | This program is distributed in the hope that it will be useful, but | 9 | QuaZIP is free software: you can redistribute it and/or modify |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | it under the terms of the GNU Lesser General Public License as published by |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 11 | the Free Software Foundation, either version 2.1 of the License, or |
17 | Public License for more details. | 12 | (at your option) any later version. |
18 | 13 | ||
19 | You should have received a copy of the GNU General Public License along | 14 | QuaZIP is distributed in the hope that it will be useful, |
20 | with this program; if not, write to the Free Software Foundation, Inc., | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | GNU Lesser General Public License for more details. | ||
22 | 18 | ||
23 | -- A kind of "standard" GPL license statement ends here -- | 19 | You should have received a copy of the GNU Lesser General Public License |
20 | along with QuaZIP. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 21 | ||
25 | See COPYING file for GPL. | 22 | See COPYING file for the full LGPL text. |
26 | 23 | ||
27 | You are also permitted to use QuaZIP under the terms of LGPL (see | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, |
28 | COPYING.LGPL). You are free to choose either license, but please note | 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. |
29 | that QuaZIP makes use of Qt, which is not licensed under LGPL. So if | 26 | */ |
30 | you are using Open Source edition of Qt, you therefore MUST use GPL for | ||
31 | your code based on QuaZIP, since it would be also based on Qt in this | ||
32 | case. If you are Qt commercial license owner, then you are free to use | ||
33 | QuaZIP as long as you respect either GPL or LGPL for QuaZIP code. | ||
34 | **/ | ||
35 | 27 | ||
36 | #include <QByteArray> | 28 | #include <QByteArray> |
37 | #include <QDateTime> | 29 | #include <QDateTime> |
30 | #include <QFile> | ||
31 | |||
32 | #include "quazip_global.h" | ||
38 | 33 | ||
39 | /// Information about a file inside archive. | 34 | /// Information about a file inside archive. |
40 | /** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to | 35 | /** |
36 | * \deprecated Use QuaZipFileInfo64 instead. Not only it supports large files, | ||
37 | * but also more convenience methods as well. | ||
38 | * | ||
39 | * Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to | ||
41 | * fill this structure. */ | 40 | * fill this structure. */ |
42 | struct QuaZipFileInfo { | 41 | struct QUAZIP_EXPORT QuaZipFileInfo { |
43 | /// File name. | 42 | /// File name. |
44 | QString name; | 43 | QString name; |
45 | /// Version created by. | 44 | /// Version created by. |
@@ -68,6 +67,112 @@ struct QuaZipFileInfo { | |||
68 | QString comment; | 67 | QString comment; |
69 | /// Extra field. | 68 | /// Extra field. |
70 | QByteArray extra; | 69 | QByteArray extra; |
70 | /// Get the file permissions. | ||
71 | /** | ||
72 | Returns the high 16 bits of external attributes converted to | ||
73 | QFile::Permissions. | ||
74 | */ | ||
75 | QFile::Permissions getPermissions() const; | ||
76 | }; | ||
77 | |||
78 | /// Information about a file inside archive (with zip64 support). | ||
79 | /** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to | ||
80 | * fill this structure. */ | ||
81 | struct QUAZIP_EXPORT QuaZipFileInfo64 { | ||
82 | /// File name. | ||
83 | QString name; | ||
84 | /// Version created by. | ||
85 | quint16 versionCreated; | ||
86 | /// Version needed to extract. | ||
87 | quint16 versionNeeded; | ||
88 | /// General purpose flags. | ||
89 | quint16 flags; | ||
90 | /// Compression method. | ||
91 | quint16 method; | ||
92 | /// Last modification date and time. | ||
93 | /** | ||
94 | * This is the time stored in the standard ZIP header. This format only allows | ||
95 | * to store time with 2-second precision, so the seconds will always be even | ||
96 | * and the milliseconds will always be zero. If you need more precise | ||
97 | * date and time, you can try to call the getNTFSmTime() function or | ||
98 | * its siblings, provided that the archive itself contains these NTFS times. | ||
99 | */ | ||
100 | QDateTime dateTime; | ||
101 | /// CRC. | ||
102 | quint32 crc; | ||
103 | /// Compressed file size. | ||
104 | quint64 compressedSize; | ||
105 | /// Uncompressed file size. | ||
106 | quint64 uncompressedSize; | ||
107 | /// Disk number start. | ||
108 | quint16 diskNumberStart; | ||
109 | /// Internal file attributes. | ||
110 | quint16 internalAttr; | ||
111 | /// External file attributes. | ||
112 | quint32 externalAttr; | ||
113 | /// Comment. | ||
114 | QString comment; | ||
115 | /// Extra field. | ||
116 | QByteArray extra; | ||
117 | /// Get the file permissions. | ||
118 | /** | ||
119 | Returns the high 16 bits of external attributes converted to | ||
120 | QFile::Permissions. | ||
121 | */ | ||
122 | QFile::Permissions getPermissions() const; | ||
123 | /// Converts to QuaZipFileInfo | ||
124 | /** | ||
125 | If any of the fields are greater than 0xFFFFFFFFu, they are set to | ||
126 | 0xFFFFFFFFu exactly, not just truncated. This function should be mainly used | ||
127 | for compatibility with the old code expecting QuaZipFileInfo, in the cases | ||
128 | when it's impossible or otherwise unadvisable (due to ABI compatibility | ||
129 | reasons, for example) to modify that old code to use QuaZipFileInfo64. | ||
130 | |||
131 | \return \c true if all fields converted correctly, \c false if an overflow | ||
132 | occured. | ||
133 | */ | ||
134 | bool toQuaZipFileInfo(QuaZipFileInfo &info) const; | ||
135 | /// Returns the NTFS modification time | ||
136 | /** | ||
137 | * The getNTFS*Time() functions only work if there is an NTFS extra field | ||
138 | * present. Otherwise, they all return invalid null timestamps. | ||
139 | * @param fineTicks If not NULL, the fractional part of milliseconds returned | ||
140 | * there, measured in 100-nanosecond ticks. Will be set to | ||
141 | * zero if there is no NTFS extra field. | ||
142 | * @sa dateTime | ||
143 | * @sa getNTFSaTime() | ||
144 | * @sa getNTFScTime() | ||
145 | * @return The NTFS modification time, UTC | ||
146 | */ | ||
147 | QDateTime getNTFSmTime(int *fineTicks = NULL) const; | ||
148 | /// Returns the NTFS access time | ||
149 | /** | ||
150 | * The getNTFS*Time() functions only work if there is an NTFS extra field | ||
151 | * present. Otherwise, they all return invalid null timestamps. | ||
152 | * @param fineTicks If not NULL, the fractional part of milliseconds returned | ||
153 | * there, measured in 100-nanosecond ticks. Will be set to | ||
154 | * zero if there is no NTFS extra field. | ||
155 | * @sa dateTime | ||
156 | * @sa getNTFSmTime() | ||
157 | * @sa getNTFScTime() | ||
158 | * @return The NTFS access time, UTC | ||
159 | */ | ||
160 | QDateTime getNTFSaTime(int *fineTicks = NULL) const; | ||
161 | /// Returns the NTFS creation time | ||
162 | /** | ||
163 | * The getNTFS*Time() functions only work if there is an NTFS extra field | ||
164 | * present. Otherwise, they all return invalid null timestamps. | ||
165 | * @param fineTicks If not NULL, the fractional part of milliseconds returned | ||
166 | * there, measured in 100-nanosecond ticks. Will be set to | ||
167 | * zero if there is no NTFS extra field. | ||
168 | * @sa dateTime | ||
169 | * @sa getNTFSmTime() | ||
170 | * @sa getNTFSaTime() | ||
171 | * @return The NTFS creation time, UTC | ||
172 | */ | ||
173 | QDateTime getNTFScTime(int *fineTicks = NULL) const; | ||
174 | /// Checks whether the file is encrypted. | ||
175 | bool isEncrypted() const {return (flags & 1) != 0;} | ||
71 | }; | 176 | }; |
72 | 177 | ||
73 | #endif | 178 | #endif |