ZipExtraField
public protocol ZipExtraField
A type that represents an extra field from a ZIP container.
-
ID of extra field. Must be equal to the key of extra field in
ZipContainer.customExtraFieldsdictionary and instanceidpropertyDeclaration
Swift
static var id: UInt16 { get } -
Location of extra field. Must be equal to the value of
locationargument ofinit?(_:_:location:).Declaration
Swift
var location: ZipExtraFieldLocation { get } -
Size of extra field’s data. Must be equal to the value of the second argument of
init?(_:_:location:).Declaration
Swift
var size: Int { get } -
Creates an extra field instance reading
sizeamount of data frombyteReader.It is guaranteed that the offset of
byteReaderis equal to the position right after extra field header ID and length of extra field data. It is also guaranteed that header ID matches conforming type’s staticidproperty.Following conditions are checked after execution of this initializer. Failure to satisfy them in conforming type will result in runtime error.
Postcondition
sizeproperty of a created instance must be equal to the second argument.Declaration
Swift
init?(_ byteReader: LittleEndianByteReader, _ size: Int, location: ZipExtraFieldLocation) -
idExtension methodID of extra field. Must be equal to the key of extra field in
ZipContainer.customExtraFieldsdictionary and staticidpropertyDeclaration
Swift
public var id: UInt16 { get }
View on GitHub
ZipExtraField Protocol Reference