mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
FileSystemType properties can no longer be nil
This commit is contained in:
@@ -7,7 +7,7 @@ import Foundation
|
||||
|
||||
extension FileSystemType {
|
||||
|
||||
init?(_ gzipOS: UInt8) {
|
||||
init(_ gzipOS: UInt8) {
|
||||
switch gzipOS {
|
||||
case 0:
|
||||
self = .fat
|
||||
@@ -17,10 +17,8 @@ extension FileSystemType {
|
||||
self = .macintosh
|
||||
case 11:
|
||||
self = .ntfs
|
||||
case 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 255:
|
||||
self = .other
|
||||
default:
|
||||
return nil
|
||||
self = .other
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,8 @@ public struct GzipHeader {
|
||||
*/
|
||||
public let modificationTime: Date?
|
||||
|
||||
// TODO: Explain why can be nil?
|
||||
/// Type of file system on which archivation took place.
|
||||
public let osType: FileSystemType?
|
||||
public let osType: FileSystemType
|
||||
|
||||
/// Name of the original file. If archive doesn't contain file's name, then `nil`.
|
||||
public let fileName: String?
|
||||
|
||||
@@ -7,7 +7,7 @@ import Foundation
|
||||
|
||||
extension FileSystemType {
|
||||
|
||||
init?(_ versionMadeBy: UInt16) {
|
||||
init(_ versionMadeBy: UInt16) {
|
||||
switch (versionMadeBy & 0xFF00) >> 8 {
|
||||
case 0, 14:
|
||||
self = .fat
|
||||
@@ -17,10 +17,8 @@ extension FileSystemType {
|
||||
self = .macintosh
|
||||
case 10:
|
||||
self = .ntfs
|
||||
case 1, 2, 4, 5, 6, 8, 9, 11, 12, 13, 15, 16, 17, 18:
|
||||
self = .other
|
||||
default:
|
||||
return nil
|
||||
self = .other
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public struct ZipEntryInfo: ContainerEntryInfo {
|
||||
/// True, if entry is likely to be text or ASCII file.
|
||||
public let isTextFile: Bool
|
||||
|
||||
public let fileSystemType: FileSystemType?
|
||||
public let fileSystemType: FileSystemType
|
||||
|
||||
public let compressionMethod: CompressionMethod
|
||||
|
||||
|
||||
Reference in New Issue
Block a user