Go to the source code of this file.
static QDateTime getNTFSTime |
( |
const QByteArray & |
extra, |
|
|
int |
position, |
|
|
int * |
fineTicks |
|
) |
| |
|
static |
Definition at line 92 of file quazipfileinfo.cpp.
References QUAZIP_EXTRA_NTFS_MAGIC, and QUAZIP_EXTRA_NTFS_TIME_MAGIC.
Referenced by QuaZipFileInfo64::getNTFSaTime(), QuaZipFileInfo64::getNTFScTime(), and QuaZipFileInfo64::getNTFSmTime().
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()) {
#define QUAZIP_EXTRA_NTFS_MAGIC
#define QUAZIP_EXTRA_NTFS_TIME_MAGIC
static QFile::Permissions permissionsFromExternalAttr |
( |
quint32 |
externalAttr | ) |
|
|
static |
Definition at line 27 of file quazipfileinfo.cpp.
Referenced by QuaZipFileInfo::getPermissions(), and QuaZipFileInfo64::getPermissions().
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;