[7-Zip] Move conversion from UInt64 to Date from entry to file info

This commit is contained in:
Timofey Solomko
2018-03-25 23:33:57 +03:00
parent bc41feaea9
commit 019bbf0629
2 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -57,9 +57,9 @@ public struct SevenZipEntryInfo: ContainerEntryInfo {
self.name = file.name
self.accessTime = Date(file.aTime)
self.creationTime = Date(file.cTime)
self.modificationTime = Date(file.mTime)
self.accessTime = file.aTime
self.creationTime = file.cTime
self.modificationTime = file.mTime
self.winAttributes = file.winAttributes
+6 -6
View File
@@ -13,9 +13,9 @@ class SevenZipFileInfo {
var isEmptyFile = false
var isAntiFile = false
var name: String = ""
var cTime: UInt64?
var mTime: UInt64?
var aTime: UInt64?
var cTime: Date?
var mTime: Date?
var aTime: Date?
var winAttributes: UInt32?
}
@@ -78,7 +78,7 @@ class SevenZipFileInfo {
else { throw SevenZipError.externalNotSupported }
for i in 0..<numFiles where timesDefined[i] == 1 {
files[i].cTime = bitReader.uint64()
files[i].cTime = Date(bitReader.uint64())
}
case 0x13: // Access time
let timesDefined = bitReader.defBits(count: numFiles)
@@ -89,7 +89,7 @@ class SevenZipFileInfo {
else { throw SevenZipError.externalNotSupported }
for i in 0..<numFiles where timesDefined[i] == 1 {
files[i].aTime = bitReader.uint64()
files[i].aTime = Date(bitReader.uint64())
}
case 0x14: // Modification time
let timesDefined = bitReader.defBits(count: numFiles)
@@ -100,7 +100,7 @@ class SevenZipFileInfo {
else { throw SevenZipError.externalNotSupported }
for i in 0..<numFiles where timesDefined[i] == 1 {
files[i].mTime = bitReader.uint64()
files[i].mTime = Date(bitReader.uint64())
}
case 0x15: // WinAttributes
let attributesDefined = bitReader.defBits(count: numFiles)