ZipContainer

public class ZipContainer: Container

Provides functions for work with ZIP containers.

  • Processes ZIP container and returns an array of ZipEntry with information and data for all entries.

    Important

    The order of entries is defined by ZIP container and, particularly, by the creator of a given ZIP container. It is likely that directories will be encountered earlier than files stored in those directories, but one SHOULD NOT rely on any particular order.

    Throws

    ZipError or any other error associated with compression type, depending on the type of the problem. It may indicate that either container is damaged or it might not be ZIP container at all.

    Declaration

    Swift

    public static func open(container data: Data) throws -> [ZipEntry]

    Parameters

    container

    ZIP container’s data.

    Return Value

    Array of ZipEntry.

  • Processes ZIP container and returns an array of ZipEntryInfo with information about entries in this container.

    Important

    The order of entries is defined by ZIP container and, particularly, by the creator of a given ZIP container. It is likely that directories will be encountered earlier than files stored in those directories, but one SHOULD NOT rely on any particular order.

    Throws

    ZipError, which may indicate that either container is damaged or it might not be ZIP container at all.

    Declaration

    Swift

    public static func info(container data: Data) throws -> [ZipEntryInfo]

    Parameters

    container

    ZIP container’s data.

    Return Value

    Array of ZipEntryInfo.