QuaZip quazip-1-4
quazipfileinfo.h
1#ifndef QUA_ZIPFILEINFO_H
2#define QUA_ZIPFILEINFO_H
3
4/*
5Copyright (C) 2005-2014 Sergey A. Tachenov
6
7This file is part of QuaZip.
8
9QuaZip is free software: you can redistribute it and/or modify
10it under the terms of the GNU Lesser General Public License as published by
11the Free Software Foundation, either version 2.1 of the License, or
12(at your option) any later version.
13
14QuaZip is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License
20along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
21
22See COPYING file for the full LGPL text.
23
24Original ZIP package is copyrighted by Gilles Vollant and contributors,
25see quazip/(un)zip.h files for details. Basically it's the zlib license.
26*/
27
28#include <QtCore/QByteArray>
29#include <QtCore/QDateTime>
30#include <QtCore/QFile>
31#include <QtCore/QHash>
32
33#include "quazip_global.h"
34
37
39
45struct QUAZIP_EXPORT QuaZipFileInfo {
53 quint16 flags;
55 quint16 method;
59 quint32 crc;
67 quint16 internalAttr;
69 quint32 externalAttr;
75
79 QFile::Permissions getPermissions() const;
80};
81
83
85struct QUAZIP_EXPORT QuaZipFileInfo64 {
93 quint16 flags;
95 quint16 method;
97
106 quint32 crc;
122
126 QFile::Permissions getPermissions() const;
128
132 bool isSymbolicLink() const;
134
144 bool toQuaZipFileInfo(QuaZipFileInfo &info) const;
146
157 QDateTime getNTFSmTime(int *fineTicks = nullptr) const;
159
170 QDateTime getNTFSaTime(int *fineTicks = nullptr) const;
172
183 QDateTime getNTFScTime(int *fineTicks = nullptr) const;
185
201 QDateTime getExtModTime() const;
203 bool isEncrypted() const {return (flags & 1) != 0;}
205
215 static QuaExtraFieldHash parseExtraField(const QByteArray &extraField);
217
229 static QDateTime getExtTime(const QByteArray &extra, int flag);
230};
231
232#endif
typedef Permissions
Information about a file inside archive (with zip64 support).
Definition: quazipfileinfo.h:85
quint16 versionNeeded
Version needed to extract.
Definition: quazipfileinfo.h:91
QString name
File name.
Definition: quazipfileinfo.h:87
quint32 externalAttr
External file attributes.
Definition: quazipfileinfo.h:116
quint16 method
Compression method.
Definition: quazipfileinfo.h:95
QDateTime dateTime
Last modification date and time.
Definition: quazipfileinfo.h:104
bool isEncrypted() const
Checks whether the file is encrypted.
Definition: quazipfileinfo.h:203
quint64 uncompressedSize
Uncompressed file size.
Definition: quazipfileinfo.h:110
quint16 flags
General purpose flags.
Definition: quazipfileinfo.h:93
quint16 versionCreated
Version created by.
Definition: quazipfileinfo.h:89
QString comment
Comment.
Definition: quazipfileinfo.h:118
quint16 diskNumberStart
Disk number start.
Definition: quazipfileinfo.h:112
QByteArray extra
Extra field.
Definition: quazipfileinfo.h:120
quint64 compressedSize
Compressed file size.
Definition: quazipfileinfo.h:108
quint32 crc
CRC.
Definition: quazipfileinfo.h:106
quint16 internalAttr
Internal file attributes.
Definition: quazipfileinfo.h:114
Information about a file inside archive.
Definition: quazipfileinfo.h:45
quint32 uncompressedSize
Uncompressed file size.
Definition: quazipfileinfo.h:63
QString name
File name.
Definition: quazipfileinfo.h:47
quint16 internalAttr
Internal file attributes.
Definition: quazipfileinfo.h:67
quint16 versionCreated
Version created by.
Definition: quazipfileinfo.h:49
quint16 flags
General purpose flags.
Definition: quazipfileinfo.h:53
quint16 versionNeeded
Version needed to extract.
Definition: quazipfileinfo.h:51
quint16 diskNumberStart
Disk number start.
Definition: quazipfileinfo.h:65
quint32 crc
CRC.
Definition: quazipfileinfo.h:59
QDateTime dateTime
Last modification date and time.
Definition: quazipfileinfo.h:57
QString comment
Comment.
Definition: quazipfileinfo.h:71
quint16 method
Compression method.
Definition: quazipfileinfo.h:55
quint32 compressedSize
Compressed file size.
Definition: quazipfileinfo.h:61
quint32 externalAttr
External file attributes.
Definition: quazipfileinfo.h:69
QByteArray extra
Extra field.
Definition: quazipfileinfo.h:73