28 quint32 uPerm = (externalAttr & 0xFFFF0000u) >> 16;
29 QFile::Permissions perm = 0;
30 if ((uPerm & 0400) != 0)
31 perm |= QFile::ReadOwner;
32 if ((uPerm & 0200) != 0)
33 perm |= QFile::WriteOwner;
34 if ((uPerm & 0100) != 0)
35 perm |= QFile::ExeOwner;
36 if ((uPerm & 0040) != 0)
37 perm |= QFile::ReadGroup;
38 if ((uPerm & 0020) != 0)
39 perm |= QFile::WriteGroup;
40 if ((uPerm & 0010) != 0)
41 perm |= QFile::ExeGroup;
42 if ((uPerm & 0004) != 0)
43 perm |= QFile::ReadOther;
44 if ((uPerm & 0002) != 0)
45 perm |= QFile::WriteOther;
46 if ((uPerm & 0001) != 0)
47 perm |= QFile::ExeOther;
64 bool noOverflow =
true;
92 static QDateTime
getNTFSTime(
const QByteArray &extra,
int position,
96 for (
int i = 0; i <= extra.size() - 4; ) {
97 unsigned type =
static_cast<unsigned>(
static_cast<unsigned char>(
99 | (
static_cast<unsigned>(
static_cast<unsigned char>(
100 extra.at(i + 1))) << 8);
102 unsigned length =
static_cast<unsigned>(
static_cast<unsigned char>(
104 | (
static_cast<unsigned>(
static_cast<unsigned char>(
105 extra.at(i + 1))) << 8);
109 while (i <= extra.size() - 4) {
110 unsigned tag =
static_cast<unsigned>(
111 static_cast<unsigned char>(extra.at(i)))
112 | (
static_cast<unsigned>(
113 static_cast<unsigned char>(extra.at(i + 1)))
116 int tagsize =
static_cast<unsigned>(
117 static_cast<unsigned char>(extra.at(i)))
118 | (
static_cast<unsigned>(
119 static_cast<unsigned char>(extra.at(i + 1)))
123 && tagsize >= position + 8) {
125 quint64 mtime =
static_cast<quint64
>(
126 static_cast<unsigned char>(extra.at(i)))
127 | (
static_cast<quint64
>(
static_cast<unsigned char>(
128 extra.at(i + 1))) << 8)
129 | (static_cast<quint64>(static_cast<unsigned char>(
130 extra.at(i + 2))) << 16)
131 | (static_cast<quint64>(static_cast<unsigned char>(
132 extra.at(i + 3))) << 24)
133 | (static_cast<quint64>(static_cast<unsigned char>(
134 extra.at(i + 4))) << 32)
135 | (static_cast<quint64>(static_cast<unsigned char>(
136 extra.at(i + 5))) << 40)
137 | (static_cast<quint64>(static_cast<unsigned char>(
138 extra.at(i + 6))) << 48)
139 | (static_cast<quint64>(static_cast<unsigned char>(
140 extra.at(i + 7))) << 56);
142 QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC);
143 dateTime = base.addMSecs(mtime / 10000);
144 if (fineTicks != NULL) {
145 *fineTicks =
static_cast<int>(mtime % 10000);
147 i += tagsize - position;
157 if (fineTicks != NULL && dateTime.isNull()) {
quint16 diskNumberStart
Disk number start.
QDateTime getNTFScTime(int *fineTicks=NULL) const
Returns the NTFS creation time.
QByteArray extra
Extra field.
static QDateTime getNTFSTime(const QByteArray &extra, int position, int *fineTicks)
quint16 versionCreated
Version created by.
quint32 externalAttr
External file attributes.
quint16 versionNeeded
Version needed to extract.
#define QUAZIP_EXTRA_NTFS_MAGIC
QFile::Permissions getPermissions() const
Get the file permissions.
QByteArray extra
Extra field.
quint16 flags
General purpose flags.
QDateTime getNTFSmTime(int *fineTicks=NULL) const
Returns the NTFS modification time.
static QFile::Permissions permissionsFromExternalAttr(quint32 externalAttr)
quint16 versionCreated
Version created by.
bool toQuaZipFileInfo(QuaZipFileInfo &info) const
Converts to QuaZipFileInfo.
quint32 compressedSize
Compressed file size.
Information about a file inside archive.
quint64 compressedSize
Compressed file size.
quint16 versionNeeded
Version needed to extract.
quint16 internalAttr
Internal file attributes.
#define QUAZIP_EXTRA_NTFS_TIME_MAGIC
QFile::Permissions getPermissions() const
Get the file permissions.
quint16 method
Compression method.
QDateTime dateTime
Last modification date and time.
quint64 uncompressedSize
Uncompressed file size.
QDateTime getNTFSaTime(int *fineTicks=NULL) const
Returns the NTFS access time.
quint32 uncompressedSize
Uncompressed file size.
QDateTime dateTime
Last modification date and time.
quint16 flags
General purpose flags.
quint16 diskNumberStart
Disk number start.
quint32 externalAttr
External file attributes.
quint16 method
Compression method.
quint16 internalAttr
Internal file attributes.