quazipfileinfo.h
#ifndef QUA_ZIPFILEINFO_H
#define QUA_ZIPFILEINFO_H
/*
Copyright (C) 2005-2014 Sergey A. Tachenov
This file is part of QuaZip.
QuaZip is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
QuaZip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
See COPYING file for the full LGPL text.
Original ZIP package is copyrighted by Gilles Vollant and contributors,
see quazip/(un)zip.h files for details. Basically it's the zlib license.
*/
#include <QtCore/QByteArray>
#include <QtCore/QDateTime>
#include <QtCore/QFile>
#include <QtCore/QHash>
#include "quazip_global.h"
typedef QHash<quint16, QList<QByteArray> > QuaExtraFieldHash;
struct QUAZIP_EXPORT QuaZipFileInfo {
QString name;
quint16 versionCreated;
quint16 versionNeeded;
quint16 flags;
quint16 method;
QDateTime dateTime;
quint32 crc;
quint32 compressedSize;
quint32 uncompressedSize;
quint16 diskNumberStart;
quint16 internalAttr;
quint32 externalAttr;
QString comment;
QByteArray extra;
QFile::Permissions getPermissions() const;
};
struct QUAZIP_EXPORT QuaZipFileInfo64 {
QString name;
quint16 versionCreated;
quint16 versionNeeded;
quint16 flags;
quint16 method;
QDateTime dateTime;
quint32 crc;
quint64 compressedSize;
quint64 uncompressedSize;
quint16 diskNumberStart;
quint16 internalAttr;
quint32 externalAttr;
QString comment;
QByteArray extra;
QFile::Permissions getPermissions() const;
bool isSymbolicLink() const;
bool toQuaZipFileInfo(QuaZipFileInfo &info) const;
QDateTime getNTFSmTime(int *fineTicks = nullptr) const;
QDateTime getNTFSaTime(int *fineTicks = nullptr) const;
QDateTime getNTFScTime(int *fineTicks = nullptr) const;
QDateTime getExtModTime() const;
bool isEncrypted() const {return (flags & 1) != 0;}
static QuaExtraFieldHash parseExtraField(const QByteArray &extraField);
static QDateTime getExtTime(const QByteArray &extra, int flag);
};
#endif
QuaZipFileInfo64
Information about a file inside archive (with zip64 support).
Definition quazipfileinfo.h:85
QuaZipFileInfo64::versionNeeded
quint16 versionNeeded
Version needed to extract.
Definition quazipfileinfo.h:91
QuaZipFileInfo64::name
QString name
File name.
Definition quazipfileinfo.h:87
QuaZipFileInfo64::externalAttr
quint32 externalAttr
External file attributes.
Definition quazipfileinfo.h:116
QuaZipFileInfo64::method
quint16 method
Compression method.
Definition quazipfileinfo.h:95
QuaZipFileInfo64::dateTime
QDateTime dateTime
Last modification date and time.
Definition quazipfileinfo.h:104
QuaZipFileInfo64::isEncrypted
bool isEncrypted() const
Checks whether the file is encrypted.
Definition quazipfileinfo.h:203
QuaZipFileInfo64::uncompressedSize
quint64 uncompressedSize
Uncompressed file size.
Definition quazipfileinfo.h:110
QuaZipFileInfo64::flags
quint16 flags
General purpose flags.
Definition quazipfileinfo.h:93
QuaZipFileInfo64::versionCreated
quint16 versionCreated
Version created by.
Definition quazipfileinfo.h:89
QuaZipFileInfo64::comment
QString comment
Comment.
Definition quazipfileinfo.h:118
QuaZipFileInfo64::diskNumberStart
quint16 diskNumberStart
Disk number start.
Definition quazipfileinfo.h:112
QuaZipFileInfo64::extra
QByteArray extra
Extra field.
Definition quazipfileinfo.h:120
QuaZipFileInfo64::compressedSize
quint64 compressedSize
Compressed file size.
Definition quazipfileinfo.h:108
QuaZipFileInfo64::crc
quint32 crc
CRC.
Definition quazipfileinfo.h:106
QuaZipFileInfo64::internalAttr
quint16 internalAttr
Internal file attributes.
Definition quazipfileinfo.h:114
QuaZipFileInfo
Information about a file inside archive.
Definition quazipfileinfo.h:45
QuaZipFileInfo::uncompressedSize
quint32 uncompressedSize
Uncompressed file size.
Definition quazipfileinfo.h:63
QuaZipFileInfo::name
QString name
File name.
Definition quazipfileinfo.h:47
QuaZipFileInfo::internalAttr
quint16 internalAttr
Internal file attributes.
Definition quazipfileinfo.h:67
QuaZipFileInfo::versionCreated
quint16 versionCreated
Version created by.
Definition quazipfileinfo.h:49
QuaZipFileInfo::flags
quint16 flags
General purpose flags.
Definition quazipfileinfo.h:53
QuaZipFileInfo::versionNeeded
quint16 versionNeeded
Version needed to extract.
Definition quazipfileinfo.h:51
QuaZipFileInfo::diskNumberStart
quint16 diskNumberStart
Disk number start.
Definition quazipfileinfo.h:65
QuaZipFileInfo::crc
quint32 crc
CRC.
Definition quazipfileinfo.h:59
QuaZipFileInfo::dateTime
QDateTime dateTime
Last modification date and time.
Definition quazipfileinfo.h:57
QuaZipFileInfo::comment
QString comment
Comment.
Definition quazipfileinfo.h:71
QuaZipFileInfo::method
quint16 method
Compression method.
Definition quazipfileinfo.h:55
QuaZipFileInfo::compressedSize
quint32 compressedSize
Compressed file size.
Definition quazipfileinfo.h:61
QuaZipFileInfo::externalAttr
quint32 externalAttr
External file attributes.
Definition quazipfileinfo.h:69
QuaZipFileInfo::extra
QByteArray extra
Extra field.
Definition quazipfileinfo.h:73