mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
GzipHeader now checks ftext flag and provides a property for it.
This commit is contained in:
@@ -68,7 +68,7 @@ public struct GzipHeader {
|
||||
case ntfs = 11
|
||||
/// File system was unknown to the archiver.
|
||||
case unknown = 255
|
||||
/// File system was one of the rare systems..
|
||||
/// File system was one of the rare systems.
|
||||
case other = 256
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ public struct GzipHeader {
|
||||
/// Comment inside the archive.
|
||||
public let comment: String?
|
||||
|
||||
public let isTextFile: Bool
|
||||
|
||||
/**
|
||||
Initializes the structure with the values of first 'member' in gzip archive presented in `archiveData`.
|
||||
|
||||
@@ -128,6 +130,8 @@ public struct GzipHeader {
|
||||
self.osType = FileSystemType(rawValue: pointerData.alignedByte().toInt()) ?? .other
|
||||
headerBytes.append(self.osType.rawValue.toUInt8())
|
||||
|
||||
self.isTextFile = flags & Flags.ftext != 0
|
||||
|
||||
// Some archives may contain extra fields
|
||||
if flags & Flags.fextra != 0 {
|
||||
let xlen = pointerData.intFromAlignedBytes(count: 2)
|
||||
|
||||
Reference in New Issue
Block a user