ZipExtraField

public protocol ZipExtraField

A type that represents an extra field from a ZIP container.

  • id

    ID of extra field. Must be equal to the key of extra field in ZipContainer.customExtraFields dictionary and instance id property

    Declaration

    Swift

    static var id: UInt16 { get }
  • Location of extra field. Must be equal to the value of location argument of init?(_:_: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 from byteReader.

    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 static id property.

    Following conditions are checked after execution of this initializer. Failure to satisfy them in conforming type will result in runtime error.

    Postcondition

    location property of a created instance must be equal to the location argument.

    Postcondition

    size property of a created instance must be equal to the second argument.

    Postcondition

    exactly size amount of bytes must be read by initializer from byteReader.

    Declaration

    Swift

    init?(_ byteReader: LittleEndianByteReader, _ size: Int, location: ZipExtraFieldLocation)
  • id Extension method

    ID of extra field. Must be equal to the key of extra field in ZipContainer.customExtraFields dictionary and static id property

    Declaration

    Swift

    public var id: UInt16 { get }