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.customExtraFields
dictionary and instanceid
propertyDeclaration
Swift
static var id: UInt16 { get }
-
Location of extra field. Must be equal to the value of
location
argument 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
size
amount of data frombyteReader
.It is guaranteed that the offset of
byteReader
is 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 staticid
property.Following conditions are checked after execution of this initializer. Failure to satisfy them in conforming type will result in runtime error.
Postcondition
size
property of a created instance must be equal to the second argument.Declaration
Swift
init?(_ byteReader: LittleEndianByteReader, _ size: Int, location: ZipExtraFieldLocation)
-
id
Extension methodID of extra field. Must be equal to the key of extra field in
ZipContainer.customExtraFields
dictionary and staticid
propertyDeclaration
Swift
public var id: UInt16 { get }