commit 53de06dd05b6d9050ece283b100dea3ef05e1fda Author: Timofey Solomko Date: Sat Jun 12 13:16:37 2021 +0300 Deploy to GH Pages [skip ci] diff --git a/7-Zip.html b/7-Zip.html new file mode 100644 index 00000000..5da99d58 --- /dev/null +++ b/7-Zip.html @@ -0,0 +1,369 @@ + + + + 7-Zip Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

7-Zip

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Archives.html b/Archives.html new file mode 100644 index 00000000..b49d4a44 --- /dev/null +++ b/Archives.html @@ -0,0 +1,431 @@ + + + + Archives Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Archives

+ +
+
+ +
+
+
+
    +
  • +
    + + + + GzipArchive + +
    +
    +
    +
    +
    +
    +

    Provides unarchive and archive functions for GZip archives.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class GzipArchive : Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + GzipHeader + +
    +
    +
    +
    +
    +
    +

    Represents the header of a GZip archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct GzipHeader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + XZArchive + +
    +
    +
    +
    +
    +
    +

    Provides unarchive function for XZ archives.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class XZArchive : Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZlibArchive + +
    +
    +
    +
    +
    +
    +

    Provides unarchive and archive functions for Zlib archives.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class ZlibArchive : Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZlibHeader + +
    +
    +
    +
    +
    +
    +

    Represents the header of a Zlib archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ZlibHeader
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/BZip2.html b/Classes/BZip2.html new file mode 100644 index 00000000..89d944c3 --- /dev/null +++ b/Classes/BZip2.html @@ -0,0 +1,557 @@ + + + + BZip2 Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BZip2

+
+
+ +
public class BZip2 : DecompressionAlgorithm
+
extension BZip2: CompressionAlgorithm
+ +
+
+

Provides functions for compression and decompression for BZip2 algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using BZip2 algortihm.

    +
    +

    Throws

    +

    BZip2Error if unexpected byte (bit) sequence was encountered in data. +It may indicate that either data is damaged or it might not be compressed with BZip2 at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with BZip2.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses one or more concatenated BZip2 archives found in data.

    +
    +

    Throws

    +

    BZip2Error if an unexpected byte (bit) sequence was encountered or a checksum mismatch is detected for +any archive. It may indicate that the input is damaged or it might not be compressed with BZip2 at all. If +BZip2Error.wrongCRC is thrown, its associated value contains only the bytes decompressed for the archive that +failed the checksum.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func multiDecompress(data: Data) throws -> [Data]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data that may contain one or more concatenated BZip2 archives.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of decompressed data, one element per archive, in the same order as they appear in the input.

    +
    + +
    +
    +
  • +
  • +
    + + + + BlockSize + +
    +
    +
    +
    +
    +
    +

    Represents the size of the blocks in which data is split during BZip2 compression.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum BlockSize : Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compresses data with BZip2 algortihm.

    +
    +

    Note

    +

    Input data will be split into blocks of size 100 KB. Use BZip2.compress(data:blockSize:) function to +specify the size of a block.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Compresses data with BZip2 algortihm, splitting data into blocks of specified blockSize.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data, blockSize: BlockSize) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    + + blockSize + + +
    +

    Size of blocks in which data will be split.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/BZip2/BlockSize.html b/Classes/BZip2/BlockSize.html new file mode 100644 index 00000000..dd45b542 --- /dev/null +++ b/Classes/BZip2/BlockSize.html @@ -0,0 +1,561 @@ + + + + BlockSize Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BlockSize

+
+
+ +
public enum BlockSize : Int
+ +
+
+

Represents the size of the blocks in which data is split during BZip2 compression.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + one + +
    +
    +
    +
    +
    +
    +

    100 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case one = 1
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + two + +
    +
    +
    +
    +
    +
    +

    200 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case two = 2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + three + +
    +
    +
    +
    +
    +
    +

    300 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case three = 3
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + four + +
    +
    +
    +
    +
    +
    +

    400 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case four = 4
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + five + +
    +
    +
    +
    +
    +
    +

    500 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case five = 5
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + six + +
    +
    +
    +
    +
    +
    +

    600 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case six = 6
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + seven + +
    +
    +
    +
    +
    +
    +

    700 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case seven = 7
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + eight + +
    +
    +
    +
    +
    +
    +

    800 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case eight = 8
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nine + +
    +
    +
    +
    +
    +
    +

    900 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nine = 9
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/Deflate.html b/Classes/Deflate.html new file mode 100644 index 00000000..738bfbfa --- /dev/null +++ b/Classes/Deflate.html @@ -0,0 +1,411 @@ + + + + Deflate Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Deflate

+
+
+ +
public class Deflate : DecompressionAlgorithm
+
extension Deflate: CompressionAlgorithm
+ +
+
+

Provides functions for compression and decompression for Deflate algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using Deflate algortihm.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    DeflateError if unexpected byte (bit) sequence was encountered in data. +It may indicate that either data is damaged or it might not be compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with Deflate.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compresses data with Deflate algortihm.

    +
    +

    Note

    +

    Currently, SWCompression creates only one block for all data +and the block can either be uncompressed or compressed with static Huffman encoding. +Choice of one block type or the other depends on bytes’ statistics of data. +However, if data size is greater than 65535 (the maximum value stored in 2 bytes), +then static Huffman block will be created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/GzipArchive.html b/Classes/GzipArchive.html new file mode 100644 index 00000000..072149df --- /dev/null +++ b/Classes/GzipArchive.html @@ -0,0 +1,600 @@ + + + + GzipArchive Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GzipArchive

+
+
+ +
public class GzipArchive : Archive
+ +
+
+

Provides unarchive and archive functions for GZip archives.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Member + +
    +
    +
    +
    +
    +
    +

    Represents the member of a multi-member GZip archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Member
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchives GZip archive.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    DeflateError or GzipError depending on the type of the problem. +It may indicate that either archive is damaged or it might not be archived with GZip +or compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unarchive(archive data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with GZip.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unarchives multi-member GZip archive. +Multi-member GZip archives are essentially several GZip archives following each other in a single file.

    +
    +

    Throws

    +

    DeflateError or GzipError depending on the type of the problem. +It may indicate that one of the members of archive is damaged or +it might not be archived with GZip or compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func multiUnarchive(archive data: Data) throws -> [Member]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    GZip archive with one or more members.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Archives data into GZip archive, using various specified options. +Data will be also compressed with Deflate algorithm. +It will be also specified in archive’s header that the compressor used the slowest Deflate algorithm.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    GzipError.cannotEncodeISOLatin1 if a file name or a comment cannot be encoded with ISO-Latin-1 encoding +or if the total sum of the binary content length of all extra fields plus 4 for each field exceeds UInt16.max.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func archive(data: Data, comment: String? = nil, fileName: String? = nil,
    +                           writeHeaderCRC: Bool = false, isTextFile: Bool = false,
    +                           osType: FileSystemType? = nil, modificationTime: Date? = nil,
    +                           extraFields: [GzipHeader.ExtraField] = []) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data to compress and archive.

    +
    +
    + + comment + + +
    +

    Additional comment, which will be stored as a separate field in archive.

    +
    +
    + + fileName + + +
    +

    Name of the file which will be archived.

    +
    +
    + + writeHeaderCRC + + +
    +

    Set to true, if you want to store consistency check for archive’s header.

    +
    +
    + + isTextFile + + +
    +

    Set to true, if the file which will be archived is text file or ASCII-file.

    +
    +
    + + osType + + +
    +

    Type of the system on which this archive will be created.

    +
    +
    + + modificationTime + + +
    +

    Last time the file was modified.

    +
    +
    + + extraFields + + +
    +

    Any extra fields. Note that no extra field is allowed to have second byte of the extra +field (subfield) ID equal to zero. In addition, the length of a field’s binary content must be less than +UInt16.max, while the total sum of the binary content length of all extra fields plus 4 for each field must also +not exceed UInt16.max. See GZip format specification for more details.

    +
    +
    +
    +
    +

    Return Value

    +

    Resulting archive’s data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/GzipArchive/Member.html b/Classes/GzipArchive/Member.html new file mode 100644 index 00000000..90750834 --- /dev/null +++ b/Classes/GzipArchive/Member.html @@ -0,0 +1,351 @@ + + + + Member Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Member

+
+
+ +
public struct Member
+ +
+
+

Represents the member of a multi-member GZip archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + header + +
    +
    +
    +
    +
    +
    +

    GZip header of a member.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let header: GzipHeader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    +

    Unarchived data from a member.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let data: Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/LZMA.html b/Classes/LZMA.html new file mode 100644 index 00000000..261dff40 --- /dev/null +++ b/Classes/LZMA.html @@ -0,0 +1,450 @@ + + + + LZMA Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMA

+
+
+ +
public class LZMA : DecompressionAlgorithm
+ +
+
+

Provides decompression function for LZMA.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using LZMA.

    +
    +

    Note

    +

    It is assumed that the first nine bytes of data represent standard LZMA properties (so called “lc”, “lp” +and “pb”), dictionary size, and uncompressed size all encoded with standard encoding scheme of LZMA format.

    + +
    +

    Throws

    +

    LZMAError if unexpected byte (bit) sequence was encountered in data. It may indicate that either data +is damaged or it might not be compressed with LZMA at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with LZMA.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses data using LZMA with specified algorithm’s properties, and, optionally, output’s +uncompressedSize. If uncompressedSize is nil, then data must contain finish marker.

    +
    +

    Note

    +

    It is assumed that data begins immediately with LZMA compressed bytes with no LZMA properties at the +beginning.

    + +
    +

    Warning

    +

    There is no validation performed for properties of properties argument. This API is intended to be +used by advanced users.

    + +
    +

    Throws

    +

    LZMAError if unexpected byte (bit) sequence was encountered in data. It may indicate that either data +is damaged or it might not be compressed with LZMA at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data,
    +                              properties: LZMAProperties,
    +                              uncompressedSize: Int? = nil) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data compressed with LZMA.

    +
    +
    + + properties + + +
    +

    Properties of LZMA (such as lc, lp, etc.)

    +
    +
    + + uncompressedSize + + +
    +

    Size of uncompressed data; nil if it is unknown. In case of nil, finish marker +must be present in data.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/LZMA2.html b/Classes/LZMA2.html new file mode 100644 index 00000000..801fa439 --- /dev/null +++ b/Classes/LZMA2.html @@ -0,0 +1,353 @@ + + + + LZMA2 Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMA2

+
+
+ +
public class LZMA2 : DecompressionAlgorithm
+ +
+
+

Provides decompression function for LZMA2 algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using LZMA2 algortihm.

    +
    +

    Note

    +

    It is assumed that the first byte of data is a dictionary size encoded with standard encoding scheme of +LZMA2 format.

    + +
    +

    Throws

    +

    LZMAError or LZMA2Error if unexpected byte (bit) sequence was encountered in data. +It may indicate that either data is damaged or it might not be compressed with LZMA2 at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with LZMA2.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/SevenZipContainer.html b/Classes/SevenZipContainer.html new file mode 100644 index 00000000..13af4938 --- /dev/null +++ b/Classes/SevenZipContainer.html @@ -0,0 +1,420 @@ + + + + SevenZipContainer Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipContainer

+
+
+ +
public class SevenZipContainer : Container
+ +
+
+

Provides functions for work with 7-Zip containers.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    Processes 7-Zip container and returns an array of SevenZipEntry with information and data for all entries.

    +
    +

    Important

    +

    The order of entries is defined by 7-Zip container and, particularly, by the creator of a given 7-Zip +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

    SevenZipError 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 7-Zip container at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    7-Zip container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of SevenZipEntry.

    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    Processes 7-Zip container and returns an array of SevenZipEntryInfo with information about entries in this +container.

    +
    +

    Important

    +

    The order of entries is defined by 7-Zip container and, particularly, by the creator of a given 7-Zip +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

    SevenZipError 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 7-Zip container at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    7-Zip container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of SevenZipEntryInfo.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/TarContainer.html b/Classes/TarContainer.html new file mode 100644 index 00000000..00efa8d9 --- /dev/null +++ b/Classes/TarContainer.html @@ -0,0 +1,638 @@ + + + + TarContainer Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarContainer

+
+
+ +
public class TarContainer : Container
+ +
+
+

Provides functions for work with TAR containers.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Format + +
    +
    +
    +
    +
    +
    +

    Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to +successfully read a particular container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Format
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formatOf(container:) + +
    +
    +
    +
    +
    +
    +

    Processes TAR container and returns its “format”: a minimal set of extensions to basic TAR format required to +successfully read this container.

    +
    +

    Throws

    +

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

    + +
    +

    See also

    +

    TarContainer.Format

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func formatOf(container data: Data) throws -> Format
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + container + + +
    +

    TAR container’s data.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + create(from:) + +
    +
    +
    +
    +
    +
    +

    Creates a new TAR container with entries as its content and generates its Data.

    +
    +

    See also

    +

    TarEntryInfo properties documenation to see how their values are connected with the specific TAR +format used during container creation.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func create(from entries: [TarEntry]) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entries + + +
    +

    TAR entries to store in the container.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + create(from:force:) + +
    +
    +
    +
    +
    +
    +

    Creates a new TAR container with entries as its content and generates its Data using the specified format.

    + +

    This function forces the usage of the format, meaning that certain properties of the entries may be missing +from the resulting container data if the chosen format does not support corresponding features. For example, +relatively long names (and linknames) will be truncated if the .ustar or .prePosix format is specified.

    + +

    It is highly recommended to use the TarContainer.create(from:) function (or use the .pax format) to ensure the +best representation of the entries in the output. Other (non-PAX) formats should only be used if you have a +specific need for them and you understand limitations of those formats.

    +
    +

    See also

    +

    TarEntryInfo properties documenation to see how their values are connected with the specific TAR +format used during container creation.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func create(from entries: [TarEntry], force format: TarContainer.Format) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entries + + +
    +

    TAR entries to store in the container.

    +
    +
    + + force + + +
    +

    Force the usage of the specified format.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    Processes TAR container and returns an array of TarEntry with information and data for all entries.

    +
    +

    Important

    +

    The order of entries is defined by TAR container and, particularly, by the creator of a given TAR +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

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

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    TAR container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of TarEntry.

    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    Processes TAR container and returns an array of TarEntryInfo with information about entries in this container.

    +
    +

    Important

    +

    The order of entries is defined by TAR container and, particularly, by the creator of a given TAR +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

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

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    TAR container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of TarEntryInfo.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/TarContainer/Format.html b/Classes/TarContainer/Format.html new file mode 100644 index 00000000..a684cc95 --- /dev/null +++ b/Classes/TarContainer/Format.html @@ -0,0 +1,412 @@ + + + + Format Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Format

+
+
+ +
public enum Format
+ +
+
+

Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to +successfully read a particular container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + prePosix + +
    +
    +
    +
    +
    +
    +

    Pre POSIX format (aka “basic TAR format”).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case prePosix
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ustar + +
    +
    +
    +
    +
    +
    +

    “UStar” format introduced by POSIX IEEE P1003.1 standard.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ustar
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + gnu + +
    +
    +
    +
    +
    +
    +

    “UStar”-like format with GNU extensions (e.g. special container entries for long file and link names).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case gnu
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + pax + +
    +
    +
    +
    +
    +
    +

    “PAX” format introduced by POSIX.1-2001 standard, a set of extensions to “UStar” format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case pax
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/XZArchive.html b/Classes/XZArchive.html new file mode 100644 index 00000000..b8f1fcd8 --- /dev/null +++ b/Classes/XZArchive.html @@ -0,0 +1,418 @@ + + + + XZArchive Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XZArchive

+
+
+ +
public class XZArchive : Archive
+ +
+
+

Provides unarchive function for XZ archives.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchives XZ archive. Archives with multiple streams are supported, +but uncompressed data from each stream will be combined into single Data object.

    + +

    If an error happens during LZMA2 decompression, then LZMAError or LZMA2Error will be thrown.

    +
    +

    Throws

    +

    LZMAError, LZMA2Error or XZError depending on the type of the problem. +Particularly, if filters other than LZMA2 are used in archive, then XZError.wrongFilterID will be thrown, +but it may also indicate that either the archive is damaged or +it might not be compressed with XZ or LZMA(2) at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unarchive(archive data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived using XZ format.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unarchives XZ archive. Archives with multiple streams are supported, +and uncompressed data from each stream will be stored in a separate element in the array

    + +

    If data passed is not actually XZ archive, XZError will be thrown. +Particularly, if filters other than LZMA2 are used in archive, then XZError.wrongFilterID will be thrown.

    + +

    If an error happens during LZMA2 decompression, then LZMAError or LZMA2Error will be thrown.

    +
    +

    Throws

    +

    LZMAError, LZMA2Error or XZError depending on the type of the problem. +It may indicate that either the archive is damaged or it might not be compressed with XZ or LZMA(2) at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func splitUnarchive(archive data: Data) throws -> [Data]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived using XZ format.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of unarchived data from every stream in archive.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/ZipContainer.html b/Classes/ZipContainer.html new file mode 100644 index 00000000..77ba21ec --- /dev/null +++ b/Classes/ZipContainer.html @@ -0,0 +1,461 @@ + + + + ZipContainer Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipContainer

+
+
+ +
public class ZipContainer : Container
+ +
+
+

Provides functions for work with ZIP containers.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + customExtraFields + +
    +
    +
    +
    +
    +
    +

    Contains user-defined extra fields. When either ZipContainer.info(container:) or ZipContainer.open(container:) +function encounters extra field without built-in support, it uses this dictionary and tries to find a corresponding +user-defined extra field. If an approriate custom extra field is found and successfully processed, then the result +is stored in ZipEntryInfo.customExtraFields.

    + +

    To enable support of custom extra field one must add a new entry to this dictionary. The value of this entry must +be a user-defined type which conforms to ZipExtraField protocol. The key must be equal to the ID of user-defined +extra field and type’s id property.

    +
    +

    Warning

    + Modifying this dictionary while either info(container:) or open(container:) function is being +executed may cause undefined behavior. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var customExtraFields: [UInt16 : any ZipExtraField.Type]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    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 no +particular order is guaranteed.

    + +
    +

    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.

    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    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 no +particular order is guaranteed.

    + +
    +

    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.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/ZlibArchive.html b/Classes/ZlibArchive.html new file mode 100644 index 00000000..2b452d67 --- /dev/null +++ b/Classes/ZlibArchive.html @@ -0,0 +1,412 @@ + + + + ZlibArchive Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZlibArchive

+
+
+ +
public class ZlibArchive : Archive
+ +
+
+

Provides unarchive and archive functions for Zlib archives.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchives Zlib archive.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    DeflateError or ZlibError depending on the type of the problem. +It may indicate that either archive is damaged or it might not be archived with Zlib +or compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unarchive(archive data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with Zlib.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • +
    + + + + archive(data:) + +
    +
    +
    +
    +
    +
    +

    Archives data into Zlib archive. Data will be also compressed with Deflate algorithm. +It will also be specified in archive’s header that the compressor used the slowest Deflate algorithm.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func archive(data: Data) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data to compress and archive.

    +
    +
    +
    +
    +

    Return Value

    +

    Resulting archive’s data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Common Auxiliary Types.html b/Common Auxiliary Types.html new file mode 100644 index 00000000..98117738 --- /dev/null +++ b/Common Auxiliary Types.html @@ -0,0 +1,432 @@ + + + + Common Auxiliary Types Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Common Auxiliary Types

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ContainerEntryType + +
    +
    +
    +
    +
    +
    +

    Represents the type of a container entry.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ContainerEntryType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DosAttributes + +
    +
    +
    +
    +
    +
    +

    Represents file attributes in DOS format.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DosAttributes : OptionSet
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Permissions + +
    +
    +
    +
    +
    +
    +

    Represents file access permissions in UNIX format.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Permissions : OptionSet
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CompressionMethod + +
    +
    +
    +
    +
    +
    +

    Represents a (de)compression method.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FileSystemType + +
    +
    +
    +
    +
    +
    +

    Represents the type of the file system on which an archive or container was created. File system determines the meaning +of file attributes.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum FileSystemType
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Compression.html b/Compression.html new file mode 100644 index 00000000..e94e3ffd --- /dev/null +++ b/Compression.html @@ -0,0 +1,465 @@ + + + + Compression Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Compression

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Enums/BZip2Error.html b/Enums/BZip2Error.html new file mode 100644 index 00000000..b7c65114 --- /dev/null +++ b/Enums/BZip2Error.html @@ -0,0 +1,600 @@ + + + + BZip2Error Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BZip2Error

+
+
+ +
public enum BZip2Error : Error
+ +
+
+

Represents an error which happened during BZip2 decompression. +It may indicate that either data is damaged or it might not be compressed with BZip2 at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongMagic + +
    +
    +
    +
    +
    +
    +

    ‘Magic’ number is not 0x425a.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongMagic
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongVersion + +
    +
    +
    +
    +
    +
    +

    BZip version is not 2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongVersion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongBlockSize + +
    +
    +
    +
    +
    +
    +

    Unsupported block size (not from ‘0’ to ‘9’).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongBlockSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongBlockType + +
    +
    +
    +
    +
    +
    +

    Unsupported block type (is neither ‘pi’ nor ‘sqrt(pi)’).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongBlockType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + randomizedBlock + +
    +
    +
    +
    +
    +
    +

    Block is randomized.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case randomizedBlock
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongHuffmanGroups + +
    +
    +
    +
    +
    +
    +

    Wrong number of Huffman tables/groups (should be between 2 and 6).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHuffmanGroups
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSelector + +
    +
    +
    +
    +
    +
    +

    Selector is greater than the total number of Huffman tables/groups.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSelector
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Wrong length of Huffman code (should be between 0 and 20).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHuffmanCodeLength
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + symbolNotFound + +
    +
    +
    +
    +
    +
    +

    Symbol wasn’t found in Huffman tree.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case symbolNotFound
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of the uncompressed data does not match the value stored in the archive. +Associated value contains the data that were successfully decompressed up to the point where the mismatch was +detected.

    + +
      +
    • When using BZip2.decompress(data:): The associated value comes from a single BZip2 archive. If the mismatch +happens at the final checksum verification, this is usually the entire decompressed output.

    • +
    • When using BZip2.multiDecompress(data:): The input may contain several concatenated BZip2 archives. The error +is thrown for the current archive that fails the checksum. The associated value contains only the data decompressed +for that archive. Results from earlier archives are not included and are not returned once this error is thrown.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC(Data)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/CompressionMethod.html b/Enums/CompressionMethod.html new file mode 100644 index 00000000..37ac4082 --- /dev/null +++ b/Enums/CompressionMethod.html @@ -0,0 +1,469 @@ + + + + CompressionMethod Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CompressionMethod

+
+
+ +
public enum CompressionMethod
+ +
+
+

Represents a (de)compression method.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + bzip2 + +
    +
    +
    +
    +
    +
    +

    BZip2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case bzip2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + copy + +
    +
    +
    +
    +
    +
    +

    Copy (no compression).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case copy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deflate + +
    +
    +
    +
    +
    +
    +

    Deflate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deflate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lzma + +
    +
    +
    +
    +
    +
    +

    LZMA.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lzma
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lzma2 + +
    +
    +
    +
    +
    +
    +

    LZMA 2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lzma2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + other + +
    +
    +
    +
    +
    +
    +

    Other/unknown method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case other
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/ContainerEntryType.html b/Enums/ContainerEntryType.html new file mode 100644 index 00000000..abf986e8 --- /dev/null +++ b/Enums/ContainerEntryType.html @@ -0,0 +1,589 @@ + + + + ContainerEntryType Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ContainerEntryType

+
+
+ +
public enum ContainerEntryType
+ +
+
+

Represents the type of a container entry.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + blockSpecial + +
    +
    +
    +
    +
    +
    +

    Block special file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case blockSpecial
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + characterSpecial + +
    +
    +
    +
    +
    +
    +

    Character special file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case characterSpecial
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contiguous + +
    +
    +
    +
    +
    +
    +

    Contiguous file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case contiguous
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + directory + +
    +
    +
    +
    +
    +
    +

    Directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case directory
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fifo + +
    +
    +
    +
    +
    +
    +

    FIFO special file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fifo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hardLink + +
    +
    +
    +
    +
    +
    +

    Hard link.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case hardLink
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + regular + +
    +
    +
    +
    +
    +
    +

    Regular file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case regular
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + socket + +
    +
    +
    +
    +
    +
    +

    Socket.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case socket
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + symbolicLink + +
    +
    +
    +
    +
    +
    +

    Symbolic link.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case symbolicLink
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unknown + +
    +
    +
    +
    +
    +
    +

    Entry type is unknown.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknown
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/DataError.html b/Enums/DataError.html new file mode 100644 index 00000000..02f658c7 --- /dev/null +++ b/Enums/DataError.html @@ -0,0 +1,412 @@ + + + + DataError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DataError

+
+
+ +
public enum DataError : Error, Equatable
+ +
+
+

Represents an error which happened during processing input data.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + truncated + +
    +
    +
    +
    +
    +
    +

    Indicates that input data is likely truncated or incomplete.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case truncated
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + corrupted + +
    +
    +
    +
    +
    +
    +

    Indicates that input data is corrupted, e.g. does not conform to the format specifications or contains other +invalid values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case corrupted
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + checksumMismatch(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the computed checksum of the output data does not match the stored checksum. While usually the +associated value contains the output from all processed inputs up to and including the point when this error was +thrown, it is still recommended to check the documenation of a function to confirm this.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case checksumMismatch([Data])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsupportedFeature + +
    +
    +
    +
    +
    +
    +

    Indicates that input data was created using a feature that is not supported by the processing function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unsupportedFeature
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/DeflateError.html b/Enums/DeflateError.html new file mode 100644 index 00000000..3db48763 --- /dev/null +++ b/Enums/DeflateError.html @@ -0,0 +1,410 @@ + + + + DeflateError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DeflateError

+
+
+ +
public enum DeflateError : Error
+ +
+
+

Represents an error which happened during Deflate compression or decompression. +It may indicate that either the data is damaged or it might not be compressed with Deflate at all.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Uncompressed block’s length and nlength bytes isn’t consistent with each other.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongUncompressedBlockLengths
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongBlockType + +
    +
    +
    +
    +
    +
    +

    Unknown block type (not 0, 1 or 2).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongBlockType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSymbol + +
    +
    +
    +
    +
    +
    +

    Decoded symbol was found in Huffman tree but is unknown.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSymbol
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + symbolNotFound + +
    +
    +
    +
    +
    +
    +

    Symbol wasn’t found in Huffman tree.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case symbolNotFound
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/FileSystemType.html b/Enums/FileSystemType.html new file mode 100644 index 00000000..0e201d68 --- /dev/null +++ b/Enums/FileSystemType.html @@ -0,0 +1,445 @@ + + + + FileSystemType Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FileSystemType

+
+
+ +
public enum FileSystemType
+ +
+
+

Represents the type of the file system on which an archive or container was created. File system determines the meaning +of file attributes.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + fat + +
    +
    +
    +
    +
    +
    +

    FAT filesystem.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fat
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + macintosh + +
    +
    +
    +
    +
    +
    +

    Filesystem of older Macintosh systems.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case macintosh
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ntfs + +
    +
    +
    +
    +
    +
    +

    NTFS.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ntfs
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + other + +
    +
    +
    +
    +
    +
    +

    Other/unknown file system.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case other
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unix + +
    +
    +
    +
    +
    +
    +

    One of many file systems of UNIX-like OS.

    +
    +

    Note

    + Modern macOS systems also fall into this category. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unix
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/GzipError.html b/Enums/GzipError.html new file mode 100644 index 00000000..9987baa1 --- /dev/null +++ b/Enums/GzipError.html @@ -0,0 +1,509 @@ + + + + GzipError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GzipError

+
+
+ +
public enum GzipError : Error
+ +
+
+

Represents an error which happened while processing a GZip archive. +It may indicate that either archive is damaged or it might not be GZip archive at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongMagic + +
    +
    +
    +
    +
    +
    +

    First two bytes (‘magic’ number) of archive isn’t 31 and 139.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongMagic
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Compression method used in archive is different from Deflate, which is the only supported one.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFlags + +
    +
    +
    +
    +
    +
    +

    One of the reserved fields in archive has an unexpected value, which can also mean (apart from damaged archive), +that archive uses a newer version of GZip format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFlags
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongHeaderCRC + +
    +
    +
    +
    +
    +
    +

    Computed CRC of archive’s header doesn’t match the value stored in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHeaderCRC
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of uncompressed data doesn’t match the value stored in the archive. +Associated value of the error contains GzipArchive.Members for all already decompressed data:

    + +
      +
    • if unarchive function was called then associated array will have only one element, +since this function always processes only first member of archive.
    • +
    • if multiUnarchive function was called then associated array will have an element +for each already decompressed member, including the one with mismatching checksum.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC([GzipArchive.Member])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongISize + +
    +
    +
    +
    +
    +
    +

    Computed ‘isize’ didn’t match the value stored in the archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongISize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + cannotEncodeISOLatin1 + +
    +
    +
    +
    +
    +
    +

    Either specified file name or comment cannot be encoded using ISO Latin-1 encoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cannotEncodeISOLatin1
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/LZ4.html b/Enums/LZ4.html new file mode 100644 index 00000000..05fbff16 --- /dev/null +++ b/Enums/LZ4.html @@ -0,0 +1,710 @@ + + + + LZ4 Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZ4

+
+
+ +
public enum LZ4 : DecompressionAlgorithm
+
extension LZ4: CompressionAlgorithm
+ +
+
+

Provides functions for compression and decompression for LZ4 algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using LZ4 algortihm.

    + +

    Use LZ4.decompress(data:dictionary:dictionaryID:) instead, if the data was compressed with an external dictionary. +Otherwise, the decompression will result in an error or incorrect output.

    +
    +

    Throws

    +

    DataError.corrupted or DataError.truncated if the data is corrupted or truncated. +DataError.checksumMismatch is thrown with uncompressed data as its associated value if the computed checksum of +the uncompressed data does not match the stored checksum. DataError.unsupportedFeature is thrown when the value +of a field inside the frame, such as uncompressed data size, is incompatible with the maximum integer size of the +current platform.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with LZ4. If data represents several concatenated LZ4 frames, only the first +frame will be processed; use LZ4.multiDecompress(data:dictionary:dictionaryID:) instead to decompress all the +frames.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses data using LZ4 algortihm and provided external dictionary.

    +
    +

    Throws

    +

    DataError.corrupted or DataError.truncated if the data is corrupted or truncated. +DataError.checksumMismatch is thrown with uncompressed data as its associated value if the computed checksum of +the uncompressed data does not match the stored checksum. DataError.unsupportedFeature is thrown when the value +of a field inside the frame, such as uncompressed data size, is incompatible with the maximum integer size of the +current platform.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data, dictionary: Data?, dictionaryID: UInt32? = nil) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data compressed with LZ4. If data represents several concatenated LZ4 frames, only the first +frame will be processed; use LZ4.multiDecompress(data:dictionary:dictionaryID:) instead to decompress all the +frames.

    +
    +
    + + dictionary + + +
    +

    External dictionary which will be used during decompression. Providing incorrect dictionary +(not the one that was used for compression), no dictionary at all (if one was used for compression), or providing a +dictionary when no dictionary was used for compression will result in an error or incorrect output.

    +
    +
    + + dictionaryID + + +
    +

    Optional dictionary ID, which must match the one stored in the frame. If no dictionary +ID is present in the frame, then this argument is ignored.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses data, which may represent several concatenated LZ4 frames, using LZ4 algortihm and provided external +dictionary.

    +
    +

    Throws

    +

    DataError.corrupted or DataError.truncated if the data is corrupted or truncated. +DataError.checksumMismatch is thrown if the computed checksum of the uncompressed data does not match the stored +checksum. The associated value in this case contains uncompressed data from all the frames up to and including the +one that caused this error. DataError.unsupportedFeature is thrown when the value of a field inside a frame, such +as uncompressed data size, is incompatible with the maximum integer size of the current platform.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func multiDecompress(data: Data, dictionary: Data? = nil, dictionaryID: UInt32? = nil) throws -> [Data]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data compressed with LZ4. If data represents several concatenated LZ4 frames, all of them will +be processed.

    +
    +
    + + dictionary + + +
    +

    External dictionary which will be used during decompression of all encountered frames. +Providing incorrect dictionary (not the one that was used for compression), no dictionary at all (if one was used +for compression), or providing a dictionary when no dictionary was used for compression will result in an error or +incorrect output.

    +
    +
    + + dictionaryID + + +
    +

    Optional dictionary ID, which must match the one stored in all frames. If no dictionary +ID is present in a frame, then this argument is ignored for that frame.

    +
    +
    +
    +
    +

    Return Value

    +

    An array with uncompressed data from each processed non-skippable LZ4 frame as its elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compresses data using LZ4 algortihm with default format and algorithm options.

    + +

    The default options include: independent blocks, do not save checksums for compressed blocks, save the checksum of +the uncompressed data, do not save the size of the uncompressed data, use 4 MB block size, no dictionary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data) -> Data
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Compresses data using LZ4 algortihm.

    + +

    This function allows to customize format and alogrithm options or use an external dictionary to compress the data.

    +
    +

    Precondition

    +

    blockSize must be greater than zero and less than or equal to 4194304 (4 MB).

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data, independentBlocks: Bool, blockChecksums: Bool,
    +                             contentChecksum: Bool, contentSize: Bool, blockSize: Int = 4 * 1024 * 1024,
    +                             dictionary: Data? = nil, dictionaryID: UInt32? = nil) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    + + independentBlocks + + +
    +

    True, if compressed blocks should be independent of each other. Setting this to +false may improve compression ratio at the cost of decompression speed.

    +
    +
    + + blockChecksums + + +
    +

    True, if the checksums of the compressed blocks should be stored in the output.

    +
    +
    + + contentChecksum + + +
    +

    True, if the checksum of the uncompressed data should be stored in the output.

    +
    +
    + + contentSize + + +
    +

    True, if the size of the uncompressed data should be stored in the output.

    +
    +
    + + blockSize + + +
    +

    Size of uncompressed blocks in bytes. The default and maximum value is 4194304 (4 MB).

    +
    +
    + + dictionary + + +
    +

    External dictionary which will be used during compression. The same dictionary then must +be used for successful decompression.

    +
    +
    + + dictionaryID + + +
    +

    Optional dictionary ID which will be stored in the output. The same dictionary ID then +is likely to be required for successful decompression.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/LZMA2Error.html b/Enums/LZMA2Error.html new file mode 100644 index 00000000..028d6869 --- /dev/null +++ b/Enums/LZMA2Error.html @@ -0,0 +1,411 @@ + + + + LZMA2Error Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMA2Error

+
+
+ +
public enum LZMA2Error : Error
+ +
+
+

Represents an error which happened during LZMA2 decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA2 at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongDictionarySize + +
    +
    +
    +
    +
    +
    +

    Dictionary size is too big, or has reserved bits set, or is in incorrect format in general.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongDictionarySize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongControlByte + +
    +
    +
    +
    +
    +
    +

    Unknown conrol byte value of LZMA2 packet.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongControlByte
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongReset + +
    +
    +
    +
    +
    +
    +

    Unknown reset instruction encountered in LZMA2 packet.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongReset
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSizes + +
    +
    +
    +
    +
    +
    +

    Either size of decompressed data isn’t equal to the one specified in LZMA2 packet or +amount of compressed data read is different from the one stored in LZMA2 packet.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSizes
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/LZMAError.html b/Enums/LZMAError.html new file mode 100644 index 00000000..3aac5c6d --- /dev/null +++ b/Enums/LZMAError.html @@ -0,0 +1,500 @@ + + + + LZMAError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMAError

+
+
+ +
public enum LZMAError : Error
+ +
+
+

Represents an error which happened during LZMA decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongProperties + +
    +
    +
    +
    +
    +
    +

    Properties’ byte is greater than 225.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongProperties
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rangeDecoderInitError + +
    +
    +
    +
    +
    +
    +

    Unable to initialize RanderDecorer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rangeDecoderInitError
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Size of uncompressed data hit specified limit in the middle of decoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case exceededUncompressedSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + windowIsEmpty + +
    +
    +
    +
    +
    +
    +

    Unable to perfrom repeat-distance decoding because there is nothing to repeat.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case windowIsEmpty
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    End of stream marker is reached, but range decoder is in incorrect state.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rangeDecoderFinishError
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + repeatWillExceed + +
    +
    +
    +
    +
    +
    +

    The number of bytes to repeat is greater than the amount bytes that is left to decode.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case repeatWillExceed
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notEnoughToRepeat + +
    +
    +
    +
    +
    +
    +

    The amount of already decoded bytes is smaller than repeat length.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notEnoughToRepeat
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/SevenZipError.html b/Enums/SevenZipError.html new file mode 100644 index 00000000..6a3bc34f --- /dev/null +++ b/Enums/SevenZipError.html @@ -0,0 +1,620 @@ + + + + SevenZipError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipError

+
+
+ +
public enum SevenZipError : Error
+ +
+
+

Represents an error which happened while processing a 7-Zip container. +It may indicate that either container is damaged or it might not be 7-Zip container at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongSignature + +
    +
    +
    +
    +
    +
    +

    Wrong container’s signature.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSignature
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFormatVersion + +
    +
    +
    +
    +
    +
    +

    Unsupported version of container’s format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFormatVersion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC + +
    +
    +
    +
    +
    +
    +

    CRC either of one of the files from the container or one of the container’s strucutures is incorrect.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSize + +
    +
    +
    +
    +
    +
    +

    Size either of one of the files from the container or one of the container’s strucutures is incorrect.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + startPosNotSupported + +
    +
    +
    +
    +
    +
    +

    Files have StartPos property. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case startPosNotSupported
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + externalNotSupported + +
    +
    +
    +
    +
    +
    +

    External feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case externalNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Coders with multiple in and/or out streams aren’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiStreamNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Additional streams feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case additionalStreamsNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry is compressed using unsupported compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case compressionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry or container’s header is encrypted. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case encryptionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unknown/incorrect internal 7-Zip structure was encountered or a required internal structure is missing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalStructureError
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/TarCreateError.html b/Enums/TarCreateError.html new file mode 100644 index 00000000..12738204 --- /dev/null +++ b/Enums/TarCreateError.html @@ -0,0 +1,329 @@ + + + + TarCreateError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarCreateError

+
+
+ +
public enum TarCreateError : Error
+ +
+
+

Represents an error which happened during the creation of a new TAR container.

+
+

Note

+ This error type is never used and will be removed in the next major update. + +
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + utf8NonEncodable + +
    +
    +
    +
    +
    +
    +

    One of the TarEntryInfo‘s string properties (such as name) cannot be encoded with UTF-8 encoding.

    +
    +

    Note

    + This error is never thrown and will be removed in the next major update. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case utf8NonEncodable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/TarError.html b/Enums/TarError.html new file mode 100644 index 00000000..e93462a7 --- /dev/null +++ b/Enums/TarError.html @@ -0,0 +1,410 @@ + + + + TarError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarError

+
+
+ +
public enum TarError : Error
+ +
+
+

Represents an error which happened while processing a TAR container. +It may indicate that either container is damaged or it might not be TAR container at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + tooSmallFileIsPassed + +
    +
    +
    +
    +
    +
    +

    Data is unexpectedly truncated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tooSmallFileIsPassed
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongField + +
    +
    +
    +
    +
    +
    +

    Failed to process a required TAR header’s field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongField
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongHeaderChecksum + +
    +
    +
    +
    +
    +
    +

    Computed checksum of a header doesn’t match the value stored in container.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHeaderChecksum
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongPaxHeaderEntry + +
    +
    +
    +
    +
    +
    +

    Entry from PAX extended header is in incorrect format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongPaxHeaderEntry
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/XZError.html b/Enums/XZError.html new file mode 100644 index 00000000..7f22aae8 --- /dev/null +++ b/Enums/XZError.html @@ -0,0 +1,575 @@ + + + + XZError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XZError

+
+
+ +
public enum XZError : Error
+ +
+
+

Represents an error which happened while unarchiving an XZ archive. +It may indicate that either archive is damaged or it might not be XZ archive at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongMagic + +
    +
    +
    +
    +
    +
    +

    Either ‘magic’ number in header or footer isn’t equal to a predefined value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongMagic
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongField + +
    +
    +
    +
    +
    +
    +

    One of the special fields in archive has an incorrect value, +which can mean both damaged archive or that archive uses a newer version of XZ format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongField
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongInfoCRC + +
    +
    +
    +
    +
    +
    +

    Checksum of one of the fields of archive doesn’t match the value stored in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongInfoCRC
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFilterID + +
    +
    +
    +
    +
    +
    +

    Filter used in archive is unsupported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFilterID
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + checkTypeSHA256 + +
    +
    +
    +
    +
    +
    +

    Archive uses SHA-256 checksum which is unsupported.

    +
    +

    Note

    + This error is never thrown and will be removed in the next major update. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case checkTypeSHA256
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongDataSize + +
    +
    +
    +
    +
    +
    +

    Either size of decompressed data isn’t equal to the one specified in archive or +amount of compressed data read is different from the one stored in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongDataSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCheck(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of uncompressed data doesn’t match the value stored in the archive. +Associated value of the error contains already decompressed data:

    + +
      +
    • if unarchive function was called then associated array will have only one element +with combined data for all already decompressed streams, including the one with mismatching checksum.
    • +
    • if splitUnarchive function was called then associated array will have an element +for each already decompressed stream, including the one with mismatching checksum.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCheck([Data])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongPadding + +
    +
    +
    +
    +
    +
    +

    Padding (null-bytes appended to an archive’s structure) is incorrect.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongPadding
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + multiByteIntegerError + +
    +
    +
    +
    +
    +
    +

    Either null byte encountered or exceeded maximum amount bytes while reading multi byte number.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiByteIntegerError
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/ZipError.html b/Enums/ZipError.html new file mode 100644 index 00000000..de573f27 --- /dev/null +++ b/Enums/ZipError.html @@ -0,0 +1,621 @@ + + + + ZipError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipError

+
+
+ +
public enum ZipError : Error
+ +
+
+

Represents an error which happened while processing a ZIP container. +It may indicate that either container is damaged or it might not be ZIP container at all.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    End of Central Directoty record wasn’t found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notFoundCentralDirectoryEnd
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSignature + +
    +
    +
    +
    +
    +
    +

    Wrong signature of one of container’s structures.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSignature
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSize + +
    +
    +
    +
    +
    +
    +

    Wrong either compressed or uncompressed size of a container’s entry.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongVersion + +
    +
    +
    +
    +
    +
    +

    Version needed to process container is unsupported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongVersion
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Container is either spanned or consists of several volumes. These features aren’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiVolumesNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry or record is encrypted. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case encryptionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + patchingNotSupported + +
    +
    +
    +
    +
    +
    +

    Entry contains patched data. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case patchingNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry is compressed using unsupported compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case compressionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongLocalHeader + +
    +
    +
    +
    +
    +
    +

    Local header of an entry is inconsistent with Central Directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongLocalHeader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of entry’s data doesn’t match the value stored in the archive. +Associated value of the error contains ZipEntry objects for all already processed entries:

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC([ZipEntry])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongTextField + +
    +
    +
    +
    +
    +
    +

    Either entry’s comment or file name cannot be processed using UTF-8 encoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongTextField
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/ZipExtraFieldLocation.html b/Enums/ZipExtraFieldLocation.html new file mode 100644 index 00000000..14161e9b --- /dev/null +++ b/Enums/ZipExtraFieldLocation.html @@ -0,0 +1,349 @@ + + + + ZipExtraFieldLocation Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipExtraFieldLocation

+
+
+ +
public enum ZipExtraFieldLocation
+ +
+
+

Location of ZIP extra field inside a container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + centralDirectory + +
    +
    +
    +
    +
    +
    +

    ZIP extra field is located in container’s Central Directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case centralDirectory
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localHeader + +
    +
    +
    +
    +
    +
    +

    ZIP extra field is located in one of container’s Local Headers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case localHeader
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/ZlibError.html b/Enums/ZlibError.html new file mode 100644 index 00000000..6dae2917 --- /dev/null +++ b/Enums/ZlibError.html @@ -0,0 +1,441 @@ + + + + ZlibError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZlibError

+
+
+ +
public enum ZlibError : Error
+ +
+
+

Represents an error which happened while processing a Zlib archive. +It may indicate that either archive is damaged or it might not be Zlib archive at all.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Compression method used in archive is different from Deflate, which is the only supported one.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCompressionInfo + +
    +
    +
    +
    +
    +
    +

    Compression info has value incompatible with Deflate compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFcheck + +
    +
    +
    +
    +
    +
    +

    First two bytes of archive’s flags are inconsistent with each other.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFcheck
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCompressionLevel + +
    +
    +
    +
    +
    +
    +

    Compression level has value, which is different from the supported ones.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionLevel
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongAdler32(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of uncompressed data doesn’t match the value stored in archive. +Associated value of the error contains already decompressed data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongAdler32(Data)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Errors.html b/Errors.html new file mode 100644 index 00000000..b8fa3bc4 --- /dev/null +++ b/Errors.html @@ -0,0 +1,663 @@ + + + + Errors Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Errors

+ +
+
+ +
+
+
+
    +
  • +
    + + + + BZip2Error + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during BZip2 decompression. +It may indicate that either data is damaged or it might not be compressed with BZip2 at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum BZip2Error : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DataError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during processing input data.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DataError : Error, Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DeflateError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during Deflate compression or decompression. +It may indicate that either the data is damaged or it might not be compressed with Deflate at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DeflateError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + GzipError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a GZip archive. +It may indicate that either archive is damaged or it might not be GZip archive at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum GzipError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LZMAError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during LZMA decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum LZMAError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LZMA2Error + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during LZMA2 decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA2 at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum LZMA2Error : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SevenZipError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a 7-Zip container. +It may indicate that either container is damaged or it might not be 7-Zip container at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum SevenZipError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarCreateError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during the creation of a new TAR container.

    +
    +

    Note

    + This error type is never used and will be removed in the next major update. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TarCreateError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a TAR container. +It may indicate that either container is damaged or it might not be TAR container at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TarError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + XZError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while unarchiving an XZ archive. +It may indicate that either archive is damaged or it might not be XZ archive at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum XZError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZipError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a ZIP container. +It may indicate that either container is damaged or it might not be ZIP container at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ZipError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZlibError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a Zlib archive. +It may indicate that either archive is damaged or it might not be Zlib archive at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ZlibError : Error
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols.html b/Protocols.html new file mode 100644 index 00000000..daa1c27b --- /dev/null +++ b/Protocols.html @@ -0,0 +1,462 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Protocols

+ +
+
+ +
+
+
+
    +
  • +
    + + + + Archive + +
    +
    +
    +
    +
    +
    +

    A type that represents an archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Container + +
    +
    +
    +
    +
    +
    +

    A type that represents a container with files, directories and/or other data.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Container
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ContainerEntry + +
    +
    +
    +
    +
    +
    +

    A type that represents an entry from the container with its data and information.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ContainerEntry
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ContainerEntryInfo + +
    +
    +
    +
    +
    +
    +

    A type that provides access to information about an entry from the container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ContainerEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CompressionAlgorithm + +
    +
    +
    +
    +
    +
    +

    A type that provides an implementation of a particular compression algorithm.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CompressionAlgorithm
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A type that provides an implementation of a particular decompression algorithm.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DecompressionAlgorithm
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/Archive.html b/Protocols/Archive.html new file mode 100644 index 00000000..73354815 --- /dev/null +++ b/Protocols/Archive.html @@ -0,0 +1,319 @@ + + + + Archive Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Archive

+
+
+ +
public protocol Archive
+ +
+
+

A type that represents an archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchive data from the archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func unarchive(archive: Data) throws -> Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/CompressionAlgorithm.html b/Protocols/CompressionAlgorithm.html new file mode 100644 index 00000000..67bb1580 --- /dev/null +++ b/Protocols/CompressionAlgorithm.html @@ -0,0 +1,319 @@ + + + + CompressionAlgorithm Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CompressionAlgorithm

+
+
+ +
public protocol CompressionAlgorithm
+ +
+
+

A type that provides an implementation of a particular compression algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compress data with particular algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func compress(data: Data) throws -> Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/Container.html b/Protocols/Container.html new file mode 100644 index 00000000..ad970b30 --- /dev/null +++ b/Protocols/Container.html @@ -0,0 +1,379 @@ + + + + Container Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Container

+
+
+ +
public protocol Container
+ +
+
+

A type that represents a container with files, directories and/or other data.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Entry + +
    +
    +
    +
    +
    +
    +

    A type that represents an entry from this container.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Entry : ContainerEntry
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    Retrieve all container entries with their data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func open(container: Data) throws -> [Entry]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    Retrieve information about all container entries (without their data).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func info(container: Data) throws -> [Entry.Info]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/ContainerEntry.html b/Protocols/ContainerEntry.html new file mode 100644 index 00000000..5303c7e9 --- /dev/null +++ b/Protocols/ContainerEntry.html @@ -0,0 +1,384 @@ + + + + ContainerEntry Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ContainerEntry

+
+
+ +
public protocol ContainerEntry
+ +
+
+

A type that represents an entry from the container with its data and information.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Info + +
    +
    +
    +
    +
    +
    +

    A type that provides information about an entry.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Info : ContainerEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + info + +
    +
    +
    +
    +
    +
    +

    Provides access to information about the entry.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var info: Info { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    +

    Entry’s data (nil if entry is a directory or data isn’t available).

    +
    +

    Note

    + It is assumed that the compression provided by the container is yet to be applied to data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var data: Data? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/ContainerEntryInfo.html b/Protocols/ContainerEntryInfo.html new file mode 100644 index 00000000..4f2ecce2 --- /dev/null +++ b/Protocols/ContainerEntryInfo.html @@ -0,0 +1,499 @@ + + + + ContainerEntryInfo Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ContainerEntryInfo

+
+
+ +
public protocol ContainerEntryInfo
+ +
+
+

A type that provides access to information about an entry from the container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Entry’s name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    +

    Entry’s type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var type: ContainerEntryType { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    +

    Entry’s data size (can be nil if either data or size aren’t available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var size: Int? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last access time (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var accessTime: Date? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + creationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s creation time (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var creationTime: Date? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last modification time (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var modificationTime: Date? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permissions + +
    +
    +
    +
    +
    +
    +

    Entry’s permissions in POSIX format (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var permissions: Permissions? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/DecompressionAlgorithm.html b/Protocols/DecompressionAlgorithm.html new file mode 100644 index 00000000..bb4fc4ae --- /dev/null +++ b/Protocols/DecompressionAlgorithm.html @@ -0,0 +1,319 @@ + + + + DecompressionAlgorithm Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DecompressionAlgorithm

+
+
+ +
public protocol DecompressionAlgorithm
+ +
+
+

A type that provides an implementation of a particular decompression algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompress data compressed with particular algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func decompress(data: Data) throws -> Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/ZipExtraField.html b/Protocols/ZipExtraField.html new file mode 100644 index 00000000..7a60d064 --- /dev/null +++ b/Protocols/ZipExtraField.html @@ -0,0 +1,463 @@ + + + + ZipExtraField Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

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 + +
    +
    +
    +
    +
    +
    +

    Location of extra field. Must be equal to the value of location argument of init?(_:_:location:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var location: ZipExtraFieldLocation { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    +

    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 }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:_:location:) + +
    +
    +
    +
    +
    +
    +

    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 }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/DosAttributes.html b/Structs/DosAttributes.html new file mode 100644 index 00000000..61635df8 --- /dev/null +++ b/Structs/DosAttributes.html @@ -0,0 +1,529 @@ + + + + DosAttributes Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DosAttributes

+
+
+ +
public struct DosAttributes : OptionSet
+ +
+
+

Represents file attributes in DOS format.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    +

    Raw bit flags value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: UInt32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes attributes with bit flags.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: UInt32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + archive + +
    +
    +
    +
    +
    +
    +

    File is archive or archived.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let archive: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + directory + +
    +
    +
    +
    +
    +
    +

    File is a directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let directory: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + volume + +
    +
    +
    +
    +
    +
    +

    File is a volume.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let volume: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + system + +
    +
    +
    +
    +
    +
    +

    File is a system file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let system: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hidden + +
    +
    +
    +
    +
    +
    +

    File is hidden.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let hidden: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readOnly + +
    +
    +
    +
    +
    +
    +

    File is read-only.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readOnly: DosAttributes
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/GzipHeader.html b/Structs/GzipHeader.html new file mode 100644 index 00000000..ee792706 --- /dev/null +++ b/Structs/GzipHeader.html @@ -0,0 +1,592 @@ + + + + GzipHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GzipHeader

+
+
+ +
public struct GzipHeader
+ +
+
+

Represents the header of a GZip archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Compression method of archive. Always .deflate for GZip archives.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    The most recent modification time of the original file. If corresponding archive’s field is set to 0, which means +that no time was specified, then this property is nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modificationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + osType + +
    +
    +
    +
    +
    +
    +

    Type of file system on which archivation took place.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var osType: FileSystemType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fileName + +
    +
    +
    +
    +
    +
    +

    Name of the original file. If archive doesn’t contain file’s name, then nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fileName: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + comment + +
    +
    +
    +
    +
    +
    +

    Comment stored in archive. If archive doesn’t contain any comment, then nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var comment: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isTextFile + +
    +
    +
    +
    +
    +
    +

    True, if file is likely to be text file or ASCII-file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isTextFile: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + extraFields + +
    +
    +
    +
    +
    +
    +

    Extra fields present in the header.

    +
    +

    Note

    + This feature of the GZip format is extremely rarely used, so in vast majority of cases this property +contains an empty array. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var extraFields: [ExtraField]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(archive:) + +
    +
    +
    +
    +
    +
    +

    Initializes the structure with the values from the first ‘member’ of GZip archive.

    +
    +

    Throws

    +

    GzipError. It may indicate that either archive is damaged or +it might not be archived with GZip at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(archive data: Data) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with GZip.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + ExtraField + +
    +
    +
    +
    +
    +
    +

    Represents an extra field in the header of a GZip archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ExtraField
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/GzipHeader/ExtraField.html b/Structs/GzipHeader/ExtraField.html new file mode 100644 index 00000000..7f63895f --- /dev/null +++ b/Structs/GzipHeader/ExtraField.html @@ -0,0 +1,411 @@ + + + + ExtraField Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ExtraField

+
+
+ +
public struct ExtraField
+ +
+
+

Represents an extra field in the header of a GZip archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + si1 + +
    +
    +
    +
    +
    +
    +

    First byte of the extra field (subfield) ID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let si1: UInt8
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + si2 + +
    +
    +
    +
    +
    +
    +

    Second byte of the extra field (subfield) ID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let si2: UInt8
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + bytes + +
    +
    +
    +
    +
    +
    +

    Binary content of the extra field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bytes: [UInt8]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an extra field with the specified extra field (subfield) ID bytes and its binary content.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ si1: UInt8, _ si2: UInt8, _ bytes: [UInt8])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/LZMAProperties.html b/Structs/LZMAProperties.html new file mode 100644 index 00000000..c5d9cf74 --- /dev/null +++ b/Structs/LZMAProperties.html @@ -0,0 +1,480 @@ + + + + LZMAProperties Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMAProperties

+
+
+ +
public struct LZMAProperties
+ +
+
+

Properties of LZMA. This API is intended to be used by advanced users.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + lc + +
    +
    +
    +
    +
    +
    +

    Number of bits used for the literal encoding context. Default value is 3.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lc: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lp + +
    +
    +
    +
    +
    +
    +

    Number of bits to include in “literal position state”. Default value is 0.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lp: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + pb + +
    +
    +
    +
    +
    +
    +

    Number of bits to include in “position state”. Default value is 2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var pb: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dictionarySize + +
    +
    +
    +
    +
    +
    +

    Size of the dictionary. Default value is 1 << 24.

    +
    +

    Note

    + Dictionary size cannot be less than 4096. In case of attempt to set it to the value less than 4096 it will +be automatically set to 4096 instead. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var dictionarySize: Int { get set }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes LZMA properties with values of lc, lp, pb, and dictionary size.

    +
    +

    Note

    + It is not tested if values of lc, lp, and pb are valid. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(lc: Int, lp: Int, pb: Int, dictionarySize: Int)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes LZMA properties with default values of lc, lp, pb, and dictionary size.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Permissions.html b/Structs/Permissions.html new file mode 100644 index 00000000..4e4eee05 --- /dev/null +++ b/Structs/Permissions.html @@ -0,0 +1,709 @@ + + + + Permissions Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Permissions

+
+
+ +
public struct Permissions : OptionSet
+ +
+
+

Represents file access permissions in UNIX format.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    +

    Raw bit flags value (in decimal).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: UInt32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes permissions with bit flags in decimal.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: UInt32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setuid + +
    +
    +
    +
    +
    +
    +

    Set UID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let setuid: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setgid + +
    +
    +
    +
    +
    +
    +

    Set GID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let setgid: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sticky + +
    +
    +
    +
    +
    +
    +

    Sticky bit.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let sticky: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readOwner + +
    +
    +
    +
    +
    +
    +

    Owner can read.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readOwner: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + writeOwner + +
    +
    +
    +
    +
    +
    +

    Owner can write.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let writeOwner: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + executeOwner + +
    +
    +
    +
    +
    +
    +

    Owner can execute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let executeOwner: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readGroup + +
    +
    +
    +
    +
    +
    +

    Group can read.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readGroup: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + writeGroup + +
    +
    +
    +
    +
    +
    +

    Group can write.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let writeGroup: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + executeGroup + +
    +
    +
    +
    +
    +
    +

    Group can execute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let executeGroup: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readOther + +
    +
    +
    +
    +
    +
    +

    Others can read.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readOther: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + writeOther + +
    +
    +
    +
    +
    +
    +

    Others can write.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let writeOther: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + executeOther + +
    +
    +
    +
    +
    +
    +

    Others can execute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let executeOther: Permissions
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/SevenZipEntry.html b/Structs/SevenZipEntry.html new file mode 100644 index 00000000..d35f5f9a --- /dev/null +++ b/Structs/SevenZipEntry.html @@ -0,0 +1,347 @@ + + + + SevenZipEntry Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipEntry

+
+
+ +
public struct SevenZipEntry : ContainerEntry
+ +
+
+

Represents an entry from the 7-Zip container.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Structs/SevenZipEntryInfo.html b/Structs/SevenZipEntryInfo.html new file mode 100644 index 00000000..7d729356 --- /dev/null +++ b/Structs/SevenZipEntryInfo.html @@ -0,0 +1,696 @@ + + + + SevenZipEntryInfo Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipEntryInfo

+
+
+ +
public struct SevenZipEntryInfo : ContainerEntryInfo
+ +
+
+

Provides access to information about an entry from the 7-Zip container.

+ + +
+
+ +
+
+
+
+ + +
+ +

ContainerEntryInfo +

+
+
+ +
+
+
+ + +
+ +

7-Zip specific +

+
+
+
    +
  • +
    + + + + winAttributes + +
    +
    +
    +
    +
    +
    +

    Entry’s “win attributes”. 7-Zip internal property. +May be useful when origin file system’s attributes weren’t POSIX compatible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let winAttributes: UInt32?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dosAttributes + +
    +
    +
    +
    +
    +
    +

    Entry’s attributes in DOS format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let dosAttributes: DosAttributes?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasStream + +
    +
    +
    +
    +
    +
    +

    True, if entry has a stream (data) inside the container. 7-Zip internal propety.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let hasStream: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    True, if entry is an empty file. 7-Zip internal property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isEmpty: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isAnti + +
    +
    +
    +
    +
    +
    +

    True, if entry is an anti-file. Used in differential backups to indicate that file should be deleted. +7-Zip internal property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isAnti: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + crc + +
    +
    +
    +
    +
    +
    +

    CRC32 of entry’s data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let crc: UInt32?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/TarEntry.html b/Structs/TarEntry.html new file mode 100644 index 00000000..edb7efea --- /dev/null +++ b/Structs/TarEntry.html @@ -0,0 +1,416 @@ + + + + TarEntry Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarEntry

+
+
+ +
public struct TarEntry : ContainerEntry
+ +
+
+

Represents an entry from the TAR container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + info + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var info: TarEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    +

    Entry’s data (nil if entry is a directory or data isn’t available).

    +
    +

    Note

    + Accessing setter of this property causes info.size to be updated as well so it remains equal to +data.count. If data is set to be nil then info.size is set to zero. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var data: Data? { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(info:data:) + +
    +
    +
    +
    +
    +
    +

    Initializes the entry with its info and data. The stored info.size will also be updated to be equal to +data.count. If data is nil then info.size will be set to zero.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(info: TarEntryInfo, data: Data?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + info + + +
    +

    Information about entry.

    +
    +
    + + data + + +
    +

    Entry’s data; nil if entry is a directory or data isn’t available.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/TarEntryInfo.html b/Structs/TarEntryInfo.html new file mode 100644 index 00000000..4b1afacf --- /dev/null +++ b/Structs/TarEntryInfo.html @@ -0,0 +1,1054 @@ + + + + TarEntryInfo Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarEntryInfo

+
+
+ +
public struct TarEntryInfo : ContainerEntryInfo
+ +
+
+

Provides access to information about an entry from the TAR container.

+ + +
+
+ +
+
+
+
+ + +
+ +

ContainerEntryInfo +

+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Entry’s name.

    + +

    Depending on the particular format of the container, different container’s structures are used +to set this property, in the following preference order:

    + +
      +
    1. Local PAX extended header “path” property.
    2. +
    3. Global PAX extended header “path” property.
    4. +
    5. GNU format type “L” (LongName) entry.
    6. +
    7. Default TAR header.
    8. +
    +
    +

    Note

    + When a new TAR container is created, if name cannot be encoded with ASCII or its ASCII byte-representation +is longer than 100 bytes then a PAX extended header will be created to represent this value correctly, unless other +format is forced. + +
    +

    Note

    + When creating new TAR container, name is always encoded with UTF-8 in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    +

    Entry’s data size.

    +
    +

    Note

    + This property cannot be directly modified. Instead it is updated automatically to be equal to its parent’s +entry.data.count. + +
    +

    Note

    + When a new TAR container is created, if size is bigger than 8589934591 then a PAX extended header will be +created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be +used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var size: Int? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: ContainerEntryType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last access time (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When a new TAR container is created, if accessTime is not nil then a PAX extended header will be created +to store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var accessTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + creationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s creation time (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When a new TAR container is created, if creationTime is not nil then a PAX extended header will be +created to store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var creationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last modification time.

    +
    +

    Note

    + When a new TAR container is created, if modificationTime is bigger than 8589934591 then a PAX extended +header will be created to represent this value correctly, unless other format is forced. In addition, base-256 +encoding will be used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modificationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permissions + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var permissions: Permissions?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

TAR specific +

+
+
+
    +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Entry’s compression method. Always .copy for the entries of TAR containers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerID + +
    +
    +
    +
    +
    +
    +

    ID of entry’s owner.

    +
    +

    Note

    + When a new TAR container is created, if ownerID is bigger than 2097151 then a PAX extended header will be +created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be +used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ownerID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + groupID + +
    +
    +
    +
    +
    +
    +

    ID of the group of entry’s owner.

    +
    +

    Note

    + When a new TAR container is created, if groupID is bigger than 2097151 then a PAX extended header will be +created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be +used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var groupID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerUserName + +
    +
    +
    +
    +
    +
    +

    User name of entry’s owner.

    +
    +

    Note

    + When a new TAR container is created, if ownerUserName cannot be encoded with ASCII or its ASCII +byte-representation is longer than 32 bytes then a PAX extended header will be created to represent this value +correctly, unless other format is forced. + +
    +

    Note

    + When creating new TAR container, ownerUserName is always encoded with UTF-8 in the ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ownerUserName: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerGroupName + +
    +
    +
    +
    +
    +
    +

    Name of the group of entry’s owner.

    +
    +

    Note

    + When new TAR container is created, if ownerGroupName cannot be encoded with ASCII or its ASCII +byte-representation is longer than 32 bytes then a PAX extended header will be created to represent this value +correctly, unless other format is forced. + +
    +

    Note

    + When creating new TAR container, ownerGroupName is always encoded with UTF-8 in the ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ownerGroupName: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deviceMajorNumber + +
    +
    +
    +
    +
    +
    +

    Device major number (used when entry is either block or character special file).

    +
    +

    Note

    + When new TAR container is created, if deviceMajorNumber is bigger than 2097151 then base-256 encoding +will be used to encode this value in ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var deviceMajorNumber: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deviceMinorNumber + +
    +
    +
    +
    +
    +
    +

    Device minor number (used when entry is either block or character special file).

    +
    +

    Note

    + When new TAR container is created, if deviceMinorNumber is bigger than 2097151 then base-256 encoding +will be used to encode this value in ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var deviceMinorNumber: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + charset + +
    +
    +
    +
    +
    +
    +

    Name of the character set used to encode entry’s data (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When new TAR container is created, if charset is not nil then a PAX extended header will be created to +store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var charset: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + comment + +
    +
    +
    +
    +
    +
    +

    Entry’s comment (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When new TAR container is created, if comment is not nil then a PAX extended header will be created to +store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var comment: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + linkName + +
    +
    +
    +
    +
    +
    +

    Path to a linked file for symbolic link entry.

    + +

    Depending on the particular format of the container, different container’s structures are used +to set this property, in the following preference order:

    + +
      +
    1. Local PAX extended header “linkpath” property.
    2. +
    3. Global PAX extended header “linkpath” property.
    4. +
    5. GNU format type “K” (LongLink) entry.
    6. +
    7. Default TAR header.
    8. +
    +
    +

    Note

    + When new TAR container is created, if linkName cannot be encoded with ASCII or its ASCII +byte-representation is longer than 100 bytes then a PAX extended header will be created to represent this value +correctly, unless other format is forced. + +
    +

    Note

    + When creating new TAR container, linkName is always encoded with UTF-8 in basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var linkName: String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    All custom (unknown) records from global and local PAX extended headers. nil, if there were no headers.

    +
    +

    Note

    + When new TAR container is created, if unknownExtendedHeaderRecords is not nil then a local PAX +extended header will be created to store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var unknownExtendedHeaderRecords: [String : String]?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(name:type:) + +
    +
    +
    +
    +
    +
    +

    Initializes the entry’s info with its name and type.

    +
    +

    Note

    +

    Entry’s type cannot be modified after initialization.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String, type: ContainerEntryType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    Entry’s name.

    +
    +
    + + type + + +
    +

    Entry’s type.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/TarReader.html b/Structs/TarReader.html new file mode 100644 index 00000000..16361de4 --- /dev/null +++ b/Structs/TarReader.html @@ -0,0 +1,437 @@ + + + + TarReader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarReader

+
+
+ +
public struct TarReader
+ +
+
+

A type that allows to iteratively read TAR entries from a container provided by a FileHandle.

+ +

The TarReader may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this either +the TarReader.process(_:) function should be used or both the call to TarReader.read() and the processing of the +returned entry should be wrapped inside the autoreleasepool. Since the autoreleasepool is available only on Darwin +platforms, the memory reducing effect may be not as significant on non-Darwin platforms (such as Linux or Windows).

+ +

The following code demonstrates an example usage of the TarReader:

+
   let handle: FileHandle = ...
+   let reader = TarReader(fileHandle: handle)
+   try reader.process { ... }
+   ...
+   try handle.close()
+
+ +

Note that closing the FileHandle remains the responsibility of the caller.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(fileHandle:) + +
    +
    +
    +
    +
    +
    +

    Creates a new instance for reading TAR entries from the provided fileHandle.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileHandle: FileHandle)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fileHandle + + +
    +

    A handle from which the entries will be read. Note that the TarReader does not close the +fileHandle and this remains the responsibility of the caller.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + process(_:) + +
    +
    +
    +
    +
    +
    +

    Processes the next TAR entry by reading it from the container and calling the provided closure on the result. If +the argument supplied to the closure is nil this indicates that the end of the input was reached.

    + +

    On Darwin platforms both the reading and the call to the closure are performed inside the autoreleasepool which +allows to reduce the peak memory usage.

    +
    +

    Throws

    + DataError.truncated if the input is truncated. TarError is thrown in case of malformed input. Errors +thrown by FileHandle operations are also propagated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func process<T>(_ transform: (TarEntry?) throws -> T) throws -> T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + read() + +
    +
    +
    +
    +
    +
    +

    Reads the next TAR entry from the container.

    + +

    On Darwin platforms it is recommended to wrap both the call to this function and the follow-up processing inside +the autoreleasepool in order to reduce the peak memory usage.

    +
    +

    Throws

    +

    DataError.truncated if the input is truncated. TarError is thrown in case of malformed input. Errors +thrown by FileHandle operations are also propagated.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func read() throws -> TarEntry?
    + +
    +
    +
    +

    Return Value

    +

    The next entry from the container or nil if the end of the input has been reached.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/TarWriter.html b/Structs/TarWriter.html new file mode 100644 index 00000000..21c6042c --- /dev/null +++ b/Structs/TarWriter.html @@ -0,0 +1,453 @@ + + + + TarWriter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarWriter

+
+
+ +
public struct TarWriter
+ +
+
+

A type that allows to iteratively create TAR containers with the output being written into a FileHandle.

+ +

The TarWriter may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this both +the creation of TAR entries and the calls to TarWriter should be wrapped inside the autoreleasepool. Since the +autoreleasepool is available only on Darwin platforms, the memory reducing effect may be not as significant on +non-Darwin platforms (such as Linux or Windows).

+ +

The following code demonstrates an example usage of the TarWriter:

+
   let handle: FileHandle = ...
+   let writer = TarWriter(fileHandle: handle)
+   try autoreleasepool {
+       let entry: TarEntry = ...
+       try writer.append(entry)
+   }
+   try writer.finalize()
+   try handle.close()
+
+ +

Note that TarWriter.finalize() must be called after finishing appending entries to the container. In addition, +closing the FileHandle remains the responsibility of the caller.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a new instance for writing TAR entries using the specified format into the provided fileHandle.

    + +

    The TarWriter will be forced to use the provided format, meaning that certain properties of the entries may +be missing from the output data if the chosen format does not support corresponding features. The default .pax +format supports the largest set of features. Other (non-PAX) formats should only be used if you have a specific +need for them and you understand limitations of those formats.

    +
    +

    Important

    +

    TarWriter.finalize() must be called after all entries have been appended.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileHandle: FileHandle, force format: TarContainer.Format = .pax)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + fileHandle + + +
    +

    A handle into which the output will be written. Note that the TarWriter does not +close the fileHandle and this remains the responsibility of the caller.

    +
    +
    + + force + + +
    +

    Force the usage of the specified format.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + append(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a new TAR entry at the end of the TAR container.

    + +

    On Darwin platforms it is recommended to wrap both the initialization of a TarEntry and the call to this +function inside the autoreleasepool in order to reduce the peak memory usage.

    +
    +

    Throws

    + Errors from the FileHandle operations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(_ entry: TarEntry) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + finalize() + +
    +
    +
    +
    +
    +
    +

    Finalizes the TAR container by adding an EOF marker.

    +
    +

    Throws

    + Errors from the FileHandle operations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func finalize() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/ZipEntry.html b/Structs/ZipEntry.html new file mode 100644 index 00000000..1399bef4 --- /dev/null +++ b/Structs/ZipEntry.html @@ -0,0 +1,347 @@ + + + + ZipEntry Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipEntry

+
+
+ +
public struct ZipEntry : ContainerEntry
+ +
+
+

Represents an entry from the ZIP container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + info + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let info: ZipEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let data: Data?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/ZipEntryInfo.html b/Structs/ZipEntryInfo.html new file mode 100644 index 00000000..155891aa --- /dev/null +++ b/Structs/ZipEntryInfo.html @@ -0,0 +1,861 @@ + + + + ZipEntryInfo Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipEntryInfo

+
+
+ +
public struct ZipEntryInfo : ContainerEntryInfo
+ +
+
+

Provides access to information about an entry from the ZIP container.

+ + +
+
+ +
+
+
+
+ + +
+ +

ContainerEntryInfo +

+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let size: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: ContainerEntryType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last access time (nil, if not available).

    + +

    Set from different sources in the following preference order:

    + +
      +
    1. Extended timestamp extra field (most common on UNIX-like systems).
    2. +
    3. NTFS extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let accessTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + creationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s creation time (nil, if not available).

    + +

    Set from different sources in the following preference order:

    + +
      +
    1. Extended timestamp extra field (most common on UNIX-like systems).
    2. +
    3. NTFS extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let creationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last modification time.

    + +

    Set from different sources in the following preference order:

    + +
      +
    1. Extended timestamp extra field (most common on UNIX-like systems).
    2. +
    3. NTFS extra field.
    4. +
    5. ZIP container’s own storage (in Central Directory entry).
    6. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modificationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permissions + +
    +
    +
    +
    +
    +
    +

    Entry’s permissions in POSIX format. +May have meaningless value if origin file system’s attributes weren’t POSIX compatible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let permissions: Permissions?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ZIP specific +

+
+
+
    +
  • +
    + + + + comment + +
    +
    +
    +
    +
    +
    +

    Entry’s comment.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let comment: String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry’s external file attributes. ZIP internal property. +May be useful when origin file system’s attributes weren’t POSIX compatible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let externalFileAttributes: UInt32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dosAttributes + +
    +
    +
    +
    +
    +
    +

    Entry’s attributes in DOS format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let dosAttributes: DosAttributes?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isTextFile + +
    +
    +
    +
    +
    +
    +

    True, if entry is likely to be text or ASCII file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isTextFile: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fileSystemType + +
    +
    +
    +
    +
    +
    +

    File system type of container’s origin.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let fileSystemType: FileSystemType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Entry’s compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerID + +
    +
    +
    +
    +
    +
    +

    ID of entry’s owner.

    + +

    Set from different sources in the following preference order, if possible:

    + +
      +
    1. Info-ZIP New Unix extra field.
    2. +
    3. Info-ZIP Unix extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ownerID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + groupID + +
    +
    +
    +
    +
    +
    +

    ID of the group of entry’s owner.

    + +

    Set from different sources in the following preference order, if possible:

    + +
      +
    1. Info-ZIP New Unix extra field.
    2. +
    3. Info-ZIP Unix extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let groupID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + customExtraFields + +
    +
    +
    +
    +
    +
    +

    Entry’s custom extra fields from both Central Directory and Local Header.

    +
    +

    Note

    + No particular order of extra fields is guaranteed. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let customExtraFields: [ZipExtraField]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + crc + +
    +
    +
    +
    +
    +
    +

    CRC32 of entry’s data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let crc: UInt32
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/ZlibHeader.html b/Structs/ZlibHeader.html new file mode 100644 index 00000000..e3bef053 --- /dev/null +++ b/Structs/ZlibHeader.html @@ -0,0 +1,466 @@ + + + + ZlibHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZlibHeader

+
+
+ +
public struct ZlibHeader
+ +
+
+

Represents the header of a Zlib archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + CompressionLevel + +
    +
    +
    +
    +
    +
    +

    Levels of compression which can be used to create Zlib archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CompressionLevel : Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Compression method of archive. Always .deflate for Zlib archives.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compressionLevel + +
    +
    +
    +
    +
    +
    +

    Level of compression used in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionLevel: CompressionLevel
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + windowSize + +
    +
    +
    +
    +
    +
    +

    Size of ‘window’: moving interval of data which was used to make archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let windowSize: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(archive:) + +
    +
    +
    +
    +
    +
    +

    Initializes the structure with the values from Zlib archive.

    + +

    If data passed is not actually a Zlib archive, ZlibError will be thrown.

    +
    +

    Throws

    +

    ZlibError. It may indicate that either archive is damaged or it might not be archived with Zlib at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(archive data: Data) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with zlib.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/ZlibHeader/CompressionLevel.html b/Structs/ZlibHeader/CompressionLevel.html new file mode 100644 index 00000000..04d62d22 --- /dev/null +++ b/Structs/ZlibHeader/CompressionLevel.html @@ -0,0 +1,411 @@ + + + + CompressionLevel Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CompressionLevel

+
+
+ +
public enum CompressionLevel : Int
+ +
+
+

Levels of compression which can be used to create Zlib archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + fastestAlgorithm + +
    +
    +
    +
    +
    +
    +

    Fastest algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fastestAlgorithm = 0
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fastAlgorithm + +
    +
    +
    +
    +
    +
    +

    Fast algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fastAlgorithm = 1
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + defaultAlgorithm + +
    +
    +
    +
    +
    +
    +

    Default algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case defaultAlgorithm = 2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + slowAlgorithm + +
    +
    +
    +
    +
    +
    +

    Slowest algorithm but with maximum compression.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case slowAlgorithm = 3
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/TAR.html b/TAR.html new file mode 100644 index 00000000..de339a5e --- /dev/null +++ b/TAR.html @@ -0,0 +1,465 @@ + + + + TAR Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TAR

+ +
+
+ +
+
+
+
    +
  • +
    + + + + TarContainer + +
    +
    +
    +
    +
    +
    +

    Provides functions for work with TAR containers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class TarContainer : Container
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarReader + +
    +
    +
    +
    +
    +
    +

    A type that allows to iteratively read TAR entries from a container provided by a FileHandle.

    + +

    The TarReader may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this either +the TarReader.process(_:) function should be used or both the call to TarReader.read() and the processing of the +returned entry should be wrapped inside the autoreleasepool. Since the autoreleasepool is available only on Darwin +platforms, the memory reducing effect may be not as significant on non-Darwin platforms (such as Linux or Windows).

    + +

    The following code demonstrates an example usage of the TarReader:

    +
       let handle: FileHandle = ...
    +   let reader = TarReader(fileHandle: handle)
    +   try reader.process { ... }
    +   ...
    +   try handle.close()
    +
    + +

    Note that closing the FileHandle remains the responsibility of the caller.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarWriter + +
    +
    +
    +
    +
    +
    +

    A type that allows to iteratively create TAR containers with the output being written into a FileHandle.

    + +

    The TarWriter may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this both +the creation of TAR entries and the calls to TarWriter should be wrapped inside the autoreleasepool. Since the +autoreleasepool is available only on Darwin platforms, the memory reducing effect may be not as significant on +non-Darwin platforms (such as Linux or Windows).

    + +

    The following code demonstrates an example usage of the TarWriter:

    +
       let handle: FileHandle = ...
    +   let writer = TarWriter(fileHandle: handle)
    +   try autoreleasepool {
    +       let entry: TarEntry = ...
    +       try writer.append(entry)
    +   }
    +   try writer.finalize()
    +   try handle.close()
    +
    + +

    Note that TarWriter.finalize() must be called after finishing appending entries to the container. In addition, +closing the FileHandle remains the responsibility of the caller.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarEntry + +
    +
    +
    +
    +
    +
    +

    Represents an entry from the TAR container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarEntry : ContainerEntry
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarEntryInfo + +
    +
    +
    +
    +
    +
    +

    Provides access to information about an entry from the TAR container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarEntryInfo : ContainerEntryInfo
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/ZIP.html b/ZIP.html new file mode 100644 index 00000000..86ba48bc --- /dev/null +++ b/ZIP.html @@ -0,0 +1,431 @@ + + + + ZIP Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZIP

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/badge.svg b/badge.svg new file mode 100644 index 00000000..a096feca --- /dev/null +++ b/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 100% + + + 100% + + + diff --git a/css/highlight.css b/css/highlight.css new file mode 100644 index 00000000..c170357c --- /dev/null +++ b/css/highlight.css @@ -0,0 +1,202 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight .c { + color: #999988; + font-style: italic; } + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; } + +.highlight .k { + color: #000000; + font-weight: bold; } + +.highlight .o { + color: #000000; + font-weight: bold; } + +.highlight .cm { + color: #999988; + font-style: italic; } + +.highlight .cp { + color: #999999; + font-weight: bold; } + +.highlight .c1 { + color: #999988; + font-style: italic; } + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + +.highlight .gd { + color: #000000; + background-color: #ffdddd; } + +.highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + +.highlight .ge { + color: #000000; + font-style: italic; } + +.highlight .gr { + color: #aa0000; } + +.highlight .gh { + color: #999999; } + +.highlight .gi { + color: #000000; + background-color: #ddffdd; } + +.highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + +.highlight .go { + color: #888888; } + +.highlight .gp { + color: #555555; } + +.highlight .gs { + font-weight: bold; } + +.highlight .gu { + color: #aaaaaa; } + +.highlight .gt { + color: #aa0000; } + +.highlight .kc { + color: #000000; + font-weight: bold; } + +.highlight .kd { + color: #000000; + font-weight: bold; } + +.highlight .kp { + color: #000000; + font-weight: bold; } + +.highlight .kr { + color: #000000; + font-weight: bold; } + +.highlight .kt { + color: #445588; } + +.highlight .m { + color: #009999; } + +.highlight .s { + color: #d14; } + +.highlight .na { + color: #008080; } + +.highlight .nb { + color: #0086B3; } + +.highlight .nc { + color: #445588; + font-weight: bold; } + +.highlight .no { + color: #008080; } + +.highlight .ni { + color: #800080; } + +.highlight .ne { + color: #990000; + font-weight: bold; } + +.highlight .nf { + color: #990000; } + +.highlight .nn { + color: #555555; } + +.highlight .nt { + color: #000080; } + +.highlight .nv { + color: #008080; } + +.highlight .ow { + color: #000000; + font-weight: bold; } + +.highlight .w { + color: #bbbbbb; } + +.highlight .mf { + color: #009999; } + +.highlight .mh { + color: #009999; } + +.highlight .mi { + color: #009999; } + +.highlight .mo { + color: #009999; } + +.highlight .sb { + color: #d14; } + +.highlight .sc { + color: #d14; } + +.highlight .sd { + color: #d14; } + +.highlight .s2 { + color: #d14; } + +.highlight .se { + color: #d14; } + +.highlight .sh { + color: #d14; } + +.highlight .si { + color: #d14; } + +.highlight .sx { + color: #d14; } + +.highlight .sr { + color: #009926; } + +.highlight .s1 { + color: #d14; } + +.highlight .ss { + color: #990073; } + +.highlight .bp { + color: #999999; } + +.highlight .vc { + color: #008080; } + +.highlight .vg { + color: #008080; } + +.highlight .vi { + color: #008080; } + +.highlight .il { + color: #009999; } diff --git a/css/jazzy.css b/css/jazzy.css new file mode 100644 index 00000000..9d4b08b8 --- /dev/null +++ b/css/jazzy.css @@ -0,0 +1,405 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + a.discouraged { + text-decoration: line-through; } + a.discouraged:hover, a.discouraged:focus { + text-decoration: underline line-through; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +hr { + height: 1px; + border: none; + background-color: #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { + background: #f7f7f7; + padding: .2em; } + .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 2px; + vertical-align: -3px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + .section-name p { + margin-bottom: inherit; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.section-name-container { + position: relative; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 20px; + font-size: 1rem; } + +.declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } + +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } + +form[role=search] .tt-highlight { + font-weight: bold; } + +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docsets/SWCompression.docset/Contents/Info.plist b/docsets/SWCompression.docset/Contents/Info.plist new file mode 100644 index 00000000..176be96d --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + com.jazzy.swcompression + CFBundleName + SWCompression + DocSetPlatformFamily + swcompression + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/7-Zip.html b/docsets/SWCompression.docset/Contents/Resources/Documents/7-Zip.html new file mode 100644 index 00000000..5da99d58 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/7-Zip.html @@ -0,0 +1,369 @@ + + + + 7-Zip Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

7-Zip

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Archives.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Archives.html new file mode 100644 index 00000000..b49d4a44 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Archives.html @@ -0,0 +1,431 @@ + + + + Archives Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Archives

+ +
+
+ +
+
+
+
    +
  • +
    + + + + GzipArchive + +
    +
    +
    +
    +
    +
    +

    Provides unarchive and archive functions for GZip archives.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class GzipArchive : Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + GzipHeader + +
    +
    +
    +
    +
    +
    +

    Represents the header of a GZip archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct GzipHeader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + XZArchive + +
    +
    +
    +
    +
    +
    +

    Provides unarchive function for XZ archives.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class XZArchive : Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZlibArchive + +
    +
    +
    +
    +
    +
    +

    Provides unarchive and archive functions for Zlib archives.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class ZlibArchive : Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZlibHeader + +
    +
    +
    +
    +
    +
    +

    Represents the header of a Zlib archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ZlibHeader
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html new file mode 100644 index 00000000..89d944c3 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html @@ -0,0 +1,557 @@ + + + + BZip2 Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BZip2

+
+
+ +
public class BZip2 : DecompressionAlgorithm
+
extension BZip2: CompressionAlgorithm
+ +
+
+

Provides functions for compression and decompression for BZip2 algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using BZip2 algortihm.

    +
    +

    Throws

    +

    BZip2Error if unexpected byte (bit) sequence was encountered in data. +It may indicate that either data is damaged or it might not be compressed with BZip2 at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with BZip2.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses one or more concatenated BZip2 archives found in data.

    +
    +

    Throws

    +

    BZip2Error if an unexpected byte (bit) sequence was encountered or a checksum mismatch is detected for +any archive. It may indicate that the input is damaged or it might not be compressed with BZip2 at all. If +BZip2Error.wrongCRC is thrown, its associated value contains only the bytes decompressed for the archive that +failed the checksum.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func multiDecompress(data: Data) throws -> [Data]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data that may contain one or more concatenated BZip2 archives.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of decompressed data, one element per archive, in the same order as they appear in the input.

    +
    + +
    +
    +
  • +
  • +
    + + + + BlockSize + +
    +
    +
    +
    +
    +
    +

    Represents the size of the blocks in which data is split during BZip2 compression.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum BlockSize : Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compresses data with BZip2 algortihm.

    +
    +

    Note

    +

    Input data will be split into blocks of size 100 KB. Use BZip2.compress(data:blockSize:) function to +specify the size of a block.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Compresses data with BZip2 algortihm, splitting data into blocks of specified blockSize.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data, blockSize: BlockSize) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    + + blockSize + + +
    +

    Size of blocks in which data will be split.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2/BlockSize.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2/BlockSize.html new file mode 100644 index 00000000..dd45b542 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2/BlockSize.html @@ -0,0 +1,561 @@ + + + + BlockSize Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BlockSize

+
+
+ +
public enum BlockSize : Int
+ +
+
+

Represents the size of the blocks in which data is split during BZip2 compression.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + one + +
    +
    +
    +
    +
    +
    +

    100 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case one = 1
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + two + +
    +
    +
    +
    +
    +
    +

    200 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case two = 2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + three + +
    +
    +
    +
    +
    +
    +

    300 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case three = 3
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + four + +
    +
    +
    +
    +
    +
    +

    400 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case four = 4
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + five + +
    +
    +
    +
    +
    +
    +

    500 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case five = 5
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + six + +
    +
    +
    +
    +
    +
    +

    600 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case six = 6
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + seven + +
    +
    +
    +
    +
    +
    +

    700 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case seven = 7
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + eight + +
    +
    +
    +
    +
    +
    +

    800 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case eight = 8
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nine + +
    +
    +
    +
    +
    +
    +

    900 KB.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nine = 9
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html new file mode 100644 index 00000000..738bfbfa --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html @@ -0,0 +1,411 @@ + + + + Deflate Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Deflate

+
+
+ +
public class Deflate : DecompressionAlgorithm
+
extension Deflate: CompressionAlgorithm
+ +
+
+

Provides functions for compression and decompression for Deflate algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using Deflate algortihm.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    DeflateError if unexpected byte (bit) sequence was encountered in data. +It may indicate that either data is damaged or it might not be compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with Deflate.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compresses data with Deflate algortihm.

    +
    +

    Note

    +

    Currently, SWCompression creates only one block for all data +and the block can either be uncompressed or compressed with static Huffman encoding. +Choice of one block type or the other depends on bytes’ statistics of data. +However, if data size is greater than 65535 (the maximum value stored in 2 bytes), +then static Huffman block will be created.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html new file mode 100644 index 00000000..072149df --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html @@ -0,0 +1,600 @@ + + + + GzipArchive Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GzipArchive

+
+
+ +
public class GzipArchive : Archive
+ +
+
+

Provides unarchive and archive functions for GZip archives.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Member + +
    +
    +
    +
    +
    +
    +

    Represents the member of a multi-member GZip archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Member
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchives GZip archive.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    DeflateError or GzipError depending on the type of the problem. +It may indicate that either archive is damaged or it might not be archived with GZip +or compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unarchive(archive data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with GZip.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unarchives multi-member GZip archive. +Multi-member GZip archives are essentially several GZip archives following each other in a single file.

    +
    +

    Throws

    +

    DeflateError or GzipError depending on the type of the problem. +It may indicate that one of the members of archive is damaged or +it might not be archived with GZip or compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func multiUnarchive(archive data: Data) throws -> [Member]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    GZip archive with one or more members.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Archives data into GZip archive, using various specified options. +Data will be also compressed with Deflate algorithm. +It will be also specified in archive’s header that the compressor used the slowest Deflate algorithm.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    GzipError.cannotEncodeISOLatin1 if a file name or a comment cannot be encoded with ISO-Latin-1 encoding +or if the total sum of the binary content length of all extra fields plus 4 for each field exceeds UInt16.max.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func archive(data: Data, comment: String? = nil, fileName: String? = nil,
    +                           writeHeaderCRC: Bool = false, isTextFile: Bool = false,
    +                           osType: FileSystemType? = nil, modificationTime: Date? = nil,
    +                           extraFields: [GzipHeader.ExtraField] = []) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data to compress and archive.

    +
    +
    + + comment + + +
    +

    Additional comment, which will be stored as a separate field in archive.

    +
    +
    + + fileName + + +
    +

    Name of the file which will be archived.

    +
    +
    + + writeHeaderCRC + + +
    +

    Set to true, if you want to store consistency check for archive’s header.

    +
    +
    + + isTextFile + + +
    +

    Set to true, if the file which will be archived is text file or ASCII-file.

    +
    +
    + + osType + + +
    +

    Type of the system on which this archive will be created.

    +
    +
    + + modificationTime + + +
    +

    Last time the file was modified.

    +
    +
    + + extraFields + + +
    +

    Any extra fields. Note that no extra field is allowed to have second byte of the extra +field (subfield) ID equal to zero. In addition, the length of a field’s binary content must be less than +UInt16.max, while the total sum of the binary content length of all extra fields plus 4 for each field must also +not exceed UInt16.max. See GZip format specification for more details.

    +
    +
    +
    +
    +

    Return Value

    +

    Resulting archive’s data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive/Member.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive/Member.html new file mode 100644 index 00000000..90750834 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive/Member.html @@ -0,0 +1,351 @@ + + + + Member Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Member

+
+
+ +
public struct Member
+ +
+
+

Represents the member of a multi-member GZip archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + header + +
    +
    +
    +
    +
    +
    +

    GZip header of a member.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let header: GzipHeader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    +

    Unarchived data from a member.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let data: Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html new file mode 100644 index 00000000..261dff40 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html @@ -0,0 +1,450 @@ + + + + LZMA Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMA

+
+
+ +
public class LZMA : DecompressionAlgorithm
+ +
+
+

Provides decompression function for LZMA.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using LZMA.

    +
    +

    Note

    +

    It is assumed that the first nine bytes of data represent standard LZMA properties (so called “lc”, “lp” +and “pb”), dictionary size, and uncompressed size all encoded with standard encoding scheme of LZMA format.

    + +
    +

    Throws

    +

    LZMAError if unexpected byte (bit) sequence was encountered in data. It may indicate that either data +is damaged or it might not be compressed with LZMA at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with LZMA.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses data using LZMA with specified algorithm’s properties, and, optionally, output’s +uncompressedSize. If uncompressedSize is nil, then data must contain finish marker.

    +
    +

    Note

    +

    It is assumed that data begins immediately with LZMA compressed bytes with no LZMA properties at the +beginning.

    + +
    +

    Warning

    +

    There is no validation performed for properties of properties argument. This API is intended to be +used by advanced users.

    + +
    +

    Throws

    +

    LZMAError if unexpected byte (bit) sequence was encountered in data. It may indicate that either data +is damaged or it might not be compressed with LZMA at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data,
    +                              properties: LZMAProperties,
    +                              uncompressedSize: Int? = nil) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data compressed with LZMA.

    +
    +
    + + properties + + +
    +

    Properties of LZMA (such as lc, lp, etc.)

    +
    +
    + + uncompressedSize + + +
    +

    Size of uncompressed data; nil if it is unknown. In case of nil, finish marker +must be present in data.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html new file mode 100644 index 00000000..801fa439 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html @@ -0,0 +1,353 @@ + + + + LZMA2 Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMA2

+
+
+ +
public class LZMA2 : DecompressionAlgorithm
+ +
+
+

Provides decompression function for LZMA2 algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using LZMA2 algortihm.

    +
    +

    Note

    +

    It is assumed that the first byte of data is a dictionary size encoded with standard encoding scheme of +LZMA2 format.

    + +
    +

    Throws

    +

    LZMAError or LZMA2Error if unexpected byte (bit) sequence was encountered in data. +It may indicate that either data is damaged or it might not be compressed with LZMA2 at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with LZMA2.

    +
    +
    +
    +
    +

    Return Value

    +

    Decompressed data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/SevenZipContainer.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/SevenZipContainer.html new file mode 100644 index 00000000..13af4938 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/SevenZipContainer.html @@ -0,0 +1,420 @@ + + + + SevenZipContainer Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipContainer

+
+
+ +
public class SevenZipContainer : Container
+ +
+
+

Provides functions for work with 7-Zip containers.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    Processes 7-Zip container and returns an array of SevenZipEntry with information and data for all entries.

    +
    +

    Important

    +

    The order of entries is defined by 7-Zip container and, particularly, by the creator of a given 7-Zip +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

    SevenZipError 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 7-Zip container at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    7-Zip container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of SevenZipEntry.

    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    Processes 7-Zip container and returns an array of SevenZipEntryInfo with information about entries in this +container.

    +
    +

    Important

    +

    The order of entries is defined by 7-Zip container and, particularly, by the creator of a given 7-Zip +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

    SevenZipError 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 7-Zip container at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    7-Zip container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of SevenZipEntryInfo.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/TarContainer.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/TarContainer.html new file mode 100644 index 00000000..00efa8d9 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/TarContainer.html @@ -0,0 +1,638 @@ + + + + TarContainer Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarContainer

+
+
+ +
public class TarContainer : Container
+ +
+
+

Provides functions for work with TAR containers.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Format + +
    +
    +
    +
    +
    +
    +

    Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to +successfully read a particular container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Format
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formatOf(container:) + +
    +
    +
    +
    +
    +
    +

    Processes TAR container and returns its “format”: a minimal set of extensions to basic TAR format required to +successfully read this container.

    +
    +

    Throws

    +

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

    + +
    +

    See also

    +

    TarContainer.Format

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func formatOf(container data: Data) throws -> Format
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + container + + +
    +

    TAR container’s data.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + create(from:) + +
    +
    +
    +
    +
    +
    +

    Creates a new TAR container with entries as its content and generates its Data.

    +
    +

    See also

    +

    TarEntryInfo properties documenation to see how their values are connected with the specific TAR +format used during container creation.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func create(from entries: [TarEntry]) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + entries + + +
    +

    TAR entries to store in the container.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + create(from:force:) + +
    +
    +
    +
    +
    +
    +

    Creates a new TAR container with entries as its content and generates its Data using the specified format.

    + +

    This function forces the usage of the format, meaning that certain properties of the entries may be missing +from the resulting container data if the chosen format does not support corresponding features. For example, +relatively long names (and linknames) will be truncated if the .ustar or .prePosix format is specified.

    + +

    It is highly recommended to use the TarContainer.create(from:) function (or use the .pax format) to ensure the +best representation of the entries in the output. Other (non-PAX) formats should only be used if you have a +specific need for them and you understand limitations of those formats.

    +
    +

    See also

    +

    TarEntryInfo properties documenation to see how their values are connected with the specific TAR +format used during container creation.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func create(from entries: [TarEntry], force format: TarContainer.Format) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + entries + + +
    +

    TAR entries to store in the container.

    +
    +
    + + force + + +
    +

    Force the usage of the specified format.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    Processes TAR container and returns an array of TarEntry with information and data for all entries.

    +
    +

    Important

    +

    The order of entries is defined by TAR container and, particularly, by the creator of a given TAR +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

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

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    TAR container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of TarEntry.

    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    Processes TAR container and returns an array of TarEntryInfo with information about entries in this container.

    +
    +

    Important

    +

    The order of entries is defined by TAR container and, particularly, by the creator of a given TAR +container. It is likely that directories will be encountered earlier than files stored in those directories, but no +particular order is guaranteed.

    + +
    +

    Throws

    +

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

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

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

    Parameters

    + + + + + + + +
    + + container + + +
    +

    TAR container’s data.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of TarEntryInfo.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/TarContainer/Format.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/TarContainer/Format.html new file mode 100644 index 00000000..a684cc95 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/TarContainer/Format.html @@ -0,0 +1,412 @@ + + + + Format Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Format

+
+
+ +
public enum Format
+ +
+
+

Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to +successfully read a particular container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + prePosix + +
    +
    +
    +
    +
    +
    +

    Pre POSIX format (aka “basic TAR format”).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case prePosix
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ustar + +
    +
    +
    +
    +
    +
    +

    “UStar” format introduced by POSIX IEEE P1003.1 standard.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ustar
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + gnu + +
    +
    +
    +
    +
    +
    +

    “UStar”-like format with GNU extensions (e.g. special container entries for long file and link names).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case gnu
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + pax + +
    +
    +
    +
    +
    +
    +

    “PAX” format introduced by POSIX.1-2001 standard, a set of extensions to “UStar” format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case pax
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html new file mode 100644 index 00000000..b8f1fcd8 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html @@ -0,0 +1,418 @@ + + + + XZArchive Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XZArchive

+
+
+ +
public class XZArchive : Archive
+ +
+
+

Provides unarchive function for XZ archives.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchives XZ archive. Archives with multiple streams are supported, +but uncompressed data from each stream will be combined into single Data object.

    + +

    If an error happens during LZMA2 decompression, then LZMAError or LZMA2Error will be thrown.

    +
    +

    Throws

    +

    LZMAError, LZMA2Error or XZError depending on the type of the problem. +Particularly, if filters other than LZMA2 are used in archive, then XZError.wrongFilterID will be thrown, +but it may also indicate that either the archive is damaged or +it might not be compressed with XZ or LZMA(2) at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unarchive(archive data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived using XZ format.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unarchives XZ archive. Archives with multiple streams are supported, +and uncompressed data from each stream will be stored in a separate element in the array

    + +

    If data passed is not actually XZ archive, XZError will be thrown. +Particularly, if filters other than LZMA2 are used in archive, then XZError.wrongFilterID will be thrown.

    + +

    If an error happens during LZMA2 decompression, then LZMAError or LZMA2Error will be thrown.

    +
    +

    Throws

    +

    LZMAError, LZMA2Error or XZError depending on the type of the problem. +It may indicate that either the archive is damaged or it might not be compressed with XZ or LZMA(2) at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func splitUnarchive(archive data: Data) throws -> [Data]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived using XZ format.

    +
    +
    +
    +
    +

    Return Value

    +

    Array of unarchived data from every stream in archive.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html new file mode 100644 index 00000000..77ba21ec --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html @@ -0,0 +1,461 @@ + + + + ZipContainer Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipContainer

+
+
+ +
public class ZipContainer : Container
+ +
+
+

Provides functions for work with ZIP containers.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + customExtraFields + +
    +
    +
    +
    +
    +
    +

    Contains user-defined extra fields. When either ZipContainer.info(container:) or ZipContainer.open(container:) +function encounters extra field without built-in support, it uses this dictionary and tries to find a corresponding +user-defined extra field. If an approriate custom extra field is found and successfully processed, then the result +is stored in ZipEntryInfo.customExtraFields.

    + +

    To enable support of custom extra field one must add a new entry to this dictionary. The value of this entry must +be a user-defined type which conforms to ZipExtraField protocol. The key must be equal to the ID of user-defined +extra field and type’s id property.

    +
    +

    Warning

    + Modifying this dictionary while either info(container:) or open(container:) function is being +executed may cause undefined behavior. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var customExtraFields: [UInt16 : any ZipExtraField.Type]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    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 no +particular order is guaranteed.

    + +
    +

    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.

    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    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 no +particular order is guaranteed.

    + +
    +

    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.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html new file mode 100644 index 00000000..2b452d67 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html @@ -0,0 +1,412 @@ + + + + ZlibArchive Class Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZlibArchive

+
+
+ +
public class ZlibArchive : Archive
+ +
+
+

Provides unarchive and archive functions for Zlib archives.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchives Zlib archive.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    +

    Throws

    +

    DeflateError or ZlibError depending on the type of the problem. +It may indicate that either archive is damaged or it might not be archived with Zlib +or compressed with Deflate at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unarchive(archive data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with Zlib.

    +
    +
    +
    +
    +

    Return Value

    +

    Unarchived data.

    +
    + +
    +
    +
  • +
  • +
    + + + + archive(data:) + +
    +
    +
    +
    +
    +
    +

    Archives data into Zlib archive. Data will be also compressed with Deflate algorithm. +It will also be specified in archive’s header that the compressor used the slowest Deflate algorithm.

    +
    +

    Note

    +

    This function is specification compliant.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func archive(data: Data) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data to compress and archive.

    +
    +
    +
    +
    +

    Return Value

    +

    Resulting archive’s data.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Common Auxiliary Types.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Common Auxiliary Types.html new file mode 100644 index 00000000..98117738 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Common Auxiliary Types.html @@ -0,0 +1,432 @@ + + + + Common Auxiliary Types Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Common Auxiliary Types

+ +
+
+ +
+
+
+
    +
  • +
    + + + + ContainerEntryType + +
    +
    +
    +
    +
    +
    +

    Represents the type of a container entry.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ContainerEntryType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DosAttributes + +
    +
    +
    +
    +
    +
    +

    Represents file attributes in DOS format.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DosAttributes : OptionSet
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Permissions + +
    +
    +
    +
    +
    +
    +

    Represents file access permissions in UNIX format.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Permissions : OptionSet
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CompressionMethod + +
    +
    +
    +
    +
    +
    +

    Represents a (de)compression method.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FileSystemType + +
    +
    +
    +
    +
    +
    +

    Represents the type of the file system on which an archive or container was created. File system determines the meaning +of file attributes.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum FileSystemType
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Compression.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Compression.html new file mode 100644 index 00000000..e94e3ffd --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Compression.html @@ -0,0 +1,465 @@ + + + + Compression Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Compression

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html new file mode 100644 index 00000000..b7c65114 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html @@ -0,0 +1,600 @@ + + + + BZip2Error Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

BZip2Error

+
+
+ +
public enum BZip2Error : Error
+ +
+
+

Represents an error which happened during BZip2 decompression. +It may indicate that either data is damaged or it might not be compressed with BZip2 at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongMagic + +
    +
    +
    +
    +
    +
    +

    ‘Magic’ number is not 0x425a.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongMagic
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongVersion + +
    +
    +
    +
    +
    +
    +

    BZip version is not 2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongVersion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongBlockSize + +
    +
    +
    +
    +
    +
    +

    Unsupported block size (not from ‘0’ to ‘9’).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongBlockSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongBlockType + +
    +
    +
    +
    +
    +
    +

    Unsupported block type (is neither ‘pi’ nor ‘sqrt(pi)’).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongBlockType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + randomizedBlock + +
    +
    +
    +
    +
    +
    +

    Block is randomized.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case randomizedBlock
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongHuffmanGroups + +
    +
    +
    +
    +
    +
    +

    Wrong number of Huffman tables/groups (should be between 2 and 6).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHuffmanGroups
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSelector + +
    +
    +
    +
    +
    +
    +

    Selector is greater than the total number of Huffman tables/groups.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSelector
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Wrong length of Huffman code (should be between 0 and 20).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHuffmanCodeLength
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + symbolNotFound + +
    +
    +
    +
    +
    +
    +

    Symbol wasn’t found in Huffman tree.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case symbolNotFound
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of the uncompressed data does not match the value stored in the archive. +Associated value contains the data that were successfully decompressed up to the point where the mismatch was +detected.

    + +
      +
    • When using BZip2.decompress(data:): The associated value comes from a single BZip2 archive. If the mismatch +happens at the final checksum verification, this is usually the entire decompressed output.

    • +
    • When using BZip2.multiDecompress(data:): The input may contain several concatenated BZip2 archives. The error +is thrown for the current archive that fails the checksum. The associated value contains only the data decompressed +for that archive. Results from earlier archives are not included and are not returned once this error is thrown.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC(Data)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/CompressionMethod.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/CompressionMethod.html new file mode 100644 index 00000000..37ac4082 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/CompressionMethod.html @@ -0,0 +1,469 @@ + + + + CompressionMethod Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CompressionMethod

+
+
+ +
public enum CompressionMethod
+ +
+
+

Represents a (de)compression method.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + bzip2 + +
    +
    +
    +
    +
    +
    +

    BZip2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case bzip2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + copy + +
    +
    +
    +
    +
    +
    +

    Copy (no compression).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case copy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deflate + +
    +
    +
    +
    +
    +
    +

    Deflate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deflate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lzma + +
    +
    +
    +
    +
    +
    +

    LZMA.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lzma
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lzma2 + +
    +
    +
    +
    +
    +
    +

    LZMA 2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lzma2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + other + +
    +
    +
    +
    +
    +
    +

    Other/unknown method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case other
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ContainerEntryType.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ContainerEntryType.html new file mode 100644 index 00000000..abf986e8 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ContainerEntryType.html @@ -0,0 +1,589 @@ + + + + ContainerEntryType Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ContainerEntryType

+
+
+ +
public enum ContainerEntryType
+ +
+
+

Represents the type of a container entry.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + blockSpecial + +
    +
    +
    +
    +
    +
    +

    Block special file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case blockSpecial
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + characterSpecial + +
    +
    +
    +
    +
    +
    +

    Character special file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case characterSpecial
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contiguous + +
    +
    +
    +
    +
    +
    +

    Contiguous file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case contiguous
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + directory + +
    +
    +
    +
    +
    +
    +

    Directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case directory
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fifo + +
    +
    +
    +
    +
    +
    +

    FIFO special file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fifo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hardLink + +
    +
    +
    +
    +
    +
    +

    Hard link.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case hardLink
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + regular + +
    +
    +
    +
    +
    +
    +

    Regular file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case regular
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + socket + +
    +
    +
    +
    +
    +
    +

    Socket.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case socket
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + symbolicLink + +
    +
    +
    +
    +
    +
    +

    Symbolic link.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case symbolicLink
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unknown + +
    +
    +
    +
    +
    +
    +

    Entry type is unknown.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknown
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DataError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DataError.html new file mode 100644 index 00000000..02f658c7 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DataError.html @@ -0,0 +1,412 @@ + + + + DataError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DataError

+
+
+ +
public enum DataError : Error, Equatable
+ +
+
+

Represents an error which happened during processing input data.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + truncated + +
    +
    +
    +
    +
    +
    +

    Indicates that input data is likely truncated or incomplete.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case truncated
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + corrupted + +
    +
    +
    +
    +
    +
    +

    Indicates that input data is corrupted, e.g. does not conform to the format specifications or contains other +invalid values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case corrupted
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + checksumMismatch(_:) + +
    +
    +
    +
    +
    +
    +

    Indicates that the computed checksum of the output data does not match the stored checksum. While usually the +associated value contains the output from all processed inputs up to and including the point when this error was +thrown, it is still recommended to check the documenation of a function to confirm this.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case checksumMismatch([Data])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsupportedFeature + +
    +
    +
    +
    +
    +
    +

    Indicates that input data was created using a feature that is not supported by the processing function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unsupportedFeature
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html new file mode 100644 index 00000000..3db48763 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html @@ -0,0 +1,410 @@ + + + + DeflateError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DeflateError

+
+
+ +
public enum DeflateError : Error
+ +
+
+

Represents an error which happened during Deflate compression or decompression. +It may indicate that either the data is damaged or it might not be compressed with Deflate at all.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Uncompressed block’s length and nlength bytes isn’t consistent with each other.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongUncompressedBlockLengths
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongBlockType + +
    +
    +
    +
    +
    +
    +

    Unknown block type (not 0, 1 or 2).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongBlockType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSymbol + +
    +
    +
    +
    +
    +
    +

    Decoded symbol was found in Huffman tree but is unknown.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSymbol
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + symbolNotFound + +
    +
    +
    +
    +
    +
    +

    Symbol wasn’t found in Huffman tree.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case symbolNotFound
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/FileSystemType.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/FileSystemType.html new file mode 100644 index 00000000..0e201d68 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/FileSystemType.html @@ -0,0 +1,445 @@ + + + + FileSystemType Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

FileSystemType

+
+
+ +
public enum FileSystemType
+ +
+
+

Represents the type of the file system on which an archive or container was created. File system determines the meaning +of file attributes.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + fat + +
    +
    +
    +
    +
    +
    +

    FAT filesystem.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fat
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + macintosh + +
    +
    +
    +
    +
    +
    +

    Filesystem of older Macintosh systems.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case macintosh
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ntfs + +
    +
    +
    +
    +
    +
    +

    NTFS.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ntfs
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + other + +
    +
    +
    +
    +
    +
    +

    Other/unknown file system.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case other
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unix + +
    +
    +
    +
    +
    +
    +

    One of many file systems of UNIX-like OS.

    +
    +

    Note

    + Modern macOS systems also fall into this category. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unix
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html new file mode 100644 index 00000000..9987baa1 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html @@ -0,0 +1,509 @@ + + + + GzipError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GzipError

+
+
+ +
public enum GzipError : Error
+ +
+
+

Represents an error which happened while processing a GZip archive. +It may indicate that either archive is damaged or it might not be GZip archive at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongMagic + +
    +
    +
    +
    +
    +
    +

    First two bytes (‘magic’ number) of archive isn’t 31 and 139.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongMagic
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Compression method used in archive is different from Deflate, which is the only supported one.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFlags + +
    +
    +
    +
    +
    +
    +

    One of the reserved fields in archive has an unexpected value, which can also mean (apart from damaged archive), +that archive uses a newer version of GZip format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFlags
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongHeaderCRC + +
    +
    +
    +
    +
    +
    +

    Computed CRC of archive’s header doesn’t match the value stored in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHeaderCRC
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of uncompressed data doesn’t match the value stored in the archive. +Associated value of the error contains GzipArchive.Members for all already decompressed data:

    + +
      +
    • if unarchive function was called then associated array will have only one element, +since this function always processes only first member of archive.
    • +
    • if multiUnarchive function was called then associated array will have an element +for each already decompressed member, including the one with mismatching checksum.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC([GzipArchive.Member])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongISize + +
    +
    +
    +
    +
    +
    +

    Computed ‘isize’ didn’t match the value stored in the archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongISize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + cannotEncodeISOLatin1 + +
    +
    +
    +
    +
    +
    +

    Either specified file name or comment cannot be encoded using ISO Latin-1 encoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cannotEncodeISOLatin1
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZ4.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZ4.html new file mode 100644 index 00000000..05fbff16 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZ4.html @@ -0,0 +1,710 @@ + + + + LZ4 Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZ4

+
+
+ +
public enum LZ4 : DecompressionAlgorithm
+
extension LZ4: CompressionAlgorithm
+ +
+
+

Provides functions for compression and decompression for LZ4 algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompresses data using LZ4 algortihm.

    + +

    Use LZ4.decompress(data:dictionary:dictionaryID:) instead, if the data was compressed with an external dictionary. +Otherwise, the decompression will result in an error or incorrect output.

    +
    +

    Throws

    +

    DataError.corrupted or DataError.truncated if the data is corrupted or truncated. +DataError.checksumMismatch is thrown with uncompressed data as its associated value if the computed checksum of +the uncompressed data does not match the stored checksum. DataError.unsupportedFeature is thrown when the value +of a field inside the frame, such as uncompressed data size, is incompatible with the maximum integer size of the +current platform.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + data + + +
    +

    Data compressed with LZ4. If data represents several concatenated LZ4 frames, only the first +frame will be processed; use LZ4.multiDecompress(data:dictionary:dictionaryID:) instead to decompress all the +frames.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses data using LZ4 algortihm and provided external dictionary.

    +
    +

    Throws

    +

    DataError.corrupted or DataError.truncated if the data is corrupted or truncated. +DataError.checksumMismatch is thrown with uncompressed data as its associated value if the computed checksum of +the uncompressed data does not match the stored checksum. DataError.unsupportedFeature is thrown when the value +of a field inside the frame, such as uncompressed data size, is incompatible with the maximum integer size of the +current platform.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func decompress(data: Data, dictionary: Data?, dictionaryID: UInt32? = nil) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data compressed with LZ4. If data represents several concatenated LZ4 frames, only the first +frame will be processed; use LZ4.multiDecompress(data:dictionary:dictionaryID:) instead to decompress all the +frames.

    +
    +
    + + dictionary + + +
    +

    External dictionary which will be used during decompression. Providing incorrect dictionary +(not the one that was used for compression), no dictionary at all (if one was used for compression), or providing a +dictionary when no dictionary was used for compression will result in an error or incorrect output.

    +
    +
    + + dictionaryID + + +
    +

    Optional dictionary ID, which must match the one stored in the frame. If no dictionary +ID is present in the frame, then this argument is ignored.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decompresses data, which may represent several concatenated LZ4 frames, using LZ4 algortihm and provided external +dictionary.

    +
    +

    Throws

    +

    DataError.corrupted or DataError.truncated if the data is corrupted or truncated. +DataError.checksumMismatch is thrown if the computed checksum of the uncompressed data does not match the stored +checksum. The associated value in this case contains uncompressed data from all the frames up to and including the +one that caused this error. DataError.unsupportedFeature is thrown when the value of a field inside a frame, such +as uncompressed data size, is incompatible with the maximum integer size of the current platform.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func multiDecompress(data: Data, dictionary: Data? = nil, dictionaryID: UInt32? = nil) throws -> [Data]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data compressed with LZ4. If data represents several concatenated LZ4 frames, all of them will +be processed.

    +
    +
    + + dictionary + + +
    +

    External dictionary which will be used during decompression of all encountered frames. +Providing incorrect dictionary (not the one that was used for compression), no dictionary at all (if one was used +for compression), or providing a dictionary when no dictionary was used for compression will result in an error or +incorrect output.

    +
    +
    + + dictionaryID + + +
    +

    Optional dictionary ID, which must match the one stored in all frames. If no dictionary +ID is present in a frame, then this argument is ignored for that frame.

    +
    +
    +
    +
    +

    Return Value

    +

    An array with uncompressed data from each processed non-skippable LZ4 frame as its elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compresses data using LZ4 algortihm with default format and algorithm options.

    + +

    The default options include: independent blocks, do not save checksums for compressed blocks, save the checksum of +the uncompressed data, do not save the size of the uncompressed data, use 4 MB block size, no dictionary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data) -> Data
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Compresses data using LZ4 algortihm.

    + +

    This function allows to customize format and alogrithm options or use an external dictionary to compress the data.

    +
    +

    Precondition

    +

    blockSize must be greater than zero and less than or equal to 4194304 (4 MB).

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func compress(data: Data, independentBlocks: Bool, blockChecksums: Bool,
    +                             contentChecksum: Bool, contentSize: Bool, blockSize: Int = 4 * 1024 * 1024,
    +                             dictionary: Data? = nil, dictionaryID: UInt32? = nil) -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + data + + +
    +

    Data to compress.

    +
    +
    + + independentBlocks + + +
    +

    True, if compressed blocks should be independent of each other. Setting this to +false may improve compression ratio at the cost of decompression speed.

    +
    +
    + + blockChecksums + + +
    +

    True, if the checksums of the compressed blocks should be stored in the output.

    +
    +
    + + contentChecksum + + +
    +

    True, if the checksum of the uncompressed data should be stored in the output.

    +
    +
    + + contentSize + + +
    +

    True, if the size of the uncompressed data should be stored in the output.

    +
    +
    + + blockSize + + +
    +

    Size of uncompressed blocks in bytes. The default and maximum value is 4194304 (4 MB).

    +
    +
    + + dictionary + + +
    +

    External dictionary which will be used during compression. The same dictionary then must +be used for successful decompression.

    +
    +
    + + dictionaryID + + +
    +

    Optional dictionary ID which will be stored in the output. The same dictionary ID then +is likely to be required for successful decompression.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html new file mode 100644 index 00000000..028d6869 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html @@ -0,0 +1,411 @@ + + + + LZMA2Error Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMA2Error

+
+
+ +
public enum LZMA2Error : Error
+ +
+
+

Represents an error which happened during LZMA2 decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA2 at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongDictionarySize + +
    +
    +
    +
    +
    +
    +

    Dictionary size is too big, or has reserved bits set, or is in incorrect format in general.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongDictionarySize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongControlByte + +
    +
    +
    +
    +
    +
    +

    Unknown conrol byte value of LZMA2 packet.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongControlByte
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongReset + +
    +
    +
    +
    +
    +
    +

    Unknown reset instruction encountered in LZMA2 packet.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongReset
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSizes + +
    +
    +
    +
    +
    +
    +

    Either size of decompressed data isn’t equal to the one specified in LZMA2 packet or +amount of compressed data read is different from the one stored in LZMA2 packet.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSizes
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html new file mode 100644 index 00000000..3aac5c6d --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html @@ -0,0 +1,500 @@ + + + + LZMAError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMAError

+
+
+ +
public enum LZMAError : Error
+ +
+
+

Represents an error which happened during LZMA decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongProperties + +
    +
    +
    +
    +
    +
    +

    Properties’ byte is greater than 225.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongProperties
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rangeDecoderInitError + +
    +
    +
    +
    +
    +
    +

    Unable to initialize RanderDecorer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rangeDecoderInitError
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Size of uncompressed data hit specified limit in the middle of decoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case exceededUncompressedSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + windowIsEmpty + +
    +
    +
    +
    +
    +
    +

    Unable to perfrom repeat-distance decoding because there is nothing to repeat.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case windowIsEmpty
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    End of stream marker is reached, but range decoder is in incorrect state.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rangeDecoderFinishError
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + repeatWillExceed + +
    +
    +
    +
    +
    +
    +

    The number of bytes to repeat is greater than the amount bytes that is left to decode.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case repeatWillExceed
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + notEnoughToRepeat + +
    +
    +
    +
    +
    +
    +

    The amount of already decoded bytes is smaller than repeat length.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notEnoughToRepeat
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/SevenZipError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/SevenZipError.html new file mode 100644 index 00000000..6a3bc34f --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/SevenZipError.html @@ -0,0 +1,620 @@ + + + + SevenZipError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipError

+
+
+ +
public enum SevenZipError : Error
+ +
+
+

Represents an error which happened while processing a 7-Zip container. +It may indicate that either container is damaged or it might not be 7-Zip container at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongSignature + +
    +
    +
    +
    +
    +
    +

    Wrong container’s signature.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSignature
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFormatVersion + +
    +
    +
    +
    +
    +
    +

    Unsupported version of container’s format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFormatVersion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC + +
    +
    +
    +
    +
    +
    +

    CRC either of one of the files from the container or one of the container’s strucutures is incorrect.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSize + +
    +
    +
    +
    +
    +
    +

    Size either of one of the files from the container or one of the container’s strucutures is incorrect.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + startPosNotSupported + +
    +
    +
    +
    +
    +
    +

    Files have StartPos property. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case startPosNotSupported
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + externalNotSupported + +
    +
    +
    +
    +
    +
    +

    External feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case externalNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Coders with multiple in and/or out streams aren’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiStreamNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Additional streams feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case additionalStreamsNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry is compressed using unsupported compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case compressionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry or container’s header is encrypted. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case encryptionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unknown/incorrect internal 7-Zip structure was encountered or a required internal structure is missing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case internalStructureError
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/TarCreateError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/TarCreateError.html new file mode 100644 index 00000000..12738204 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/TarCreateError.html @@ -0,0 +1,329 @@ + + + + TarCreateError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarCreateError

+
+
+ +
public enum TarCreateError : Error
+ +
+
+

Represents an error which happened during the creation of a new TAR container.

+
+

Note

+ This error type is never used and will be removed in the next major update. + +
+ + +
+
+ +
+
+
+
    +
  • +
    + + + + utf8NonEncodable + +
    +
    +
    +
    +
    +
    +

    One of the TarEntryInfo‘s string properties (such as name) cannot be encoded with UTF-8 encoding.

    +
    +

    Note

    + This error is never thrown and will be removed in the next major update. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case utf8NonEncodable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/TarError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/TarError.html new file mode 100644 index 00000000..e93462a7 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/TarError.html @@ -0,0 +1,410 @@ + + + + TarError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarError

+
+
+ +
public enum TarError : Error
+ +
+
+

Represents an error which happened while processing a TAR container. +It may indicate that either container is damaged or it might not be TAR container at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + tooSmallFileIsPassed + +
    +
    +
    +
    +
    +
    +

    Data is unexpectedly truncated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tooSmallFileIsPassed
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongField + +
    +
    +
    +
    +
    +
    +

    Failed to process a required TAR header’s field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongField
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongHeaderChecksum + +
    +
    +
    +
    +
    +
    +

    Computed checksum of a header doesn’t match the value stored in container.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongHeaderChecksum
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongPaxHeaderEntry + +
    +
    +
    +
    +
    +
    +

    Entry from PAX extended header is in incorrect format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongPaxHeaderEntry
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html new file mode 100644 index 00000000..7f22aae8 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html @@ -0,0 +1,575 @@ + + + + XZError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

XZError

+
+
+ +
public enum XZError : Error
+ +
+
+

Represents an error which happened while unarchiving an XZ archive. +It may indicate that either archive is damaged or it might not be XZ archive at all.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + wrongMagic + +
    +
    +
    +
    +
    +
    +

    Either ‘magic’ number in header or footer isn’t equal to a predefined value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongMagic
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongField + +
    +
    +
    +
    +
    +
    +

    One of the special fields in archive has an incorrect value, +which can mean both damaged archive or that archive uses a newer version of XZ format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongField
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongInfoCRC + +
    +
    +
    +
    +
    +
    +

    Checksum of one of the fields of archive doesn’t match the value stored in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongInfoCRC
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFilterID + +
    +
    +
    +
    +
    +
    +

    Filter used in archive is unsupported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFilterID
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + checkTypeSHA256 + +
    +
    +
    +
    +
    +
    +

    Archive uses SHA-256 checksum which is unsupported.

    +
    +

    Note

    + This error is never thrown and will be removed in the next major update. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case checkTypeSHA256
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongDataSize + +
    +
    +
    +
    +
    +
    +

    Either size of decompressed data isn’t equal to the one specified in archive or +amount of compressed data read is different from the one stored in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongDataSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCheck(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of uncompressed data doesn’t match the value stored in the archive. +Associated value of the error contains already decompressed data:

    + +
      +
    • if unarchive function was called then associated array will have only one element +with combined data for all already decompressed streams, including the one with mismatching checksum.
    • +
    • if splitUnarchive function was called then associated array will have an element +for each already decompressed stream, including the one with mismatching checksum.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCheck([Data])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongPadding + +
    +
    +
    +
    +
    +
    +

    Padding (null-bytes appended to an archive’s structure) is incorrect.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongPadding
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + multiByteIntegerError + +
    +
    +
    +
    +
    +
    +

    Either null byte encountered or exceeded maximum amount bytes while reading multi byte number.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiByteIntegerError
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html new file mode 100644 index 00000000..de573f27 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html @@ -0,0 +1,621 @@ + + + + ZipError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipError

+
+
+ +
public enum ZipError : Error
+ +
+
+

Represents an error which happened while processing a ZIP container. +It may indicate that either container is damaged or it might not be ZIP container at all.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    End of Central Directoty record wasn’t found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case notFoundCentralDirectoryEnd
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSignature + +
    +
    +
    +
    +
    +
    +

    Wrong signature of one of container’s structures.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSignature
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongSize + +
    +
    +
    +
    +
    +
    +

    Wrong either compressed or uncompressed size of a container’s entry.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongSize
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongVersion + +
    +
    +
    +
    +
    +
    +

    Version needed to process container is unsupported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongVersion
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Container is either spanned or consists of several volumes. These features aren’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case multiVolumesNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry or record is encrypted. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case encryptionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + patchingNotSupported + +
    +
    +
    +
    +
    +
    +

    Entry contains patched data. This feature isn’t supported.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case patchingNotSupported
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry is compressed using unsupported compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case compressionNotSupported
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongLocalHeader + +
    +
    +
    +
    +
    +
    +

    Local header of an entry is inconsistent with Central Directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongLocalHeader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCRC(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of entry’s data doesn’t match the value stored in the archive. +Associated value of the error contains ZipEntry objects for all already processed entries:

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCRC([ZipEntry])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongTextField + +
    +
    +
    +
    +
    +
    +

    Either entry’s comment or file name cannot be processed using UTF-8 encoding.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongTextField
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipExtraFieldLocation.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipExtraFieldLocation.html new file mode 100644 index 00000000..14161e9b --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipExtraFieldLocation.html @@ -0,0 +1,349 @@ + + + + ZipExtraFieldLocation Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipExtraFieldLocation

+
+
+ +
public enum ZipExtraFieldLocation
+ +
+
+

Location of ZIP extra field inside a container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + centralDirectory + +
    +
    +
    +
    +
    +
    +

    ZIP extra field is located in container’s Central Directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case centralDirectory
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localHeader + +
    +
    +
    +
    +
    +
    +

    ZIP extra field is located in one of container’s Local Headers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case localHeader
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html new file mode 100644 index 00000000..6dae2917 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html @@ -0,0 +1,441 @@ + + + + ZlibError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZlibError

+
+
+ +
public enum ZlibError : Error
+ +
+
+

Represents an error which happened while processing a Zlib archive. +It may indicate that either archive is damaged or it might not be Zlib archive at all.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Compression method used in archive is different from Deflate, which is the only supported one.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCompressionInfo + +
    +
    +
    +
    +
    +
    +

    Compression info has value incompatible with Deflate compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongFcheck + +
    +
    +
    +
    +
    +
    +

    First two bytes of archive’s flags are inconsistent with each other.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongFcheck
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongCompressionLevel + +
    +
    +
    +
    +
    +
    +

    Compression level has value, which is different from the supported ones.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongCompressionLevel
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + wrongAdler32(_:) + +
    +
    +
    +
    +
    +
    +

    Computed checksum of uncompressed data doesn’t match the value stored in archive. +Associated value of the error contains already decompressed data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case wrongAdler32(Data)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Errors.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Errors.html new file mode 100644 index 00000000..b8fa3bc4 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Errors.html @@ -0,0 +1,663 @@ + + + + Errors Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Errors

+ +
+
+ +
+
+
+
    +
  • +
    + + + + BZip2Error + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during BZip2 decompression. +It may indicate that either data is damaged or it might not be compressed with BZip2 at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum BZip2Error : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DataError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during processing input data.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DataError : Error, Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DeflateError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during Deflate compression or decompression. +It may indicate that either the data is damaged or it might not be compressed with Deflate at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DeflateError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + GzipError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a GZip archive. +It may indicate that either archive is damaged or it might not be GZip archive at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum GzipError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LZMAError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during LZMA decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum LZMAError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LZMA2Error + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during LZMA2 decompression. +It may indicate that either data is damaged or it might not be compressed with LZMA2 at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum LZMA2Error : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SevenZipError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a 7-Zip container. +It may indicate that either container is damaged or it might not be 7-Zip container at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum SevenZipError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarCreateError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened during the creation of a new TAR container.

    +
    +

    Note

    + This error type is never used and will be removed in the next major update. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TarCreateError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a TAR container. +It may indicate that either container is damaged or it might not be TAR container at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TarError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + XZError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while unarchiving an XZ archive. +It may indicate that either archive is damaged or it might not be XZ archive at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum XZError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZipError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a ZIP container. +It may indicate that either container is damaged or it might not be ZIP container at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ZipError : Error
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ZlibError + +
    +
    +
    +
    +
    +
    +

    Represents an error which happened while processing a Zlib archive. +It may indicate that either archive is damaged or it might not be Zlib archive at all.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ZlibError : Error
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 00000000..daa1c27b --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,462 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Protocols

+ +
+
+ +
+
+
+
    +
  • +
    + + + + Archive + +
    +
    +
    +
    +
    +
    +

    A type that represents an archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Archive
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Container + +
    +
    +
    +
    +
    +
    +

    A type that represents a container with files, directories and/or other data.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Container
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ContainerEntry + +
    +
    +
    +
    +
    +
    +

    A type that represents an entry from the container with its data and information.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ContainerEntry
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ContainerEntryInfo + +
    +
    +
    +
    +
    +
    +

    A type that provides access to information about an entry from the container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ContainerEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CompressionAlgorithm + +
    +
    +
    +
    +
    +
    +

    A type that provides an implementation of a particular compression algorithm.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CompressionAlgorithm
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A type that provides an implementation of a particular decompression algorithm.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DecompressionAlgorithm
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html new file mode 100644 index 00000000..73354815 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html @@ -0,0 +1,319 @@ + + + + Archive Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Archive

+
+
+ +
public protocol Archive
+ +
+
+

A type that represents an archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unarchive(archive:) + +
    +
    +
    +
    +
    +
    +

    Unarchive data from the archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func unarchive(archive: Data) throws -> Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/CompressionAlgorithm.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/CompressionAlgorithm.html new file mode 100644 index 00000000..67bb1580 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/CompressionAlgorithm.html @@ -0,0 +1,319 @@ + + + + CompressionAlgorithm Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CompressionAlgorithm

+
+
+ +
public protocol CompressionAlgorithm
+ +
+
+

A type that provides an implementation of a particular compression algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Compress data with particular algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func compress(data: Data) throws -> Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Container.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Container.html new file mode 100644 index 00000000..ad970b30 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Container.html @@ -0,0 +1,379 @@ + + + + Container Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Container

+
+
+ +
public protocol Container
+ +
+
+

A type that represents a container with files, directories and/or other data.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Entry + +
    +
    +
    +
    +
    +
    +

    A type that represents an entry from this container.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Entry : ContainerEntry
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + open(container:) + +
    +
    +
    +
    +
    +
    +

    Retrieve all container entries with their data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func open(container: Data) throws -> [Entry]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + info(container:) + +
    +
    +
    +
    +
    +
    +

    Retrieve information about all container entries (without their data).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func info(container: Data) throws -> [Entry.Info]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ContainerEntry.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ContainerEntry.html new file mode 100644 index 00000000..5303c7e9 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ContainerEntry.html @@ -0,0 +1,384 @@ + + + + ContainerEntry Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ContainerEntry

+
+
+ +
public protocol ContainerEntry
+ +
+
+

A type that represents an entry from the container with its data and information.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Info + +
    +
    +
    +
    +
    +
    +

    A type that provides information about an entry.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Info : ContainerEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + info + +
    +
    +
    +
    +
    +
    +

    Provides access to information about the entry.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var info: Info { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    +

    Entry’s data (nil if entry is a directory or data isn’t available).

    +
    +

    Note

    + It is assumed that the compression provided by the container is yet to be applied to data. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var data: Data? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ContainerEntryInfo.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ContainerEntryInfo.html new file mode 100644 index 00000000..4f2ecce2 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ContainerEntryInfo.html @@ -0,0 +1,499 @@ + + + + ContainerEntryInfo Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ContainerEntryInfo

+
+
+ +
public protocol ContainerEntryInfo
+ +
+
+

A type that provides access to information about an entry from the container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Entry’s name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    +

    Entry’s type.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var type: ContainerEntryType { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    +

    Entry’s data size (can be nil if either data or size aren’t available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var size: Int? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last access time (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var accessTime: Date? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + creationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s creation time (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var creationTime: Date? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last modification time (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var modificationTime: Date? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permissions + +
    +
    +
    +
    +
    +
    +

    Entry’s permissions in POSIX format (nil, if not available).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var permissions: Permissions? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html new file mode 100644 index 00000000..bb4fc4ae --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html @@ -0,0 +1,319 @@ + + + + DecompressionAlgorithm Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DecompressionAlgorithm

+
+
+ +
public protocol DecompressionAlgorithm
+ +
+
+

A type that provides an implementation of a particular decompression algorithm.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + decompress(data:) + +
    +
    +
    +
    +
    +
    +

    Decompress data compressed with particular algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func decompress(data: Data) throws -> Data
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ZipExtraField.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ZipExtraField.html new file mode 100644 index 00000000..7a60d064 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/ZipExtraField.html @@ -0,0 +1,463 @@ + + + + ZipExtraField Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

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 + +
    +
    +
    +
    +
    +
    +

    Location of extra field. Must be equal to the value of location argument of init?(_:_:location:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var location: ZipExtraFieldLocation { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    +

    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 }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:_:location:) + +
    +
    +
    +
    +
    +
    +

    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 }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/DosAttributes.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/DosAttributes.html new file mode 100644 index 00000000..61635df8 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/DosAttributes.html @@ -0,0 +1,529 @@ + + + + DosAttributes Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

DosAttributes

+
+
+ +
public struct DosAttributes : OptionSet
+ +
+
+

Represents file attributes in DOS format.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    +

    Raw bit flags value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: UInt32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes attributes with bit flags.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: UInt32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + archive + +
    +
    +
    +
    +
    +
    +

    File is archive or archived.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let archive: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + directory + +
    +
    +
    +
    +
    +
    +

    File is a directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let directory: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + volume + +
    +
    +
    +
    +
    +
    +

    File is a volume.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let volume: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + system + +
    +
    +
    +
    +
    +
    +

    File is a system file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let system: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hidden + +
    +
    +
    +
    +
    +
    +

    File is hidden.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let hidden: DosAttributes
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readOnly + +
    +
    +
    +
    +
    +
    +

    File is read-only.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readOnly: DosAttributes
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html new file mode 100644 index 00000000..ee792706 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html @@ -0,0 +1,592 @@ + + + + GzipHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

GzipHeader

+
+
+ +
public struct GzipHeader
+ +
+
+

Represents the header of a GZip archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Compression method of archive. Always .deflate for GZip archives.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    The most recent modification time of the original file. If corresponding archive’s field is set to 0, which means +that no time was specified, then this property is nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modificationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + osType + +
    +
    +
    +
    +
    +
    +

    Type of file system on which archivation took place.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var osType: FileSystemType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fileName + +
    +
    +
    +
    +
    +
    +

    Name of the original file. If archive doesn’t contain file’s name, then nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fileName: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + comment + +
    +
    +
    +
    +
    +
    +

    Comment stored in archive. If archive doesn’t contain any comment, then nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var comment: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isTextFile + +
    +
    +
    +
    +
    +
    +

    True, if file is likely to be text file or ASCII-file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isTextFile: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + extraFields + +
    +
    +
    +
    +
    +
    +

    Extra fields present in the header.

    +
    +

    Note

    + This feature of the GZip format is extremely rarely used, so in vast majority of cases this property +contains an empty array. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var extraFields: [ExtraField]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(archive:) + +
    +
    +
    +
    +
    +
    +

    Initializes the structure with the values from the first ‘member’ of GZip archive.

    +
    +

    Throws

    +

    GzipError. It may indicate that either archive is damaged or +it might not be archived with GZip at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(archive data: Data) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with GZip.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + ExtraField + +
    +
    +
    +
    +
    +
    +

    Represents an extra field in the header of a GZip archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ExtraField
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/ExtraField.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/ExtraField.html new file mode 100644 index 00000000..7f63895f --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/ExtraField.html @@ -0,0 +1,411 @@ + + + + ExtraField Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ExtraField

+
+
+ +
public struct ExtraField
+ +
+
+

Represents an extra field in the header of a GZip archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + si1 + +
    +
    +
    +
    +
    +
    +

    First byte of the extra field (subfield) ID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let si1: UInt8
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + si2 + +
    +
    +
    +
    +
    +
    +

    Second byte of the extra field (subfield) ID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let si2: UInt8
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + bytes + +
    +
    +
    +
    +
    +
    +

    Binary content of the extra field.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var bytes: [UInt8]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Initializes an extra field with the specified extra field (subfield) ID bytes and its binary content.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ si1: UInt8, _ si2: UInt8, _ bytes: [UInt8])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/LZMAProperties.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/LZMAProperties.html new file mode 100644 index 00000000..c5d9cf74 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/LZMAProperties.html @@ -0,0 +1,480 @@ + + + + LZMAProperties Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

LZMAProperties

+
+
+ +
public struct LZMAProperties
+ +
+
+

Properties of LZMA. This API is intended to be used by advanced users.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + lc + +
    +
    +
    +
    +
    +
    +

    Number of bits used for the literal encoding context. Default value is 3.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lc: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lp + +
    +
    +
    +
    +
    +
    +

    Number of bits to include in “literal position state”. Default value is 0.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lp: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + pb + +
    +
    +
    +
    +
    +
    +

    Number of bits to include in “position state”. Default value is 2.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var pb: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dictionarySize + +
    +
    +
    +
    +
    +
    +

    Size of the dictionary. Default value is 1 << 24.

    +
    +

    Note

    + Dictionary size cannot be less than 4096. In case of attempt to set it to the value less than 4096 it will +be automatically set to 4096 instead. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var dictionarySize: Int { get set }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes LZMA properties with values of lc, lp, pb, and dictionary size.

    +
    +

    Note

    + It is not tested if values of lc, lp, and pb are valid. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(lc: Int, lp: Int, pb: Int, dictionarySize: Int)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Initializes LZMA properties with default values of lc, lp, pb, and dictionary size.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/Permissions.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/Permissions.html new file mode 100644 index 00000000..4e4eee05 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/Permissions.html @@ -0,0 +1,709 @@ + + + + Permissions Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

Permissions

+
+
+ +
public struct Permissions : OptionSet
+ +
+
+

Represents file access permissions in UNIX format.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    +

    Raw bit flags value (in decimal).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: UInt32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    +

    Initializes permissions with bit flags in decimal.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: UInt32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setuid + +
    +
    +
    +
    +
    +
    +

    Set UID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let setuid: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setgid + +
    +
    +
    +
    +
    +
    +

    Set GID.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let setgid: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sticky + +
    +
    +
    +
    +
    +
    +

    Sticky bit.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let sticky: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readOwner + +
    +
    +
    +
    +
    +
    +

    Owner can read.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readOwner: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + writeOwner + +
    +
    +
    +
    +
    +
    +

    Owner can write.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let writeOwner: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + executeOwner + +
    +
    +
    +
    +
    +
    +

    Owner can execute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let executeOwner: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readGroup + +
    +
    +
    +
    +
    +
    +

    Group can read.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readGroup: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + writeGroup + +
    +
    +
    +
    +
    +
    +

    Group can write.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let writeGroup: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + executeGroup + +
    +
    +
    +
    +
    +
    +

    Group can execute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let executeGroup: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readOther + +
    +
    +
    +
    +
    +
    +

    Others can read.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let readOther: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + writeOther + +
    +
    +
    +
    +
    +
    +

    Others can write.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let writeOther: Permissions
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + executeOther + +
    +
    +
    +
    +
    +
    +

    Others can execute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let executeOther: Permissions
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/SevenZipEntry.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/SevenZipEntry.html new file mode 100644 index 00000000..d35f5f9a --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/SevenZipEntry.html @@ -0,0 +1,347 @@ + + + + SevenZipEntry Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipEntry

+
+
+ +
public struct SevenZipEntry : ContainerEntry
+ +
+
+

Represents an entry from the 7-Zip container.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/SevenZipEntryInfo.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/SevenZipEntryInfo.html new file mode 100644 index 00000000..7d729356 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/SevenZipEntryInfo.html @@ -0,0 +1,696 @@ + + + + SevenZipEntryInfo Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

SevenZipEntryInfo

+
+
+ +
public struct SevenZipEntryInfo : ContainerEntryInfo
+ +
+
+

Provides access to information about an entry from the 7-Zip container.

+ + +
+
+ +
+
+
+
+ + +
+ +

ContainerEntryInfo +

+
+
+ +
+
+
+ + +
+ +

7-Zip specific +

+
+
+
    +
  • +
    + + + + winAttributes + +
    +
    +
    +
    +
    +
    +

    Entry’s “win attributes”. 7-Zip internal property. +May be useful when origin file system’s attributes weren’t POSIX compatible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let winAttributes: UInt32?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dosAttributes + +
    +
    +
    +
    +
    +
    +

    Entry’s attributes in DOS format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let dosAttributes: DosAttributes?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasStream + +
    +
    +
    +
    +
    +
    +

    True, if entry has a stream (data) inside the container. 7-Zip internal propety.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let hasStream: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    True, if entry is an empty file. 7-Zip internal property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isEmpty: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isAnti + +
    +
    +
    +
    +
    +
    +

    True, if entry is an anti-file. Used in differential backups to indicate that file should be deleted. +7-Zip internal property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isAnti: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + crc + +
    +
    +
    +
    +
    +
    +

    CRC32 of entry’s data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let crc: UInt32?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarEntry.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarEntry.html new file mode 100644 index 00000000..edb7efea --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarEntry.html @@ -0,0 +1,416 @@ + + + + TarEntry Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarEntry

+
+
+ +
public struct TarEntry : ContainerEntry
+ +
+
+

Represents an entry from the TAR container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + info + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var info: TarEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    +

    Entry’s data (nil if entry is a directory or data isn’t available).

    +
    +

    Note

    + Accessing setter of this property causes info.size to be updated as well so it remains equal to +data.count. If data is set to be nil then info.size is set to zero. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var data: Data? { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(info:data:) + +
    +
    +
    +
    +
    +
    +

    Initializes the entry with its info and data. The stored info.size will also be updated to be equal to +data.count. If data is nil then info.size will be set to zero.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(info: TarEntryInfo, data: Data?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + info + + +
    +

    Information about entry.

    +
    +
    + + data + + +
    +

    Entry’s data; nil if entry is a directory or data isn’t available.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarEntryInfo.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarEntryInfo.html new file mode 100644 index 00000000..4b1afacf --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarEntryInfo.html @@ -0,0 +1,1054 @@ + + + + TarEntryInfo Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarEntryInfo

+
+
+ +
public struct TarEntryInfo : ContainerEntryInfo
+ +
+
+

Provides access to information about an entry from the TAR container.

+ + +
+
+ +
+
+
+
+ + +
+ +

ContainerEntryInfo +

+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Entry’s name.

    + +

    Depending on the particular format of the container, different container’s structures are used +to set this property, in the following preference order:

    + +
      +
    1. Local PAX extended header “path” property.
    2. +
    3. Global PAX extended header “path” property.
    4. +
    5. GNU format type “L” (LongName) entry.
    6. +
    7. Default TAR header.
    8. +
    +
    +

    Note

    + When a new TAR container is created, if name cannot be encoded with ASCII or its ASCII byte-representation +is longer than 100 bytes then a PAX extended header will be created to represent this value correctly, unless other +format is forced. + +
    +

    Note

    + When creating new TAR container, name is always encoded with UTF-8 in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    +

    Entry’s data size.

    +
    +

    Note

    + This property cannot be directly modified. Instead it is updated automatically to be equal to its parent’s +entry.data.count. + +
    +

    Note

    + When a new TAR container is created, if size is bigger than 8589934591 then a PAX extended header will be +created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be +used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var size: Int? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: ContainerEntryType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last access time (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When a new TAR container is created, if accessTime is not nil then a PAX extended header will be created +to store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var accessTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + creationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s creation time (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When a new TAR container is created, if creationTime is not nil then a PAX extended header will be +created to store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var creationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last modification time.

    +
    +

    Note

    + When a new TAR container is created, if modificationTime is bigger than 8589934591 then a PAX extended +header will be created to represent this value correctly, unless other format is forced. In addition, base-256 +encoding will be used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var modificationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permissions + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var permissions: Permissions?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

TAR specific +

+
+
+
    +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Entry’s compression method. Always .copy for the entries of TAR containers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerID + +
    +
    +
    +
    +
    +
    +

    ID of entry’s owner.

    +
    +

    Note

    + When a new TAR container is created, if ownerID is bigger than 2097151 then a PAX extended header will be +created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be +used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ownerID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + groupID + +
    +
    +
    +
    +
    +
    +

    ID of the group of entry’s owner.

    +
    +

    Note

    + When a new TAR container is created, if groupID is bigger than 2097151 then a PAX extended header will be +created to represent this value correctly, unless other format is forced. In addition, base-256 encoding will be +used to encode this value in the basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var groupID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerUserName + +
    +
    +
    +
    +
    +
    +

    User name of entry’s owner.

    +
    +

    Note

    + When a new TAR container is created, if ownerUserName cannot be encoded with ASCII or its ASCII +byte-representation is longer than 32 bytes then a PAX extended header will be created to represent this value +correctly, unless other format is forced. + +
    +

    Note

    + When creating new TAR container, ownerUserName is always encoded with UTF-8 in the ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ownerUserName: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerGroupName + +
    +
    +
    +
    +
    +
    +

    Name of the group of entry’s owner.

    +
    +

    Note

    + When new TAR container is created, if ownerGroupName cannot be encoded with ASCII or its ASCII +byte-representation is longer than 32 bytes then a PAX extended header will be created to represent this value +correctly, unless other format is forced. + +
    +

    Note

    + When creating new TAR container, ownerGroupName is always encoded with UTF-8 in the ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var ownerGroupName: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deviceMajorNumber + +
    +
    +
    +
    +
    +
    +

    Device major number (used when entry is either block or character special file).

    +
    +

    Note

    + When new TAR container is created, if deviceMajorNumber is bigger than 2097151 then base-256 encoding +will be used to encode this value in ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var deviceMajorNumber: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deviceMinorNumber + +
    +
    +
    +
    +
    +
    +

    Device minor number (used when entry is either block or character special file).

    +
    +

    Note

    + When new TAR container is created, if deviceMinorNumber is bigger than 2097151 then base-256 encoding +will be used to encode this value in ustar header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var deviceMinorNumber: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + charset + +
    +
    +
    +
    +
    +
    +

    Name of the character set used to encode entry’s data (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When new TAR container is created, if charset is not nil then a PAX extended header will be created to +store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var charset: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + comment + +
    +
    +
    +
    +
    +
    +

    Entry’s comment (only available for PAX format; nil otherwise).

    +
    +

    Note

    + When new TAR container is created, if comment is not nil then a PAX extended header will be created to +store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var comment: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + linkName + +
    +
    +
    +
    +
    +
    +

    Path to a linked file for symbolic link entry.

    + +

    Depending on the particular format of the container, different container’s structures are used +to set this property, in the following preference order:

    + +
      +
    1. Local PAX extended header “linkpath” property.
    2. +
    3. Global PAX extended header “linkpath” property.
    4. +
    5. GNU format type “K” (LongLink) entry.
    6. +
    7. Default TAR header.
    8. +
    +
    +

    Note

    + When new TAR container is created, if linkName cannot be encoded with ASCII or its ASCII +byte-representation is longer than 100 bytes then a PAX extended header will be created to represent this value +correctly, unless other format is forced. + +
    +

    Note

    + When creating new TAR container, linkName is always encoded with UTF-8 in basic TAR header. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var linkName: String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    All custom (unknown) records from global and local PAX extended headers. nil, if there were no headers.

    +
    +

    Note

    + When new TAR container is created, if unknownExtendedHeaderRecords is not nil then a local PAX +extended header will be created to store this property, unless other format is forced. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var unknownExtendedHeaderRecords: [String : String]?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(name:type:) + +
    +
    +
    +
    +
    +
    +

    Initializes the entry’s info with its name and type.

    +
    +

    Note

    +

    Entry’s type cannot be modified after initialization.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String, type: ContainerEntryType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    Entry’s name.

    +
    +
    + + type + + +
    +

    Entry’s type.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarReader.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarReader.html new file mode 100644 index 00000000..16361de4 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarReader.html @@ -0,0 +1,437 @@ + + + + TarReader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarReader

+
+
+ +
public struct TarReader
+ +
+
+

A type that allows to iteratively read TAR entries from a container provided by a FileHandle.

+ +

The TarReader may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this either +the TarReader.process(_:) function should be used or both the call to TarReader.read() and the processing of the +returned entry should be wrapped inside the autoreleasepool. Since the autoreleasepool is available only on Darwin +platforms, the memory reducing effect may be not as significant on non-Darwin platforms (such as Linux or Windows).

+ +

The following code demonstrates an example usage of the TarReader:

+
   let handle: FileHandle = ...
+   let reader = TarReader(fileHandle: handle)
+   try reader.process { ... }
+   ...
+   try handle.close()
+
+ +

Note that closing the FileHandle remains the responsibility of the caller.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(fileHandle:) + +
    +
    +
    +
    +
    +
    +

    Creates a new instance for reading TAR entries from the provided fileHandle.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileHandle: FileHandle)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + fileHandle + + +
    +

    A handle from which the entries will be read. Note that the TarReader does not close the +fileHandle and this remains the responsibility of the caller.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + process(_:) + +
    +
    +
    +
    +
    +
    +

    Processes the next TAR entry by reading it from the container and calling the provided closure on the result. If +the argument supplied to the closure is nil this indicates that the end of the input was reached.

    + +

    On Darwin platforms both the reading and the call to the closure are performed inside the autoreleasepool which +allows to reduce the peak memory usage.

    +
    +

    Throws

    + DataError.truncated if the input is truncated. TarError is thrown in case of malformed input. Errors +thrown by FileHandle operations are also propagated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func process<T>(_ transform: (TarEntry?) throws -> T) throws -> T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + read() + +
    +
    +
    +
    +
    +
    +

    Reads the next TAR entry from the container.

    + +

    On Darwin platforms it is recommended to wrap both the call to this function and the follow-up processing inside +the autoreleasepool in order to reduce the peak memory usage.

    +
    +

    Throws

    +

    DataError.truncated if the input is truncated. TarError is thrown in case of malformed input. Errors +thrown by FileHandle operations are also propagated.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func read() throws -> TarEntry?
    + +
    +
    +
    +

    Return Value

    +

    The next entry from the container or nil if the end of the input has been reached.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarWriter.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarWriter.html new file mode 100644 index 00000000..21c6042c --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/TarWriter.html @@ -0,0 +1,453 @@ + + + + TarWriter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TarWriter

+
+
+ +
public struct TarWriter
+ +
+
+

A type that allows to iteratively create TAR containers with the output being written into a FileHandle.

+ +

The TarWriter may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this both +the creation of TAR entries and the calls to TarWriter should be wrapped inside the autoreleasepool. Since the +autoreleasepool is available only on Darwin platforms, the memory reducing effect may be not as significant on +non-Darwin platforms (such as Linux or Windows).

+ +

The following code demonstrates an example usage of the TarWriter:

+
   let handle: FileHandle = ...
+   let writer = TarWriter(fileHandle: handle)
+   try autoreleasepool {
+       let entry: TarEntry = ...
+       try writer.append(entry)
+   }
+   try writer.finalize()
+   try handle.close()
+
+ +

Note that TarWriter.finalize() must be called after finishing appending entries to the container. In addition, +closing the FileHandle remains the responsibility of the caller.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a new instance for writing TAR entries using the specified format into the provided fileHandle.

    + +

    The TarWriter will be forced to use the provided format, meaning that certain properties of the entries may +be missing from the output data if the chosen format does not support corresponding features. The default .pax +format supports the largest set of features. Other (non-PAX) formats should only be used if you have a specific +need for them and you understand limitations of those formats.

    +
    +

    Important

    +

    TarWriter.finalize() must be called after all entries have been appended.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fileHandle: FileHandle, force format: TarContainer.Format = .pax)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + fileHandle + + +
    +

    A handle into which the output will be written. Note that the TarWriter does not +close the fileHandle and this remains the responsibility of the caller.

    +
    +
    + + force + + +
    +

    Force the usage of the specified format.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + append(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a new TAR entry at the end of the TAR container.

    + +

    On Darwin platforms it is recommended to wrap both the initialization of a TarEntry and the call to this +function inside the autoreleasepool in order to reduce the peak memory usage.

    +
    +

    Throws

    + Errors from the FileHandle operations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(_ entry: TarEntry) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + finalize() + +
    +
    +
    +
    +
    +
    +

    Finalizes the TAR container by adding an EOF marker.

    +
    +

    Throws

    + Errors from the FileHandle operations. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func finalize() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntry.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntry.html new file mode 100644 index 00000000..1399bef4 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntry.html @@ -0,0 +1,347 @@ + + + + ZipEntry Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipEntry

+
+
+ +
public struct ZipEntry : ContainerEntry
+ +
+
+

Represents an entry from the ZIP container.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + info + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let info: ZipEntryInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + data + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let data: Data?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntryInfo.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntryInfo.html new file mode 100644 index 00000000..155891aa --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntryInfo.html @@ -0,0 +1,861 @@ + + + + ZipEntryInfo Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZipEntryInfo

+
+
+ +
public struct ZipEntryInfo : ContainerEntryInfo
+ +
+
+

Provides access to information about an entry from the ZIP container.

+ + +
+
+ +
+
+
+
+ + +
+ +

ContainerEntryInfo +

+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + size + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let size: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: ContainerEntryType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last access time (nil, if not available).

    + +

    Set from different sources in the following preference order:

    + +
      +
    1. Extended timestamp extra field (most common on UNIX-like systems).
    2. +
    3. NTFS extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let accessTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + creationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s creation time (nil, if not available).

    + +

    Set from different sources in the following preference order:

    + +
      +
    1. Extended timestamp extra field (most common on UNIX-like systems).
    2. +
    3. NTFS extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let creationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + modificationTime + +
    +
    +
    +
    +
    +
    +

    Entry’s last modification time.

    + +

    Set from different sources in the following preference order:

    + +
      +
    1. Extended timestamp extra field (most common on UNIX-like systems).
    2. +
    3. NTFS extra field.
    4. +
    5. ZIP container’s own storage (in Central Directory entry).
    6. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let modificationTime: Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + permissions + +
    +
    +
    +
    +
    +
    +

    Entry’s permissions in POSIX format. +May have meaningless value if origin file system’s attributes weren’t POSIX compatible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let permissions: Permissions?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ZIP specific +

+
+
+
    +
  • +
    + + + + comment + +
    +
    +
    +
    +
    +
    +

    Entry’s comment.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let comment: String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Entry’s external file attributes. ZIP internal property. +May be useful when origin file system’s attributes weren’t POSIX compatible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let externalFileAttributes: UInt32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dosAttributes + +
    +
    +
    +
    +
    +
    +

    Entry’s attributes in DOS format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let dosAttributes: DosAttributes?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isTextFile + +
    +
    +
    +
    +
    +
    +

    True, if entry is likely to be text or ASCII file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isTextFile: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fileSystemType + +
    +
    +
    +
    +
    +
    +

    File system type of container’s origin.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let fileSystemType: FileSystemType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Entry’s compression method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ownerID + +
    +
    +
    +
    +
    +
    +

    ID of entry’s owner.

    + +

    Set from different sources in the following preference order, if possible:

    + +
      +
    1. Info-ZIP New Unix extra field.
    2. +
    3. Info-ZIP Unix extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ownerID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + groupID + +
    +
    +
    +
    +
    +
    +

    ID of the group of entry’s owner.

    + +

    Set from different sources in the following preference order, if possible:

    + +
      +
    1. Info-ZIP New Unix extra field.
    2. +
    3. Info-ZIP Unix extra field.
    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let groupID: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + customExtraFields + +
    +
    +
    +
    +
    +
    +

    Entry’s custom extra fields from both Central Directory and Local Header.

    +
    +

    Note

    + No particular order of extra fields is guaranteed. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let customExtraFields: [ZipExtraField]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + crc + +
    +
    +
    +
    +
    +
    +

    CRC32 of entry’s data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let crc: UInt32
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html new file mode 100644 index 00000000..e3bef053 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html @@ -0,0 +1,466 @@ + + + + ZlibHeader Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZlibHeader

+
+
+ +
public struct ZlibHeader
+ +
+
+

Represents the header of a Zlib archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + CompressionLevel + +
    +
    +
    +
    +
    +
    +

    Levels of compression which can be used to create Zlib archive.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CompressionLevel : Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compressionMethod + +
    +
    +
    +
    +
    +
    +

    Compression method of archive. Always .deflate for Zlib archives.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionMethod: CompressionMethod
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compressionLevel + +
    +
    +
    +
    +
    +
    +

    Level of compression used in archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let compressionLevel: CompressionLevel
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + windowSize + +
    +
    +
    +
    +
    +
    +

    Size of ‘window’: moving interval of data which was used to make archive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let windowSize: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(archive:) + +
    +
    +
    +
    +
    +
    +

    Initializes the structure with the values from Zlib archive.

    + +

    If data passed is not actually a Zlib archive, ZlibError will be thrown.

    +
    +

    Throws

    +

    ZlibError. It may indicate that either archive is damaged or it might not be archived with Zlib at all.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(archive data: Data) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + archive + + +
    +

    Data archived with zlib.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html new file mode 100644 index 00000000..04d62d22 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html @@ -0,0 +1,411 @@ + + + + CompressionLevel Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

CompressionLevel

+
+
+ +
public enum CompressionLevel : Int
+ +
+
+

Levels of compression which can be used to create Zlib archive.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + fastestAlgorithm + +
    +
    +
    +
    +
    +
    +

    Fastest algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fastestAlgorithm = 0
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fastAlgorithm + +
    +
    +
    +
    +
    +
    +

    Fast algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fastAlgorithm = 1
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + defaultAlgorithm + +
    +
    +
    +
    +
    +
    +

    Default algorithm.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case defaultAlgorithm = 2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + slowAlgorithm + +
    +
    +
    +
    +
    +
    +

    Slowest algorithm but with maximum compression.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case slowAlgorithm = 3
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/TAR.html b/docsets/SWCompression.docset/Contents/Resources/Documents/TAR.html new file mode 100644 index 00000000..de339a5e --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/TAR.html @@ -0,0 +1,465 @@ + + + + TAR Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

TAR

+ +
+
+ +
+
+
+
    +
  • +
    + + + + TarContainer + +
    +
    +
    +
    +
    +
    +

    Provides functions for work with TAR containers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class TarContainer : Container
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarReader + +
    +
    +
    +
    +
    +
    +

    A type that allows to iteratively read TAR entries from a container provided by a FileHandle.

    + +

    The TarReader may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this either +the TarReader.process(_:) function should be used or both the call to TarReader.read() and the processing of the +returned entry should be wrapped inside the autoreleasepool. Since the autoreleasepool is available only on Darwin +platforms, the memory reducing effect may be not as significant on non-Darwin platforms (such as Linux or Windows).

    + +

    The following code demonstrates an example usage of the TarReader:

    +
       let handle: FileHandle = ...
    +   let reader = TarReader(fileHandle: handle)
    +   try reader.process { ... }
    +   ...
    +   try handle.close()
    +
    + +

    Note that closing the FileHandle remains the responsibility of the caller.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarWriter + +
    +
    +
    +
    +
    +
    +

    A type that allows to iteratively create TAR containers with the output being written into a FileHandle.

    + +

    The TarWriter may be helpful in reducing the peak memory usage on certain platforms. However, to achieve this both +the creation of TAR entries and the calls to TarWriter should be wrapped inside the autoreleasepool. Since the +autoreleasepool is available only on Darwin platforms, the memory reducing effect may be not as significant on +non-Darwin platforms (such as Linux or Windows).

    + +

    The following code demonstrates an example usage of the TarWriter:

    +
       let handle: FileHandle = ...
    +   let writer = TarWriter(fileHandle: handle)
    +   try autoreleasepool {
    +       let entry: TarEntry = ...
    +       try writer.append(entry)
    +   }
    +   try writer.finalize()
    +   try handle.close()
    +
    + +

    Note that TarWriter.finalize() must be called after finishing appending entries to the container. In addition, +closing the FileHandle remains the responsibility of the caller.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarEntry + +
    +
    +
    +
    +
    +
    +

    Represents an entry from the TAR container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarEntry : ContainerEntry
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TarEntryInfo + +
    +
    +
    +
    +
    +
    +

    Provides access to information about an entry from the TAR container.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct TarEntryInfo : ContainerEntryInfo
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/ZIP.html b/docsets/SWCompression.docset/Contents/Resources/Documents/ZIP.html new file mode 100644 index 00000000..86ba48bc --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/ZIP.html @@ -0,0 +1,431 @@ + + + + ZIP Reference + + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+

ZIP

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/badge.svg b/docsets/SWCompression.docset/Contents/Resources/Documents/badge.svg new file mode 100644 index 00000000..a096feca --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 100% + + + 100% + + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/css/highlight.css b/docsets/SWCompression.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 00000000..c170357c --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,202 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight .c { + color: #999988; + font-style: italic; } + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; } + +.highlight .k { + color: #000000; + font-weight: bold; } + +.highlight .o { + color: #000000; + font-weight: bold; } + +.highlight .cm { + color: #999988; + font-style: italic; } + +.highlight .cp { + color: #999999; + font-weight: bold; } + +.highlight .c1 { + color: #999988; + font-style: italic; } + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + +.highlight .gd { + color: #000000; + background-color: #ffdddd; } + +.highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + +.highlight .ge { + color: #000000; + font-style: italic; } + +.highlight .gr { + color: #aa0000; } + +.highlight .gh { + color: #999999; } + +.highlight .gi { + color: #000000; + background-color: #ddffdd; } + +.highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + +.highlight .go { + color: #888888; } + +.highlight .gp { + color: #555555; } + +.highlight .gs { + font-weight: bold; } + +.highlight .gu { + color: #aaaaaa; } + +.highlight .gt { + color: #aa0000; } + +.highlight .kc { + color: #000000; + font-weight: bold; } + +.highlight .kd { + color: #000000; + font-weight: bold; } + +.highlight .kp { + color: #000000; + font-weight: bold; } + +.highlight .kr { + color: #000000; + font-weight: bold; } + +.highlight .kt { + color: #445588; } + +.highlight .m { + color: #009999; } + +.highlight .s { + color: #d14; } + +.highlight .na { + color: #008080; } + +.highlight .nb { + color: #0086B3; } + +.highlight .nc { + color: #445588; + font-weight: bold; } + +.highlight .no { + color: #008080; } + +.highlight .ni { + color: #800080; } + +.highlight .ne { + color: #990000; + font-weight: bold; } + +.highlight .nf { + color: #990000; } + +.highlight .nn { + color: #555555; } + +.highlight .nt { + color: #000080; } + +.highlight .nv { + color: #008080; } + +.highlight .ow { + color: #000000; + font-weight: bold; } + +.highlight .w { + color: #bbbbbb; } + +.highlight .mf { + color: #009999; } + +.highlight .mh { + color: #009999; } + +.highlight .mi { + color: #009999; } + +.highlight .mo { + color: #009999; } + +.highlight .sb { + color: #d14; } + +.highlight .sc { + color: #d14; } + +.highlight .sd { + color: #d14; } + +.highlight .s2 { + color: #d14; } + +.highlight .se { + color: #d14; } + +.highlight .sh { + color: #d14; } + +.highlight .si { + color: #d14; } + +.highlight .sx { + color: #d14; } + +.highlight .sr { + color: #009926; } + +.highlight .s1 { + color: #d14; } + +.highlight .ss { + color: #990073; } + +.highlight .bp { + color: #999999; } + +.highlight .vc { + color: #008080; } + +.highlight .vg { + color: #008080; } + +.highlight .vi { + color: #008080; } + +.highlight .il { + color: #009999; } diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css b/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 00000000..9d4b08b8 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,405 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + a.discouraged { + text-decoration: line-through; } + a.discouraged:hover, a.discouraged:focus { + text-decoration: underline line-through; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +hr { + height: 1px; + border: none; + background-color: #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { + background: #f7f7f7; + padding: .2em; } + .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 2px; + vertical-align: -3px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + .section-name p { + margin-bottom: inherit; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.section-name-container { + position: relative; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 20px; + font-size: 1rem; } + +.declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } + +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } + +form[role=search] .tt-highlight { + font-weight: bold; } + +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/img/carat.png b/docsets/SWCompression.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 00000000..29d2f7fd Binary files /dev/null and b/docsets/SWCompression.docset/Contents/Resources/Documents/img/carat.png differ diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/img/dash.png b/docsets/SWCompression.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 00000000..6f694c7a Binary files /dev/null and b/docsets/SWCompression.docset/Contents/Resources/Documents/img/dash.png differ diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/img/gh.png b/docsets/SWCompression.docset/Contents/Resources/Documents/img/gh.png new file mode 100755 index 00000000..628da97c Binary files /dev/null and b/docsets/SWCompression.docset/Contents/Resources/Documents/img/gh.png differ diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/img/spinner.gif b/docsets/SWCompression.docset/Contents/Resources/Documents/img/spinner.gif new file mode 100644 index 00000000..e3038d0a Binary files /dev/null and b/docsets/SWCompression.docset/Contents/Resources/Documents/img/spinner.gif differ diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/index.html b/docsets/SWCompression.docset/Contents/Resources/Documents/index.html new file mode 100644 index 00000000..ba2637dd --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,492 @@ + + + + SWCompression Reference + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+ +

SWCompression

+ +

Swift 5.9+ +GitHub license +Build Status

+ +

A framework with (de)compression algorithms and functions for working with various archives and containers.

+

What is this?

+ +

SWCompression is a framework with a collection of functions for:

+ +
    +
  1. Decompression (and sometimes compression) using different algorithms.
  2. +
  3. Reading (and sometimes writing) archives of different formats.
  4. +
  5. Reading (and sometimes writing) containers such as ZIP, TAR and 7-Zip.
  6. +
+ +

It also works on Apple platforms, Linux, and Windows.

+ +

All features are listed in the tables below. “TBD” means that feature is planned but not implemented (yet).

+ + + + + + + + + + + + + + + + + + + + + + + + +
DeflateBZip2LZMA/LZMA2LZ4
Decompression
CompressionTBD
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZlibGZipXZZIPTAR7-Zip
Read
WriteTBDTBDTBD
+ +

Also, SWCompression is written with Swift only.

+

Installation

+ +

SWCompression can be integrated into your project using Swift Package Manager.

+ +

Note: SWCompression versions 4.8.6 and earlier were also made available via CocoaPods or Carthage.

+ +

To install with Swift Package manager, add SWCompression to you package dependencies and specify it as a dependency for +your target, e.g.:

+
import PackageDescription
+
+let package = Package(
+    name: "PackageName",
+    dependencies: [
+        .package(name: "SWCompression", url: "https://github.com/tsolomko/SWCompression.git",
+                 from: "4.9.0")
+    ],
+    targets: [
+        .target(
+            name: "TargetName",
+            dependencies: ["SWCompression"]
+        )
+    ]
+)
+
+ +

More details you can find in Swift Package Manager’s Documentation.

+

Usage

+

Basic Example

+ +

For example, if you want to decompress “deflated” data just use:

+
// let data = <Your compressed data>
+let decompressedData = try? Deflate.decompress(data: data)
+
+ +

However, it is unlikely that you will encounter deflated data outside of any archive. So, in the case of GZip archive +you should use:

+
let decompressedData = try? GzipArchive.unarchive(archive: data)
+
+

Handling Errors

+ +

Most SWCompression functions can throw errors and you are responsible for handling them. If you look at the list of +available error types and their cases, you may be frightened by their number. However, most of the cases (such as +XZError.wrongMagic) exist for diagnostic purposes.

+ +

Thus, you only need to handle the most common type of error for your archive/algorithm. For example:

+
do {
+    // let data = <Your compressed data>
+    let decompressedData = try XZArchive.unarchive(archive: data)
+} catch let error as XZError {
+    // <handle XZ related error here>
+} catch let error {
+    // <handle all other errors here>
+}
+
+

Documentation

+ +

Every function or type of SWCompression’s public API is documented. This documentation can be found at its own +website or via a slightly shorter link: +swcompression.tsolomko.me

+

Sophisticated example

+ +

There is a small command-line program, “swcomp”, which is included in this repository in “Sources/swcomp”. It can be +built using Swift Package Manager (only available on macOS).

+ +

IMPORTANT: The “swcomp” command-line tool is NOT intended for general use.

+

Contributing

+ +

Whether you find a bug, have a suggestion, idea, feedback or something else, please +create an issue on GitHub. If you have any questions, you can ask +them on the Discussions page.

+ +

In the case of a bug, it will be especially helpful if you attach a file (archive, etc.) that caused the bug to occur.

+ +

If you’d like to contribute, please create a pull request on GitHub.

+

Executing tests locally

+ +

If you want to run tests on your computer, you need to do a couple of additional steps after cloning the repository:

+
git submodule update --init --recursive
+cd "Tests/Test Files"
+cp gitattributes-copy .gitattributes
+git lfs pull
+git lfs checkout
+
+ +

These commands will download the files used in tests which are stored in a +separate repository using Git LFS. There are two reasons for +this complicated setup. Firstly, some of these files can be quite big, and it would be unfortunate if the users of +SWCompression had to download them during the installation. Secondly, Swift Package Manager and contemporary versions of +Xcode don’t always work well with git-lfs-enabled repositories. To prevent any potential problems test files were moved +into another repository.

+ +

Please note, that if you want to add a new type of test files, in addition to running git lfs track, you have to +also copy into the “Tests/Test Files/gitattributes-copy” file a line this command adds to the “Tests/Test Files/.gitattributes” +file. Do not commit the “.gitattributes” file to the git history. It is git-ignored for a reason!

+ +

Please also be mindful of Git LFS bandwidth quota on GitHub: try to limit downloading lfs’d files using git lfs pull. +In CI we use some caching techniques to help with the quota, so if you’re going to add new tests that require several +new test files you should try to submit them all together to reduce the amount of times CI needs to recreate the cache +(recreating the cache requires to do git lfs pull for all test files).

+

Performance

+ +

Using whole module optimizations is recommended for the best performance. They are enabled by default in the Release build +configuration.

+ +

Tests Results document contains results of benchmarking of various functions.

+

Why?

+ +

First of all, existing solutions for working with compression, archives and containers have certain disadvantages. They +might not support a particular compression algorithm or archive format and they all have different APIs, which sometimes +can be slightly confusing for users, especially when you mix different libraries in one project. This project attempts to +provide missing (and sometimes existing) functionality through the unified API which is easy to use and remember.

+ +

Secondly, in some cases it may be important to have a compression framework written entirely in Swift, without relying +on either system libraries or solutions implemented in other languages. Additionaly, since SWCompression is written +completely in Swift without Objective-C, it can also be used on Linux, and Windows.

+

Future plans

+ +
    +
  • Performance…
  • +
  • Better Deflate compression.
  • +
  • Something else…
  • +
+

License

+ +

MIT licensed

+

References

+ + + +
+
+ + +
+
+ + + diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js b/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 00000000..1ac86992 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targeted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.search.js b/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.search.js new file mode 100644 index 00000000..359cdbb8 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.search.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
'; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
'; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/js/jquery.min.js b/docsets/SWCompression.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100644 index 00000000..7f37b5d9 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/js/typeahead.jquery.js b/docsets/SWCompression.docset/Contents/Resources/Documents/js/typeahead.jquery.js new file mode 100644 index 00000000..bcb734be --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/js/typeahead.jquery.js @@ -0,0 +1,1695 @@ +/*! + * typeahead.js 1.3.3 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2024 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + "aria-controls": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
"); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
"); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
"); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
"); + $menu = this.menu.$node || $("
"); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/search.json b/docsets/SWCompression.docset/Contents/Resources/Documents/search.json new file mode 100644 index 00000000..33742659 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO3fatyA2CmF":{"name":"fat","abstract":"

FAT filesystem.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO9macintoshyA2CmF":{"name":"macintosh","abstract":"

Filesystem of older Macintosh systems.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO4ntfsyA2CmF":{"name":"ntfs","abstract":"

NTFS.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO5otheryA2CmF":{"name":"other","abstract":"

Other/unknown file system.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO4unixyA2CmF":{"name":"unix","abstract":"

One of many file systems of UNIX-like OS.

","parent_name":"FileSystemType"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO5bzip2yA2CmF":{"name":"bzip2","abstract":"

BZip2.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO4copyyA2CmF":{"name":"copy","abstract":"

Copy (no compression).

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO7deflateyA2CmF":{"name":"deflate","abstract":"

Deflate.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO4lzmayA2CmF":{"name":"lzma","abstract":"

LZMA.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO5lzma2yA2CmF":{"name":"lzma2","abstract":"

LZMA 2.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO5otheryA2CmF":{"name":"other","abstract":"

Other/unknown method.

","parent_name":"CompressionMethod"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV8rawValues6UInt32Vvp":{"name":"rawValue","abstract":"

Raw bit flags value (in decimal).

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV8rawValueACs6UInt32V_tcfc":{"name":"init(rawValue:)","abstract":"

Initializes permissions with bit flags in decimal.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV6setuidACvpZ":{"name":"setuid","abstract":"

Set UID.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV6setgidACvpZ":{"name":"setgid","abstract":"

Set GID.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV6stickyACvpZ":{"name":"sticky","abstract":"

Sticky bit.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV9readOwnerACvpZ":{"name":"readOwner","abstract":"

Owner can read.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV10writeOwnerACvpZ":{"name":"writeOwner","abstract":"

Owner can write.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV12executeOwnerACvpZ":{"name":"executeOwner","abstract":"

Owner can execute.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV9readGroupACvpZ":{"name":"readGroup","abstract":"

Group can read.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV10writeGroupACvpZ":{"name":"writeGroup","abstract":"

Group can write.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV12executeGroupACvpZ":{"name":"executeGroup","abstract":"

Group can execute.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV9readOtherACvpZ":{"name":"readOther","abstract":"

Others can read.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV10writeOtherACvpZ":{"name":"writeOther","abstract":"

Others can write.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV12executeOtherACvpZ":{"name":"executeOther","abstract":"

Others can execute.

","parent_name":"Permissions"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV8rawValues6UInt32Vvp":{"name":"rawValue","abstract":"

Raw bit flags value.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV8rawValueACs6UInt32V_tcfc":{"name":"init(rawValue:)","abstract":"

Initializes attributes with bit flags.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV7archiveACvpZ":{"name":"archive","abstract":"

File is archive or archived.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV9directoryACvpZ":{"name":"directory","abstract":"

File is a directory.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV6volumeACvpZ":{"name":"volume","abstract":"

File is a volume.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV6systemACvpZ":{"name":"system","abstract":"

File is a system file.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV6hiddenACvpZ":{"name":"hidden","abstract":"

File is hidden.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV8readOnlyACvpZ":{"name":"readOnly","abstract":"

File is read-only.

","parent_name":"DosAttributes"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO12blockSpecialyA2CmF":{"name":"blockSpecial","abstract":"

Block special file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO16characterSpecialyA2CmF":{"name":"characterSpecial","abstract":"

Character special file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO10contiguousyA2CmF":{"name":"contiguous","abstract":"

Contiguous file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO9directoryyA2CmF":{"name":"directory","abstract":"

Directory.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO4fifoyA2CmF":{"name":"fifo","abstract":"

FIFO special file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO8hardLinkyA2CmF":{"name":"hardLink","abstract":"

Hard link.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO7regularyA2CmF":{"name":"regular","abstract":"

Regular file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO6socketyA2CmF":{"name":"socket","abstract":"

Socket.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO12symbolicLinkyA2CmF":{"name":"symbolicLink","abstract":"

Symbolic link.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO7unknownyA2CmF":{"name":"unknown","abstract":"

Entry type is unknown.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html":{"name":"ContainerEntryType","abstract":"

Represents the type of a container entry.

"},"Structs/DosAttributes.html":{"name":"DosAttributes","abstract":"

Represents file attributes in DOS format.

"},"Structs/Permissions.html":{"name":"Permissions","abstract":"

Represents file access permissions in UNIX format.

"},"Enums/CompressionMethod.html":{"name":"CompressionMethod","abstract":"

Represents a (de)compression method.

"},"Enums/FileSystemType.html":{"name":"FileSystemType","abstract":"

Represents the type of the file system on which an archive or container was created. File system determines the meaning"},"Protocols/DecompressionAlgorithm.html#/s:13SWCompression22DecompressionAlgorithmP10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompress data compressed with particular algorithm.

","parent_name":"DecompressionAlgorithm"},"Protocols/CompressionAlgorithm.html#/s:13SWCompression20CompressionAlgorithmP8compress4data10Foundation4DataVAH_tKFZ":{"name":"compress(data:)","abstract":"

Compress data with particular algorithm.

","parent_name":"CompressionAlgorithm"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4nameSSvp":{"name":"name","abstract":"

Entry’s name.

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","abstract":"

Entry’s type.

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4sizeSiSgvp":{"name":"size","abstract":"

Entry’s data size (can be nil if either data or size aren’t available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP10accessTime10Foundation4DateVSgvp":{"name":"accessTime","abstract":"

Entry’s last access time (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP12creationTime10Foundation4DateVSgvp":{"name":"creationTime","abstract":"

Entry’s creation time (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

Entry’s last modification time (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP11permissionsAA11PermissionsVSgvp":{"name":"permissions","abstract":"

Entry’s permissions in POSIX format (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntry.html#/s:13SWCompression14ContainerEntryP4InfoQa":{"name":"Info","abstract":"

A type that provides information about an entry.

","parent_name":"ContainerEntry"},"Protocols/ContainerEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","abstract":"

Provides access to information about the entry.

","parent_name":"ContainerEntry"},"Protocols/ContainerEntry.html#/s:13SWCompression14ContainerEntryP4data10Foundation4DataVSgvp":{"name":"data","abstract":"

Entry’s data (nil if entry is a directory or data isn’t available).

","parent_name":"ContainerEntry"},"Protocols/Container.html#/s:13SWCompression9ContainerP5EntryQa":{"name":"Entry","abstract":"

A type that represents an entry from this container.

","parent_name":"Container"},"Protocols/Container.html#/s:13SWCompression9ContainerP4open9containerSay5EntryQzG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

Retrieve all container entries with their data.

","parent_name":"Container"},"Protocols/Container.html#/s:13SWCompression9ContainerP4info9containerSay5Entry_4InfoQZG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

Retrieve information about all container entries (without their data).

","parent_name":"Container"},"Protocols/Archive.html#/s:13SWCompression7ArchiveP9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchive data from the archive.

","parent_name":"Archive"},"Protocols/Archive.html":{"name":"Archive","abstract":"

A type that represents an archive.

"},"Protocols/Container.html":{"name":"Container","abstract":"

A type that represents a container with files, directories and/or other data.

"},"Protocols/ContainerEntry.html":{"name":"ContainerEntry","abstract":"

A type that represents an entry from the container with its data and information.

"},"Protocols/ContainerEntryInfo.html":{"name":"ContainerEntryInfo","abstract":"

A type that provides access to information about an entry from the container.

"},"Protocols/CompressionAlgorithm.html":{"name":"CompressionAlgorithm","abstract":"

A type that provides an implementation of a particular compression algorithm.

"},"Protocols/DecompressionAlgorithm.html":{"name":"DecompressionAlgorithm","abstract":"

A type that provides an implementation of a particular decompression algorithm.

"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO22wrongCompressionMethodyA2CmF":{"name":"wrongCompressionMethod","abstract":"

Compression method used in archive is different from Deflate, which is the only supported one.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO20wrongCompressionInfoyA2CmF":{"name":"wrongCompressionInfo","abstract":"

Compression info has value incompatible with Deflate compression method.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO11wrongFcheckyA2CmF":{"name":"wrongFcheck","abstract":"

First two bytes of archive’s flags are inconsistent with each other.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO21wrongCompressionLevelyA2CmF":{"name":"wrongCompressionLevel","abstract":"

Compression level has value, which is different from the supported ones.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO12wrongAdler32yAC10Foundation4DataVcACmF":{"name":"wrongAdler32(_:)","abstract":"

Computed checksum of uncompressed data doesn’t match the value stored in archive.","parent_name":"ZlibError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO27notFoundCentralDirectoryEndyA2CmF":{"name":"notFoundCentralDirectoryEnd","abstract":"

End of Central Directoty record wasn’t found.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO14wrongSignatureyA2CmF":{"name":"wrongSignature","abstract":"

Wrong signature of one of container’s structures.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO9wrongSizeyA2CmF":{"name":"wrongSize","abstract":"

Wrong either compressed or uncompressed size of a container’s entry.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO12wrongVersionyA2CmF":{"name":"wrongVersion","abstract":"

Version needed to process container is unsupported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO24multiVolumesNotSupportedyA2CmF":{"name":"multiVolumesNotSupported","abstract":"

Container is either spanned or consists of several volumes. These features aren’t supported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO22encryptionNotSupportedyA2CmF":{"name":"encryptionNotSupported","abstract":"

Entry or record is encrypted. This feature isn’t supported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO20patchingNotSupportedyA2CmF":{"name":"patchingNotSupported","abstract":"

Entry contains patched data. This feature isn’t supported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO23compressionNotSupportedyA2CmF":{"name":"compressionNotSupported","abstract":"

Entry is compressed using unsupported compression method.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO16wrongLocalHeaderyA2CmF":{"name":"wrongLocalHeader","abstract":"

Local header of an entry is inconsistent with Central Directory.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO8wrongCRCyACSayAA0B5EntryVGcACmF":{"name":"wrongCRC(_:)","abstract":"

Computed checksum of entry’s data doesn’t match the value stored in the archive.","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO14wrongTextFieldyA2CmF":{"name":"wrongTextField","abstract":"

Either entry’s comment or file name cannot be processed using UTF-8 encoding.

","parent_name":"ZipError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO10wrongMagicyA2CmF":{"name":"wrongMagic","abstract":"

Either ‘magic’ number in header or footer isn’t equal to a predefined value.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO10wrongFieldyA2CmF":{"name":"wrongField","abstract":"

One of the special fields in archive has an incorrect value,","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO12wrongInfoCRCyA2CmF":{"name":"wrongInfoCRC","abstract":"

Checksum of one of the fields of archive doesn’t match the value stored in archive.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO13wrongFilterIDyA2CmF":{"name":"wrongFilterID","abstract":"

Filter used in archive is unsupported.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO15checkTypeSHA256yA2CmF":{"name":"checkTypeSHA256","abstract":"

Archive uses SHA-256 checksum which is unsupported.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO13wrongDataSizeyA2CmF":{"name":"wrongDataSize","abstract":"

Either size of decompressed data isn’t equal to the one specified in archive or","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO10wrongCheckyACSay10Foundation4DataVGcACmF":{"name":"wrongCheck(_:)","abstract":"

Computed checksum of uncompressed data doesn’t match the value stored in the archive.","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO12wrongPaddingyA2CmF":{"name":"wrongPadding","abstract":"

Padding (null-bytes appended to an archive’s structure) is incorrect.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO21multiByteIntegerErroryA2CmF":{"name":"multiByteIntegerError","abstract":"

Either null byte encountered or exceeded maximum amount bytes while reading multi byte number.

","parent_name":"XZError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO20tooSmallFileIsPassedyA2CmF":{"name":"tooSmallFileIsPassed","abstract":"

Data is unexpectedly truncated.

","parent_name":"TarError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO10wrongFieldyA2CmF":{"name":"wrongField","abstract":"

Failed to process a required TAR header’s field.

","parent_name":"TarError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO19wrongHeaderChecksumyA2CmF":{"name":"wrongHeaderChecksum","abstract":"

Computed checksum of a header doesn’t match the value stored in container.

","parent_name":"TarError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO19wrongPaxHeaderEntryyA2CmF":{"name":"wrongPaxHeaderEntry","abstract":"

Entry from PAX extended header is in incorrect format.

","parent_name":"TarError"},"Enums/TarCreateError.html#/s:13SWCompression14TarCreateErrorO16utf8NonEncodableyA2CmF":{"name":"utf8NonEncodable","abstract":"

One of the TarEntryInfo‘s string properties (such as name) cannot be encoded with UTF-8 encoding.

","parent_name":"TarCreateError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO14wrongSignatureyA2CmF":{"name":"wrongSignature","abstract":"

Wrong container’s signature.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO18wrongFormatVersionyA2CmF":{"name":"wrongFormatVersion","abstract":"

Unsupported version of container’s format.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO8wrongCRCyA2CmF":{"name":"wrongCRC","abstract":"

CRC either of one of the files from the container or one of the container’s strucutures is incorrect.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO9wrongSizeyA2CmF":{"name":"wrongSize","abstract":"

Size either of one of the files from the container or one of the container’s strucutures is incorrect.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO20startPosNotSupportedyA2CmF":{"name":"startPosNotSupported","abstract":"

Files have StartPos property. This feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO20externalNotSupportedyA2CmF":{"name":"externalNotSupported","abstract":"

External feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO23multiStreamNotSupportedyA2CmF":{"name":"multiStreamNotSupported","abstract":"

Coders with multiple in and/or out streams aren’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO29additionalStreamsNotSupportedyA2CmF":{"name":"additionalStreamsNotSupported","abstract":"

Additional streams feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO23compressionNotSupportedyA2CmF":{"name":"compressionNotSupported","abstract":"

Entry is compressed using unsupported compression method.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO22encryptionNotSupportedyA2CmF":{"name":"encryptionNotSupported","abstract":"

Entry or container’s header is encrypted. This feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO017internalStructureD0yA2CmF":{"name":"internalStructureError","abstract":"

Unknown/incorrect internal 7-Zip structure was encountered or a required internal structure is missing.

","parent_name":"SevenZipError"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO19wrongDictionarySizeyA2CmF":{"name":"wrongDictionarySize","abstract":"

Dictionary size is too big, or has reserved bits set, or is in incorrect format in general.

","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO16wrongControlByteyA2CmF":{"name":"wrongControlByte","abstract":"

Unknown conrol byte value of LZMA2 packet.

","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO10wrongResetyA2CmF":{"name":"wrongReset","abstract":"

Unknown reset instruction encountered in LZMA2 packet.

","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO10wrongSizesyA2CmF":{"name":"wrongSizes","abstract":"

Either size of decompressed data isn’t equal to the one specified in LZMA2 packet or","parent_name":"LZMA2Error"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO15wrongPropertiesyA2CmF":{"name":"wrongProperties","abstract":"

Properties’ byte is greater than 225.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO21rangeDecoderInitErroryA2CmF":{"name":"rangeDecoderInitError","abstract":"

Unable to initialize RanderDecorer.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO24exceededUncompressedSizeyA2CmF":{"name":"exceededUncompressedSize","abstract":"

Size of uncompressed data hit specified limit in the middle of decoding.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO13windowIsEmptyyA2CmF":{"name":"windowIsEmpty","abstract":"

Unable to perfrom repeat-distance decoding because there is nothing to repeat.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO23rangeDecoderFinishErroryA2CmF":{"name":"rangeDecoderFinishError","abstract":"

End of stream marker is reached, but range decoder is in incorrect state.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO16repeatWillExceedyA2CmF":{"name":"repeatWillExceed","abstract":"

The number of bytes to repeat is greater than the amount bytes that is left to decode.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO17notEnoughToRepeatyA2CmF":{"name":"notEnoughToRepeat","abstract":"

The amount of already decoded bytes is smaller than repeat length.

","parent_name":"LZMAError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO10wrongMagicyA2CmF":{"name":"wrongMagic","abstract":"

First two bytes (‘magic’ number) of archive isn’t 31 and 139.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO22wrongCompressionMethodyA2CmF":{"name":"wrongCompressionMethod","abstract":"

Compression method used in archive is different from Deflate, which is the only supported one.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO10wrongFlagsyA2CmF":{"name":"wrongFlags","abstract":"

One of the reserved fields in archive has an unexpected value, which can also mean (apart from damaged archive),","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO14wrongHeaderCRCyA2CmF":{"name":"wrongHeaderCRC","abstract":"

Computed CRC of archive’s header doesn’t match the value stored in archive.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO8wrongCRCyACSayAA0B7ArchiveC6MemberVGcACmF":{"name":"wrongCRC(_:)","abstract":"

Computed checksum of uncompressed data doesn’t match the value stored in the archive.","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO10wrongISizeyA2CmF":{"name":"wrongISize","abstract":"

Computed ‘isize’ didn’t match the value stored in the archive.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO21cannotEncodeISOLatin1yA2CmF":{"name":"cannotEncodeISOLatin1","abstract":"

Either specified file name or comment cannot be encoded using ISO Latin-1 encoding.

","parent_name":"GzipError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO29wrongUncompressedBlockLengthsyA2CmF":{"name":"wrongUncompressedBlockLengths","abstract":"

Uncompressed block’s length and nlength bytes isn’t consistent with each other.

","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO14wrongBlockTypeyA2CmF":{"name":"wrongBlockType","abstract":"

Unknown block type (not 0, 1 or 2).

","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO11wrongSymbolyA2CmF":{"name":"wrongSymbol","abstract":"

Decoded symbol was found in Huffman tree but is unknown.

","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO14symbolNotFoundyA2CmF":{"name":"symbolNotFound","abstract":"

Symbol wasn’t found in Huffman tree.

","parent_name":"DeflateError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO9truncatedyA2CmF":{"name":"truncated","abstract":"

Indicates that input data is likely truncated or incomplete.

","parent_name":"DataError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO9corruptedyA2CmF":{"name":"corrupted","abstract":"

Indicates that input data is corrupted, e.g. does not conform to the format specifications or contains other","parent_name":"DataError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO16checksumMismatchyACSay10Foundation0B0VGcACmF":{"name":"checksumMismatch(_:)","abstract":"

Indicates that the computed checksum of the output data does not match the stored checksum. While usually the","parent_name":"DataError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO18unsupportedFeatureyA2CmF":{"name":"unsupportedFeature","abstract":"

Indicates that input data was created using a feature that is not supported by the processing function.

","parent_name":"DataError"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO10wrongMagicyA2CmF":{"name":"wrongMagic","abstract":"

‘Magic’ number is not 0x425a.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO12wrongVersionyA2CmF":{"name":"wrongVersion","abstract":"

BZip version is not 2.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO14wrongBlockSizeyA2CmF":{"name":"wrongBlockSize","abstract":"

Unsupported block size (not from ‘0’ to ‘9’).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO14wrongBlockTypeyA2CmF":{"name":"wrongBlockType","abstract":"

Unsupported block type (is neither ‘pi’ nor ‘sqrt(pi)’).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO15randomizedBlockyA2CmF":{"name":"randomizedBlock","abstract":"

Block is randomized.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO18wrongHuffmanGroupsyA2CmF":{"name":"wrongHuffmanGroups","abstract":"

Wrong number of Huffman tables/groups (should be between 2 and 6).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO13wrongSelectoryA2CmF":{"name":"wrongSelector","abstract":"

Selector is greater than the total number of Huffman tables/groups.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO22wrongHuffmanCodeLengthyA2CmF":{"name":"wrongHuffmanCodeLength","abstract":"

Wrong length of Huffman code (should be between 0 and 20).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO14symbolNotFoundyA2CmF":{"name":"symbolNotFound","abstract":"

Symbol wasn’t found in Huffman tree.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO8wrongCRCyAC10Foundation4DataVcACmF":{"name":"wrongCRC(_:)","abstract":"

Computed checksum of the uncompressed data does not match the value stored in the archive.","parent_name":"BZip2Error"},"Enums/BZip2Error.html":{"name":"BZip2Error","abstract":"

Represents an error which happened during BZip2 decompression."},"Enums/DataError.html":{"name":"DataError","abstract":"

Represents an error which happened during processing input data.

"},"Enums/DeflateError.html":{"name":"DeflateError","abstract":"

Represents an error which happened during Deflate compression or decompression."},"Enums/GzipError.html":{"name":"GzipError","abstract":"

Represents an error which happened while processing a GZip archive."},"Enums/LZMAError.html":{"name":"LZMAError","abstract":"

Represents an error which happened during LZMA decompression."},"Enums/LZMA2Error.html":{"name":"LZMA2Error","abstract":"

Represents an error which happened during LZMA2 decompression."},"Enums/SevenZipError.html":{"name":"SevenZipError","abstract":"

Represents an error which happened while processing a 7-Zip container."},"Enums/TarCreateError.html":{"name":"TarCreateError","abstract":"

Represents an error which happened during the creation of a new TAR container.

"},"Enums/TarError.html":{"name":"TarError","abstract":"

Represents an error which happened while processing a TAR container."},"Enums/XZError.html":{"name":"XZError","abstract":"

Represents an error which happened while unarchiving an XZ archive."},"Enums/ZipError.html":{"name":"ZipError","abstract":"

Represents an error which happened while processing a ZIP container."},"Enums/ZlibError.html":{"name":"ZlibError","abstract":"

Represents an error which happened while processing a Zlib archive."},"Enums/ZipExtraFieldLocation.html#/s:13SWCompression21ZipExtraFieldLocationO16centralDirectoryyA2CmF":{"name":"centralDirectory","abstract":"

ZIP extra field is located in container’s Central Directory.

","parent_name":"ZipExtraFieldLocation"},"Enums/ZipExtraFieldLocation.html#/s:13SWCompression21ZipExtraFieldLocationO11localHeaderyA2CmF":{"name":"localHeader","abstract":"

ZIP extra field is located in one of container’s Local Headers.

","parent_name":"ZipExtraFieldLocation"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP2ids6UInt16VvpZ":{"name":"id","abstract":"

ID of extra field. Must be equal to the key of extra field in ZipContainer.customExtraFields dictionary and","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP8locationAA0bcD8LocationOvp":{"name":"location","abstract":"

Location of extra field. Must be equal to the value of location argument of init?(_:_:location:).

","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP4sizeSivp":{"name":"size","abstract":"

Size of extra field’s data. Must be equal to the value of the second argument of init?(_:_:location:).

","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP__8locationxSg11BitByteData012LittleEndianG6ReaderC_SiAA0bcD8LocationOtcfc":{"name":"init(_:_:location:)","abstract":"

Creates an extra field instance reading size amount of data from byteReader.

","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldPAAE2ids6UInt16Vvp":{"name":"id","abstract":"

ID of extra field. Must be equal to the key of extra field in ZipContainer.customExtraFields dictionary and","parent_name":"ZipExtraField"},"Structs/ZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4nameSSvp":{"name":"name","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4sizeSiSgvp":{"name":"size","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV10accessTime10Foundation4DateVSgvp":{"name":"accessTime","abstract":"

Entry’s last access time (nil, if not available).

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV12creationTime10Foundation4DateVSgvp":{"name":"creationTime","abstract":"

Entry’s creation time (nil, if not available).

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

Entry’s last modification time.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV11permissionsAA11PermissionsVSgvp":{"name":"permissions","abstract":"

Entry’s permissions in POSIX format.","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV7commentSSvp":{"name":"comment","abstract":"

Entry’s comment.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV22externalFileAttributess6UInt32Vvp":{"name":"externalFileAttributes","abstract":"

Entry’s external file attributes. ZIP internal property.","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV13dosAttributesAA03DosF0VSgvp":{"name":"dosAttributes","abstract":"

Entry’s attributes in DOS format.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV10isTextFileSbvp":{"name":"isTextFile","abstract":"

True, if entry is likely to be text or ASCII file.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV14fileSystemTypeAA04FilefG0Ovp":{"name":"fileSystemType","abstract":"

File system type of container’s origin.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV17compressionMethodAA011CompressionF0Ovp":{"name":"compressionMethod","abstract":"

Entry’s compression method.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV7ownerIDSiSgvp":{"name":"ownerID","abstract":"

ID of entry’s owner.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV7groupIDSiSgvp":{"name":"groupID","abstract":"

ID of the group of entry’s owner.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV17customExtraFieldsSayAA0bF5Field_pGvp":{"name":"customExtraFields","abstract":"

Entry’s custom extra fields from both Central Directory and Local Header.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV3crcs6UInt32Vvp":{"name":"crc","abstract":"

CRC32 of entry’s data.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","parent_name":"ZipEntry"},"Structs/ZipEntry.html#/s:13SWCompression14ContainerEntryP4data10Foundation4DataVSgvp":{"name":"data","parent_name":"ZipEntry"},"Classes/ZipContainer.html#/s:13SWCompression12ZipContainerC17customExtraFieldsSDys6UInt16VAA0bE5Field_pXpGvpZ":{"name":"customExtraFields","abstract":"

Contains user-defined extra fields. When either ZipContainer.info(container:) or ZipContainer.open(container:)","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:13SWCompression12ZipContainerC4open9containerSayAA0B5EntryVG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

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

","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:13SWCompression12ZipContainerC4info9containerSayAA0B9EntryInfoVG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

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

","parent_name":"ZipContainer"},"Classes/ZipContainer.html":{"name":"ZipContainer","abstract":"

Provides functions for work with ZIP containers.

"},"Structs/ZipEntry.html":{"name":"ZipEntry","abstract":"

Represents an entry from the ZIP container.

"},"Structs/ZipEntryInfo.html":{"name":"ZipEntryInfo","abstract":"

Provides access to information about an entry from the ZIP container.

"},"Protocols/ZipExtraField.html":{"name":"ZipExtraField","abstract":"

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

"},"Enums/ZipExtraFieldLocation.html":{"name":"ZipExtraFieldLocation","abstract":"

Location of ZIP extra field inside a container.

"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV4nameSSvp":{"name":"name","abstract":"

Entry’s name.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV4sizeSiSgvp":{"name":"size","abstract":"

Entry’s data size.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV10accessTime10Foundation4DateVSgvp":{"name":"accessTime","abstract":"

Entry’s last access time (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV12creationTime10Foundation4DateVSgvp":{"name":"creationTime","abstract":"

Entry’s creation time (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

Entry’s last modification time.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP11permissionsAA11PermissionsVSgvp":{"name":"permissions","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV17compressionMethodAA011CompressionF0Ovp":{"name":"compressionMethod","abstract":"

Entry’s compression method. Always .copy for the entries of TAR containers.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7ownerIDSiSgvp":{"name":"ownerID","abstract":"

ID of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7groupIDSiSgvp":{"name":"groupID","abstract":"

ID of the group of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV13ownerUserNameSSSgvp":{"name":"ownerUserName","abstract":"

User name of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV14ownerGroupNameSSSgvp":{"name":"ownerGroupName","abstract":"

Name of the group of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV17deviceMajorNumberSiSgvp":{"name":"deviceMajorNumber","abstract":"

Device major number (used when entry is either block or character special file).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV17deviceMinorNumberSiSgvp":{"name":"deviceMinorNumber","abstract":"

Device minor number (used when entry is either block or character special file).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7charsetSSSgvp":{"name":"charset","abstract":"

Name of the character set used to encode entry’s data (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7commentSSSgvp":{"name":"comment","abstract":"

Entry’s comment (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV8linkNameSSvp":{"name":"linkName","abstract":"

Path to a linked file for symbolic link entry.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV28unknownExtendedHeaderRecordsSDyS2SGSgvp":{"name":"unknownExtendedHeaderRecords","abstract":"

All custom (unknown) records from global and local PAX extended headers. nil, if there were no headers.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV4name4typeACSS_AA09ContainerC4TypeOtcfc":{"name":"init(name:type:)","abstract":"

Initializes the entry’s info with its name and type.

","parent_name":"TarEntryInfo"},"Structs/TarEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","parent_name":"TarEntry"},"Structs/TarEntry.html#/s:13SWCompression8TarEntryV4data10Foundation4DataVSgvp":{"name":"data","abstract":"

Entry’s data (nil if entry is a directory or data isn’t available).

","parent_name":"TarEntry"},"Structs/TarEntry.html#/s:13SWCompression8TarEntryV4info4dataAcA0bC4InfoV_10Foundation4DataVSgtcfc":{"name":"init(info:data:)","abstract":"

Initializes the entry with its info and data. The stored info.size will also be updated to be equal to","parent_name":"TarEntry"},"Structs/TarWriter.html#/s:13SWCompression9TarWriterV10fileHandle5forceACSo06NSFileE0C_AA0B9ContainerC6FormatOtcfc":{"name":"init(fileHandle:force:)","abstract":"

Creates a new instance for writing TAR entries using the specified format into the provided fileHandle.

","parent_name":"TarWriter"},"Structs/TarWriter.html#/s:13SWCompression9TarWriterV6appendyyAA0B5EntryVKF":{"name":"append(_:)","abstract":"

Adds a new TAR entry at the end of the TAR container.

","parent_name":"TarWriter"},"Structs/TarWriter.html#/s:13SWCompression9TarWriterV8finalizeyyKF":{"name":"finalize()","abstract":"

Finalizes the TAR container by adding an EOF marker.

","parent_name":"TarWriter"},"Structs/TarReader.html#/s:13SWCompression9TarReaderV10fileHandleACSo06NSFileE0C_tcfc":{"name":"init(fileHandle:)","abstract":"

Creates a new instance for reading TAR entries from the provided fileHandle.

","parent_name":"TarReader"},"Structs/TarReader.html#/s:13SWCompression9TarReaderV7processyxxAA0B5EntryVSgKXEKlF":{"name":"process(_:)","abstract":"

Processes the next TAR entry by reading it from the container and calling the provided closure on the result. If","parent_name":"TarReader"},"Structs/TarReader.html#/s:13SWCompression9TarReaderV4readAA0B5EntryVSgyKF":{"name":"read()","abstract":"

Reads the next TAR entry from the container.

","parent_name":"TarReader"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO8prePosixyA2EmF":{"name":"prePosix","abstract":"

Pre POSIX format (aka “basic TAR format”).

","parent_name":"Format"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO5ustaryA2EmF":{"name":"ustar","abstract":"

“UStar” format introduced by POSIX IEEE P1003.1 standard.

","parent_name":"Format"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO3gnuyA2EmF":{"name":"gnu","abstract":"

“UStar”-like format with GNU extensions (e.g. special container entries for long file and link names).

","parent_name":"Format"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO3paxyA2EmF":{"name":"pax","abstract":"

“PAX” format introduced by POSIX.1-2001 standard, a set of extensions to “UStar” format.

","parent_name":"Format"},"Classes/TarContainer/Format.html":{"name":"Format","abstract":"

Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC8formatOf9containerAC6FormatO10Foundation4DataV_tKFZ":{"name":"formatOf(container:)","abstract":"

Processes TAR container and returns its “format”: a minimal set of extensions to basic TAR format required to","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC6create4from10Foundation4DataVSayAA0B5EntryVG_tFZ":{"name":"create(from:)","abstract":"

Creates a new TAR container with entries as its content and generates its Data.

","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC6create4from5force10Foundation4DataVSayAA0B5EntryVG_AC6FormatOtFZ":{"name":"create(from:force:)","abstract":"

Creates a new TAR container with entries as its content and generates its Data using the specified format.

","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC4open9containerSayAA0B5EntryVG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

Processes TAR container and returns an array of TarEntry with information and data for all entries.

","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC4info9containerSayAA0B9EntryInfoVG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

Processes TAR container and returns an array of TarEntryInfo with information about entries in this container.

","parent_name":"TarContainer"},"Classes/TarContainer.html":{"name":"TarContainer","abstract":"

Provides functions for work with TAR containers.

"},"Structs/TarReader.html":{"name":"TarReader","abstract":"

A type that allows to iteratively read TAR entries from a container provided by a FileHandle.

"},"Structs/TarWriter.html":{"name":"TarWriter","abstract":"

A type that allows to iteratively create TAR containers with the output being written into a FileHandle.

"},"Structs/TarEntry.html":{"name":"TarEntry","abstract":"

Represents an entry from the TAR container.

"},"Structs/TarEntryInfo.html":{"name":"TarEntryInfo","abstract":"

Provides access to information about an entry from the TAR container.

"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4nameSSvp":{"name":"name","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4sizeSiSgvp":{"name":"size","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP10accessTime10Foundation4DateVSgvp":{"name":"accessTime","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP12creationTime10Foundation4DateVSgvp":{"name":"creationTime","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP11permissionsAA11PermissionsVSgvp":{"name":"permissions","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV13winAttributess6UInt32VSgvp":{"name":"winAttributes","abstract":"

Entry’s “win attributes”. 7-Zip internal property.","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV13dosAttributesAA03DosG0VSgvp":{"name":"dosAttributes","abstract":"

Entry’s attributes in DOS format.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV9hasStreamSbvp":{"name":"hasStream","abstract":"

True, if entry has a stream (data) inside the container. 7-Zip internal propety.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV7isEmptySbvp":{"name":"isEmpty","abstract":"

True, if entry is an empty file. 7-Zip internal property.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV6isAntiSbvp":{"name":"isAnti","abstract":"

True, if entry is an anti-file. Used in differential backups to indicate that file should be deleted.","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV3crcs6UInt32VSgvp":{"name":"crc","abstract":"

CRC32 of entry’s data.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","parent_name":"SevenZipEntry"},"Structs/SevenZipEntry.html#/s:13SWCompression14ContainerEntryP4data10Foundation4DataVSgvp":{"name":"data","parent_name":"SevenZipEntry"},"Classes/SevenZipContainer.html#/s:13SWCompression17SevenZipContainerC4open9containerSayAA0bC5EntryVG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

Processes 7-Zip container and returns an array of SevenZipEntry with information and data for all entries.

","parent_name":"SevenZipContainer"},"Classes/SevenZipContainer.html#/s:13SWCompression17SevenZipContainerC4info9containerSayAA0bC9EntryInfoVG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

Processes 7-Zip container and returns an array of SevenZipEntryInfo with information about entries in this","parent_name":"SevenZipContainer"},"Classes/SevenZipContainer.html":{"name":"SevenZipContainer","abstract":"

Provides functions for work with 7-Zip containers.

"},"Structs/SevenZipEntry.html":{"name":"SevenZipEntry","abstract":"

Represents an entry from the 7-Zip container.

"},"Structs/SevenZipEntryInfo.html":{"name":"SevenZipEntryInfo","abstract":"

Provides access to information about an entry from the 7-Zip container.

"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO16fastestAlgorithmyA2EmF":{"name":"fastestAlgorithm","abstract":"

Fastest algorithm.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO13fastAlgorithmyA2EmF":{"name":"fastAlgorithm","abstract":"

Fast algorithm.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO16defaultAlgorithmyA2EmF":{"name":"defaultAlgorithm","abstract":"

Default algorithm.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO13slowAlgorithmyA2EmF":{"name":"slowAlgorithm","abstract":"

Slowest algorithm but with maximum compression.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html":{"name":"CompressionLevel","abstract":"

Levels of compression which can be used to create Zlib archive.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV17compressionMethodAA011CompressionE0Ovp":{"name":"compressionMethod","abstract":"

Compression method of archive. Always .deflate for Zlib archives.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV16compressionLevelAC011CompressionE0Ovp":{"name":"compressionLevel","abstract":"

Level of compression used in archive.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV10windowSizeSivp":{"name":"windowSize","abstract":"

Size of ‘window’: moving interval of data which was used to make archive.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV7archiveAC10Foundation4DataV_tKcfc":{"name":"init(archive:)","abstract":"

Initializes the structure with the values from Zlib archive.

","parent_name":"ZlibHeader"},"Classes/ZlibArchive.html#/s:13SWCompression11ZlibArchiveC9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchives Zlib archive.

","parent_name":"ZlibArchive"},"Classes/ZlibArchive.html#/s:13SWCompression11ZlibArchiveC7archive4data10Foundation4DataVAH_tFZ":{"name":"archive(data:)","abstract":"

Archives data into Zlib archive. Data will be also compressed with Deflate algorithm.","parent_name":"ZlibArchive"},"Classes/XZArchive.html#/s:13SWCompression9XZArchiveC9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchives XZ archive. Archives with multiple streams are supported,","parent_name":"XZArchive"},"Classes/XZArchive.html#/s:13SWCompression9XZArchiveC14splitUnarchive7archiveSay10Foundation4DataVGAH_tKFZ":{"name":"splitUnarchive(archive:)","abstract":"

Unarchives XZ archive. Archives with multiple streams are supported,","parent_name":"XZArchive"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldV3si1s5UInt8Vvp":{"name":"si1","abstract":"

First byte of the extra field (subfield) ID.

","parent_name":"ExtraField"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldV3si2s5UInt8Vvp":{"name":"si2","abstract":"

Second byte of the extra field (subfield) ID.

","parent_name":"ExtraField"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldV5bytesSays5UInt8VGvp":{"name":"bytes","abstract":"

Binary content of the extra field.

","parent_name":"ExtraField"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldVyAEs5UInt8V_AGSayAGGtcfc":{"name":"init(_:_:_:)","abstract":"

Initializes an extra field with the specified extra field (subfield) ID bytes and its binary content.

","parent_name":"ExtraField"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV17compressionMethodAA011CompressionE0Ovp":{"name":"compressionMethod","abstract":"

Compression method of archive. Always .deflate for GZip archives.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

The most recent modification time of the original file. If corresponding archive’s field is set to 0, which means","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV6osTypeAA010FileSystemE0Ovp":{"name":"osType","abstract":"

Type of file system on which archivation took place.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV8fileNameSSSgvp":{"name":"fileName","abstract":"

Name of the original file. If archive doesn’t contain file’s name, then nil.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV7commentSSSgvp":{"name":"comment","abstract":"

Comment stored in archive. If archive doesn’t contain any comment, then nil.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV10isTextFileSbvp":{"name":"isTextFile","abstract":"

True, if file is likely to be text file or ASCII-file.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV11extraFieldsSayAC10ExtraFieldVGvp":{"name":"extraFields","abstract":"

Extra fields present in the header.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV7archiveAC10Foundation4DataV_tKcfc":{"name":"init(archive:)","abstract":"

Initializes the structure with the values from the first ‘member’ of GZip archive.

","parent_name":"GzipHeader"},"Structs/GzipHeader/ExtraField.html":{"name":"ExtraField","abstract":"

Represents an extra field in the header of a GZip archive.

","parent_name":"GzipHeader"},"Classes/GzipArchive/Member.html#/s:13SWCompression11GzipArchiveC6MemberV6headerAA0B6HeaderVvp":{"name":"header","abstract":"

GZip header of a member.

","parent_name":"Member"},"Classes/GzipArchive/Member.html#/s:13SWCompression11GzipArchiveC6MemberV4data10Foundation4DataVvp":{"name":"data","abstract":"

Unarchived data from a member.

","parent_name":"Member"},"Classes/GzipArchive/Member.html":{"name":"Member","abstract":"

Represents the member of a multi-member GZip archive.

","parent_name":"GzipArchive"},"Classes/GzipArchive.html#/s:13SWCompression11GzipArchiveC9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchives GZip archive.

","parent_name":"GzipArchive"},"Classes/GzipArchive.html#/s:13SWCompression11GzipArchiveC14multiUnarchive7archiveSayAC6MemberVG10Foundation4DataV_tKFZ":{"name":"multiUnarchive(archive:)","abstract":"

Unarchives multi-member GZip archive.","parent_name":"GzipArchive"},"Classes/GzipArchive.html#/s:13SWCompression11GzipArchiveC7archive4data7comment8fileName14writeHeaderCRC10isTextFile6osType16modificationTime11extraFields10Foundation4DataVAO_SSSgAPS2bAA0n6SystemP0OSgAM4DateVSgSayAA0bJ0V10ExtraFieldVGtKFZ":{"name":"archive(data:comment:fileName:writeHeaderCRC:isTextFile:osType:modificationTime:extraFields:)","abstract":"

Archives data into GZip archive, using various specified options.","parent_name":"GzipArchive"},"Classes/GzipArchive.html":{"name":"GzipArchive","abstract":"

Provides unarchive and archive functions for GZip archives.

"},"Structs/GzipHeader.html":{"name":"GzipHeader","abstract":"

Represents the header of a GZip archive.

"},"Classes/XZArchive.html":{"name":"XZArchive","abstract":"

Provides unarchive function for XZ archives.

"},"Classes/ZlibArchive.html":{"name":"ZlibArchive","abstract":"

Provides unarchive and archive functions for Zlib archives.

"},"Structs/ZlibHeader.html":{"name":"ZlibHeader","abstract":"

Represents the header of a Zlib archive.

"},"Enums/LZ4.html#/s:13SWCompression3LZ4O10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using LZ4 algortihm.

","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O10decompress4data10dictionary0E2ID10Foundation4DataVAJ_AJSgs6UInt32VSgtKFZ":{"name":"decompress(data:dictionary:dictionaryID:)","abstract":"

Decompresses data using LZ4 algortihm and provided external dictionary.

","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O15multiDecompress4data10dictionary0F2IDSay10Foundation4DataVGAJ_AJSgs6UInt32VSgtKFZ":{"name":"multiDecompress(data:dictionary:dictionaryID:)","abstract":"

Decompresses data, which may represent several concatenated LZ4 frames, using LZ4 algortihm and provided external","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O8compress4data10Foundation4DataVAH_tFZ":{"name":"compress(data:)","abstract":"

Compresses data using LZ4 algortihm with default format and algorithm options.

","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O8compress4data17independentBlocks14blockChecksums15contentChecksum0I4Size0gK010dictionary0L2ID10Foundation4DataVAO_S4bSiAOSgs6UInt32VSgtFZ":{"name":"compress(data:independentBlocks:blockChecksums:contentChecksum:contentSize:blockSize:dictionary:dictionaryID:)","abstract":"

Compresses data using LZ4 algortihm.

","parent_name":"LZ4"},"Classes/LZMA2.html#/s:13SWCompression5LZMA2C10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using LZMA2 algortihm.

","parent_name":"LZMA2"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2lcSivp":{"name":"lc","abstract":"

Number of bits used for the literal encoding context. Default value is 3.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2lpSivp":{"name":"lp","abstract":"

Number of bits to include in “literal position state”. Default value is 0.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2pbSivp":{"name":"pb","abstract":"

Number of bits to include in “position state”. Default value is 2.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV14dictionarySizeSivp":{"name":"dictionarySize","abstract":"

Size of the dictionary. Default value is 1 << 24.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2lc2lp2pb14dictionarySizeACSi_S3itcfc":{"name":"init(lc:lp:pb:dictionarySize:)","abstract":"

Initializes LZMA properties with values of lc, lp, pb, and dictionary size.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesVACycfc":{"name":"init()","abstract":"

Initializes LZMA properties with default values of lc, lp, pb, and dictionary size.

","parent_name":"LZMAProperties"},"Classes/LZMA.html#/s:13SWCompression4LZMAC10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using LZMA.

","parent_name":"LZMA"},"Classes/LZMA.html#/s:13SWCompression4LZMAC10decompress4data10properties16uncompressedSize10Foundation4DataVAJ_AA14LZMAPropertiesVSiSgtKFZ":{"name":"decompress(data:properties:uncompressedSize:)","abstract":"

Decompresses data using LZMA with specified algorithm’s properties, and, optionally, output’s","parent_name":"LZMA"},"Classes/Deflate.html#/s:13SWCompression7DeflateC10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using Deflate algortihm.

","parent_name":"Deflate"},"Classes/Deflate.html#/s:13SWCompression7DeflateC8compress4data10Foundation4DataVAH_tFZ":{"name":"compress(data:)","abstract":"

Compresses data with Deflate algortihm.

","parent_name":"Deflate"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO3oneyA2EmF":{"name":"one","abstract":"

100 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO3twoyA2EmF":{"name":"two","abstract":"

200 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO5threeyA2EmF":{"name":"three","abstract":"

300 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO4fouryA2EmF":{"name":"four","abstract":"

400 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO4fiveyA2EmF":{"name":"five","abstract":"

500 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO3sixyA2EmF":{"name":"six","abstract":"

600 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO5sevenyA2EmF":{"name":"seven","abstract":"

700 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO5eightyA2EmF":{"name":"eight","abstract":"

800 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO4nineyA2EmF":{"name":"nine","abstract":"

900 KB.

","parent_name":"BlockSize"},"Classes/BZip2.html#/s:13SWCompression5BZip2C10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using BZip2 algortihm.

","parent_name":"BZip2"},"Classes/BZip2.html#/s:13SWCompression5BZip2C15multiDecompress4dataSay10Foundation4DataVGAH_tKFZ":{"name":"multiDecompress(data:)","abstract":"

Decompresses one or more concatenated BZip2 archives found in data.

","parent_name":"BZip2"},"Classes/BZip2/BlockSize.html":{"name":"BlockSize","abstract":"

Represents the size of the blocks in which data is split during BZip2 compression.

","parent_name":"BZip2"},"Classes/BZip2.html#/s:13SWCompression5BZip2C8compress4data10Foundation4DataVAH_tFZ":{"name":"compress(data:)","abstract":"

Compresses data with BZip2 algortihm.

","parent_name":"BZip2"},"Classes/BZip2.html#/s:13SWCompression5BZip2C8compress4data9blockSize10Foundation4DataVAI_AC05BlockF0OtFZ":{"name":"compress(data:blockSize:)","abstract":"

Compresses data with BZip2 algortihm, splitting data into blocks of specified blockSize.

","parent_name":"BZip2"},"Classes/BZip2.html":{"name":"BZip2","abstract":"

Provides functions for compression and decompression for BZip2 algorithm.

"},"Classes/Deflate.html":{"name":"Deflate","abstract":"

Provides functions for compression and decompression for Deflate algorithm.

"},"Classes/LZMA.html":{"name":"LZMA","abstract":"

Provides decompression function for LZMA.

"},"Structs/LZMAProperties.html":{"name":"LZMAProperties","abstract":"

Properties of LZMA. This API is intended to be used by advanced users.

"},"Classes/LZMA2.html":{"name":"LZMA2","abstract":"

Provides decompression function for LZMA2 algorithm.

"},"Enums/LZ4.html":{"name":"LZ4","abstract":"

Provides functions for compression and decompression for LZ4 algorithm.

"},"Compression.html":{"name":"Compression"},"Archives.html":{"name":"Archives"},"7-Zip.html":{"name":"7-Zip"},"TAR.html":{"name":"TAR"},"ZIP.html":{"name":"ZIP"},"Errors.html":{"name":"Errors"},"Protocols.html":{"name":"Protocols"},"Common%20Auxiliary%20Types.html":{"name":"Common Auxiliary Types"}} \ No newline at end of file diff --git a/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json b/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json new file mode 100644 index 00000000..f42809e0 --- /dev/null +++ b/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json @@ -0,0 +1,4 @@ +{ + "warnings": [], + "source_directory": "/Users/runner/work/1/s" +} \ No newline at end of file diff --git a/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx b/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx new file mode 100644 index 00000000..012cc2c6 Binary files /dev/null and b/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx differ diff --git a/docsets/SWCompression.tgz b/docsets/SWCompression.tgz new file mode 100644 index 00000000..7af62b63 Binary files /dev/null and b/docsets/SWCompression.tgz differ diff --git a/img/carat.png b/img/carat.png new file mode 100755 index 00000000..29d2f7fd Binary files /dev/null and b/img/carat.png differ diff --git a/img/dash.png b/img/dash.png new file mode 100755 index 00000000..6f694c7a Binary files /dev/null and b/img/dash.png differ diff --git a/img/gh.png b/img/gh.png new file mode 100755 index 00000000..628da97c Binary files /dev/null and b/img/gh.png differ diff --git a/img/spinner.gif b/img/spinner.gif new file mode 100644 index 00000000..e3038d0a Binary files /dev/null and b/img/spinner.gif differ diff --git a/index.html b/index.html new file mode 100644 index 00000000..ba2637dd --- /dev/null +++ b/index.html @@ -0,0 +1,492 @@ + + + + SWCompression Reference + + + + + + + + + + + + + + + +
+

+ + SWCompression 4.9.1 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +
+ + + +
+ +
+ +
+
+ +

SWCompression

+ +

Swift 5.9+ +GitHub license +Build Status

+ +

A framework with (de)compression algorithms and functions for working with various archives and containers.

+

What is this?

+ +

SWCompression is a framework with a collection of functions for:

+ +
    +
  1. Decompression (and sometimes compression) using different algorithms.
  2. +
  3. Reading (and sometimes writing) archives of different formats.
  4. +
  5. Reading (and sometimes writing) containers such as ZIP, TAR and 7-Zip.
  6. +
+ +

It also works on Apple platforms, Linux, and Windows.

+ +

All features are listed in the tables below. “TBD” means that feature is planned but not implemented (yet).

+ + + + + + + + + + + + + + + + + + + + + + + + +
DeflateBZip2LZMA/LZMA2LZ4
Decompression
CompressionTBD
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZlibGZipXZZIPTAR7-Zip
Read
WriteTBDTBDTBD
+ +

Also, SWCompression is written with Swift only.

+

Installation

+ +

SWCompression can be integrated into your project using Swift Package Manager.

+ +

Note: SWCompression versions 4.8.6 and earlier were also made available via CocoaPods or Carthage.

+ +

To install with Swift Package manager, add SWCompression to you package dependencies and specify it as a dependency for +your target, e.g.:

+
import PackageDescription
+
+let package = Package(
+    name: "PackageName",
+    dependencies: [
+        .package(name: "SWCompression", url: "https://github.com/tsolomko/SWCompression.git",
+                 from: "4.9.0")
+    ],
+    targets: [
+        .target(
+            name: "TargetName",
+            dependencies: ["SWCompression"]
+        )
+    ]
+)
+
+ +

More details you can find in Swift Package Manager’s Documentation.

+

Usage

+

Basic Example

+ +

For example, if you want to decompress “deflated” data just use:

+
// let data = <Your compressed data>
+let decompressedData = try? Deflate.decompress(data: data)
+
+ +

However, it is unlikely that you will encounter deflated data outside of any archive. So, in the case of GZip archive +you should use:

+
let decompressedData = try? GzipArchive.unarchive(archive: data)
+
+

Handling Errors

+ +

Most SWCompression functions can throw errors and you are responsible for handling them. If you look at the list of +available error types and their cases, you may be frightened by their number. However, most of the cases (such as +XZError.wrongMagic) exist for diagnostic purposes.

+ +

Thus, you only need to handle the most common type of error for your archive/algorithm. For example:

+
do {
+    // let data = <Your compressed data>
+    let decompressedData = try XZArchive.unarchive(archive: data)
+} catch let error as XZError {
+    // <handle XZ related error here>
+} catch let error {
+    // <handle all other errors here>
+}
+
+

Documentation

+ +

Every function or type of SWCompression’s public API is documented. This documentation can be found at its own +website or via a slightly shorter link: +swcompression.tsolomko.me

+

Sophisticated example

+ +

There is a small command-line program, “swcomp”, which is included in this repository in “Sources/swcomp”. It can be +built using Swift Package Manager (only available on macOS).

+ +

IMPORTANT: The “swcomp” command-line tool is NOT intended for general use.

+

Contributing

+ +

Whether you find a bug, have a suggestion, idea, feedback or something else, please +create an issue on GitHub. If you have any questions, you can ask +them on the Discussions page.

+ +

In the case of a bug, it will be especially helpful if you attach a file (archive, etc.) that caused the bug to occur.

+ +

If you’d like to contribute, please create a pull request on GitHub.

+

Executing tests locally

+ +

If you want to run tests on your computer, you need to do a couple of additional steps after cloning the repository:

+
git submodule update --init --recursive
+cd "Tests/Test Files"
+cp gitattributes-copy .gitattributes
+git lfs pull
+git lfs checkout
+
+ +

These commands will download the files used in tests which are stored in a +separate repository using Git LFS. There are two reasons for +this complicated setup. Firstly, some of these files can be quite big, and it would be unfortunate if the users of +SWCompression had to download them during the installation. Secondly, Swift Package Manager and contemporary versions of +Xcode don’t always work well with git-lfs-enabled repositories. To prevent any potential problems test files were moved +into another repository.

+ +

Please note, that if you want to add a new type of test files, in addition to running git lfs track, you have to +also copy into the “Tests/Test Files/gitattributes-copy” file a line this command adds to the “Tests/Test Files/.gitattributes” +file. Do not commit the “.gitattributes” file to the git history. It is git-ignored for a reason!

+ +

Please also be mindful of Git LFS bandwidth quota on GitHub: try to limit downloading lfs’d files using git lfs pull. +In CI we use some caching techniques to help with the quota, so if you’re going to add new tests that require several +new test files you should try to submit them all together to reduce the amount of times CI needs to recreate the cache +(recreating the cache requires to do git lfs pull for all test files).

+

Performance

+ +

Using whole module optimizations is recommended for the best performance. They are enabled by default in the Release build +configuration.

+ +

Tests Results document contains results of benchmarking of various functions.

+

Why?

+ +

First of all, existing solutions for working with compression, archives and containers have certain disadvantages. They +might not support a particular compression algorithm or archive format and they all have different APIs, which sometimes +can be slightly confusing for users, especially when you mix different libraries in one project. This project attempts to +provide missing (and sometimes existing) functionality through the unified API which is easy to use and remember.

+ +

Secondly, in some cases it may be important to have a compression framework written entirely in Swift, without relying +on either system libraries or solutions implemented in other languages. Additionaly, since SWCompression is written +completely in Swift without Objective-C, it can also be used on Linux, and Windows.

+

Future plans

+ +
    +
  • Performance…
  • +
  • Better Deflate compression.
  • +
  • Something else…
  • +
+

License

+ +

MIT licensed

+

References

+ + + +
+
+ + +
+
+ + + diff --git a/js/jazzy.js b/js/jazzy.js new file mode 100755 index 00000000..1ac86992 --- /dev/null +++ b/js/jazzy.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targeted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/js/jazzy.search.js b/js/jazzy.search.js new file mode 100644 index 00000000..359cdbb8 --- /dev/null +++ b/js/jazzy.search.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
'; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
'; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/js/jquery.min.js b/js/jquery.min.js new file mode 100644 index 00000000..7f37b5d9 --- /dev/null +++ b/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/js/typeahead.jquery.js b/js/typeahead.jquery.js new file mode 100644 index 00000000..bcb734be --- /dev/null +++ b/js/typeahead.jquery.js @@ -0,0 +1,1695 @@ +/*! + * typeahead.js 1.3.3 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2024 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + "aria-controls": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
"); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
"); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
"); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
"); + $menu = this.menu.$node || $("
"); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/search.json b/search.json new file mode 100644 index 00000000..33742659 --- /dev/null +++ b/search.json @@ -0,0 +1 @@ +{"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO3fatyA2CmF":{"name":"fat","abstract":"

FAT filesystem.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO9macintoshyA2CmF":{"name":"macintosh","abstract":"

Filesystem of older Macintosh systems.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO4ntfsyA2CmF":{"name":"ntfs","abstract":"

NTFS.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO5otheryA2CmF":{"name":"other","abstract":"

Other/unknown file system.

","parent_name":"FileSystemType"},"Enums/FileSystemType.html#/s:13SWCompression14FileSystemTypeO4unixyA2CmF":{"name":"unix","abstract":"

One of many file systems of UNIX-like OS.

","parent_name":"FileSystemType"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO5bzip2yA2CmF":{"name":"bzip2","abstract":"

BZip2.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO4copyyA2CmF":{"name":"copy","abstract":"

Copy (no compression).

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO7deflateyA2CmF":{"name":"deflate","abstract":"

Deflate.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO4lzmayA2CmF":{"name":"lzma","abstract":"

LZMA.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO5lzma2yA2CmF":{"name":"lzma2","abstract":"

LZMA 2.

","parent_name":"CompressionMethod"},"Enums/CompressionMethod.html#/s:13SWCompression17CompressionMethodO5otheryA2CmF":{"name":"other","abstract":"

Other/unknown method.

","parent_name":"CompressionMethod"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV8rawValues6UInt32Vvp":{"name":"rawValue","abstract":"

Raw bit flags value (in decimal).

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV8rawValueACs6UInt32V_tcfc":{"name":"init(rawValue:)","abstract":"

Initializes permissions with bit flags in decimal.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV6setuidACvpZ":{"name":"setuid","abstract":"

Set UID.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV6setgidACvpZ":{"name":"setgid","abstract":"

Set GID.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV6stickyACvpZ":{"name":"sticky","abstract":"

Sticky bit.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV9readOwnerACvpZ":{"name":"readOwner","abstract":"

Owner can read.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV10writeOwnerACvpZ":{"name":"writeOwner","abstract":"

Owner can write.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV12executeOwnerACvpZ":{"name":"executeOwner","abstract":"

Owner can execute.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV9readGroupACvpZ":{"name":"readGroup","abstract":"

Group can read.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV10writeGroupACvpZ":{"name":"writeGroup","abstract":"

Group can write.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV12executeGroupACvpZ":{"name":"executeGroup","abstract":"

Group can execute.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV9readOtherACvpZ":{"name":"readOther","abstract":"

Others can read.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV10writeOtherACvpZ":{"name":"writeOther","abstract":"

Others can write.

","parent_name":"Permissions"},"Structs/Permissions.html#/s:13SWCompression11PermissionsV12executeOtherACvpZ":{"name":"executeOther","abstract":"

Others can execute.

","parent_name":"Permissions"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV8rawValues6UInt32Vvp":{"name":"rawValue","abstract":"

Raw bit flags value.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV8rawValueACs6UInt32V_tcfc":{"name":"init(rawValue:)","abstract":"

Initializes attributes with bit flags.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV7archiveACvpZ":{"name":"archive","abstract":"

File is archive or archived.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV9directoryACvpZ":{"name":"directory","abstract":"

File is a directory.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV6volumeACvpZ":{"name":"volume","abstract":"

File is a volume.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV6systemACvpZ":{"name":"system","abstract":"

File is a system file.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV6hiddenACvpZ":{"name":"hidden","abstract":"

File is hidden.

","parent_name":"DosAttributes"},"Structs/DosAttributes.html#/s:13SWCompression13DosAttributesV8readOnlyACvpZ":{"name":"readOnly","abstract":"

File is read-only.

","parent_name":"DosAttributes"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO12blockSpecialyA2CmF":{"name":"blockSpecial","abstract":"

Block special file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO16characterSpecialyA2CmF":{"name":"characterSpecial","abstract":"

Character special file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO10contiguousyA2CmF":{"name":"contiguous","abstract":"

Contiguous file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO9directoryyA2CmF":{"name":"directory","abstract":"

Directory.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO4fifoyA2CmF":{"name":"fifo","abstract":"

FIFO special file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO8hardLinkyA2CmF":{"name":"hardLink","abstract":"

Hard link.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO7regularyA2CmF":{"name":"regular","abstract":"

Regular file.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO6socketyA2CmF":{"name":"socket","abstract":"

Socket.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO12symbolicLinkyA2CmF":{"name":"symbolicLink","abstract":"

Symbolic link.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html#/s:13SWCompression18ContainerEntryTypeO7unknownyA2CmF":{"name":"unknown","abstract":"

Entry type is unknown.

","parent_name":"ContainerEntryType"},"Enums/ContainerEntryType.html":{"name":"ContainerEntryType","abstract":"

Represents the type of a container entry.

"},"Structs/DosAttributes.html":{"name":"DosAttributes","abstract":"

Represents file attributes in DOS format.

"},"Structs/Permissions.html":{"name":"Permissions","abstract":"

Represents file access permissions in UNIX format.

"},"Enums/CompressionMethod.html":{"name":"CompressionMethod","abstract":"

Represents a (de)compression method.

"},"Enums/FileSystemType.html":{"name":"FileSystemType","abstract":"

Represents the type of the file system on which an archive or container was created. File system determines the meaning"},"Protocols/DecompressionAlgorithm.html#/s:13SWCompression22DecompressionAlgorithmP10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompress data compressed with particular algorithm.

","parent_name":"DecompressionAlgorithm"},"Protocols/CompressionAlgorithm.html#/s:13SWCompression20CompressionAlgorithmP8compress4data10Foundation4DataVAH_tKFZ":{"name":"compress(data:)","abstract":"

Compress data with particular algorithm.

","parent_name":"CompressionAlgorithm"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4nameSSvp":{"name":"name","abstract":"

Entry’s name.

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","abstract":"

Entry’s type.

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4sizeSiSgvp":{"name":"size","abstract":"

Entry’s data size (can be nil if either data or size aren’t available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP10accessTime10Foundation4DateVSgvp":{"name":"accessTime","abstract":"

Entry’s last access time (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP12creationTime10Foundation4DateVSgvp":{"name":"creationTime","abstract":"

Entry’s creation time (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

Entry’s last modification time (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP11permissionsAA11PermissionsVSgvp":{"name":"permissions","abstract":"

Entry’s permissions in POSIX format (nil, if not available).

","parent_name":"ContainerEntryInfo"},"Protocols/ContainerEntry.html#/s:13SWCompression14ContainerEntryP4InfoQa":{"name":"Info","abstract":"

A type that provides information about an entry.

","parent_name":"ContainerEntry"},"Protocols/ContainerEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","abstract":"

Provides access to information about the entry.

","parent_name":"ContainerEntry"},"Protocols/ContainerEntry.html#/s:13SWCompression14ContainerEntryP4data10Foundation4DataVSgvp":{"name":"data","abstract":"

Entry’s data (nil if entry is a directory or data isn’t available).

","parent_name":"ContainerEntry"},"Protocols/Container.html#/s:13SWCompression9ContainerP5EntryQa":{"name":"Entry","abstract":"

A type that represents an entry from this container.

","parent_name":"Container"},"Protocols/Container.html#/s:13SWCompression9ContainerP4open9containerSay5EntryQzG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

Retrieve all container entries with their data.

","parent_name":"Container"},"Protocols/Container.html#/s:13SWCompression9ContainerP4info9containerSay5Entry_4InfoQZG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

Retrieve information about all container entries (without their data).

","parent_name":"Container"},"Protocols/Archive.html#/s:13SWCompression7ArchiveP9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchive data from the archive.

","parent_name":"Archive"},"Protocols/Archive.html":{"name":"Archive","abstract":"

A type that represents an archive.

"},"Protocols/Container.html":{"name":"Container","abstract":"

A type that represents a container with files, directories and/or other data.

"},"Protocols/ContainerEntry.html":{"name":"ContainerEntry","abstract":"

A type that represents an entry from the container with its data and information.

"},"Protocols/ContainerEntryInfo.html":{"name":"ContainerEntryInfo","abstract":"

A type that provides access to information about an entry from the container.

"},"Protocols/CompressionAlgorithm.html":{"name":"CompressionAlgorithm","abstract":"

A type that provides an implementation of a particular compression algorithm.

"},"Protocols/DecompressionAlgorithm.html":{"name":"DecompressionAlgorithm","abstract":"

A type that provides an implementation of a particular decompression algorithm.

"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO22wrongCompressionMethodyA2CmF":{"name":"wrongCompressionMethod","abstract":"

Compression method used in archive is different from Deflate, which is the only supported one.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO20wrongCompressionInfoyA2CmF":{"name":"wrongCompressionInfo","abstract":"

Compression info has value incompatible with Deflate compression method.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO11wrongFcheckyA2CmF":{"name":"wrongFcheck","abstract":"

First two bytes of archive’s flags are inconsistent with each other.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO21wrongCompressionLevelyA2CmF":{"name":"wrongCompressionLevel","abstract":"

Compression level has value, which is different from the supported ones.

","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:13SWCompression9ZlibErrorO12wrongAdler32yAC10Foundation4DataVcACmF":{"name":"wrongAdler32(_:)","abstract":"

Computed checksum of uncompressed data doesn’t match the value stored in archive.","parent_name":"ZlibError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO27notFoundCentralDirectoryEndyA2CmF":{"name":"notFoundCentralDirectoryEnd","abstract":"

End of Central Directoty record wasn’t found.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO14wrongSignatureyA2CmF":{"name":"wrongSignature","abstract":"

Wrong signature of one of container’s structures.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO9wrongSizeyA2CmF":{"name":"wrongSize","abstract":"

Wrong either compressed or uncompressed size of a container’s entry.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO12wrongVersionyA2CmF":{"name":"wrongVersion","abstract":"

Version needed to process container is unsupported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO24multiVolumesNotSupportedyA2CmF":{"name":"multiVolumesNotSupported","abstract":"

Container is either spanned or consists of several volumes. These features aren’t supported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO22encryptionNotSupportedyA2CmF":{"name":"encryptionNotSupported","abstract":"

Entry or record is encrypted. This feature isn’t supported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO20patchingNotSupportedyA2CmF":{"name":"patchingNotSupported","abstract":"

Entry contains patched data. This feature isn’t supported.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO23compressionNotSupportedyA2CmF":{"name":"compressionNotSupported","abstract":"

Entry is compressed using unsupported compression method.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO16wrongLocalHeaderyA2CmF":{"name":"wrongLocalHeader","abstract":"

Local header of an entry is inconsistent with Central Directory.

","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO8wrongCRCyACSayAA0B5EntryVGcACmF":{"name":"wrongCRC(_:)","abstract":"

Computed checksum of entry’s data doesn’t match the value stored in the archive.","parent_name":"ZipError"},"Enums/ZipError.html#/s:13SWCompression8ZipErrorO14wrongTextFieldyA2CmF":{"name":"wrongTextField","abstract":"

Either entry’s comment or file name cannot be processed using UTF-8 encoding.

","parent_name":"ZipError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO10wrongMagicyA2CmF":{"name":"wrongMagic","abstract":"

Either ‘magic’ number in header or footer isn’t equal to a predefined value.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO10wrongFieldyA2CmF":{"name":"wrongField","abstract":"

One of the special fields in archive has an incorrect value,","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO12wrongInfoCRCyA2CmF":{"name":"wrongInfoCRC","abstract":"

Checksum of one of the fields of archive doesn’t match the value stored in archive.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO13wrongFilterIDyA2CmF":{"name":"wrongFilterID","abstract":"

Filter used in archive is unsupported.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO15checkTypeSHA256yA2CmF":{"name":"checkTypeSHA256","abstract":"

Archive uses SHA-256 checksum which is unsupported.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO13wrongDataSizeyA2CmF":{"name":"wrongDataSize","abstract":"

Either size of decompressed data isn’t equal to the one specified in archive or","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO10wrongCheckyACSay10Foundation4DataVGcACmF":{"name":"wrongCheck(_:)","abstract":"

Computed checksum of uncompressed data doesn’t match the value stored in the archive.","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO12wrongPaddingyA2CmF":{"name":"wrongPadding","abstract":"

Padding (null-bytes appended to an archive’s structure) is incorrect.

","parent_name":"XZError"},"Enums/XZError.html#/s:13SWCompression7XZErrorO21multiByteIntegerErroryA2CmF":{"name":"multiByteIntegerError","abstract":"

Either null byte encountered or exceeded maximum amount bytes while reading multi byte number.

","parent_name":"XZError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO20tooSmallFileIsPassedyA2CmF":{"name":"tooSmallFileIsPassed","abstract":"

Data is unexpectedly truncated.

","parent_name":"TarError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO10wrongFieldyA2CmF":{"name":"wrongField","abstract":"

Failed to process a required TAR header’s field.

","parent_name":"TarError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO19wrongHeaderChecksumyA2CmF":{"name":"wrongHeaderChecksum","abstract":"

Computed checksum of a header doesn’t match the value stored in container.

","parent_name":"TarError"},"Enums/TarError.html#/s:13SWCompression8TarErrorO19wrongPaxHeaderEntryyA2CmF":{"name":"wrongPaxHeaderEntry","abstract":"

Entry from PAX extended header is in incorrect format.

","parent_name":"TarError"},"Enums/TarCreateError.html#/s:13SWCompression14TarCreateErrorO16utf8NonEncodableyA2CmF":{"name":"utf8NonEncodable","abstract":"

One of the TarEntryInfo‘s string properties (such as name) cannot be encoded with UTF-8 encoding.

","parent_name":"TarCreateError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO14wrongSignatureyA2CmF":{"name":"wrongSignature","abstract":"

Wrong container’s signature.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO18wrongFormatVersionyA2CmF":{"name":"wrongFormatVersion","abstract":"

Unsupported version of container’s format.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO8wrongCRCyA2CmF":{"name":"wrongCRC","abstract":"

CRC either of one of the files from the container or one of the container’s strucutures is incorrect.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO9wrongSizeyA2CmF":{"name":"wrongSize","abstract":"

Size either of one of the files from the container or one of the container’s strucutures is incorrect.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO20startPosNotSupportedyA2CmF":{"name":"startPosNotSupported","abstract":"

Files have StartPos property. This feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO20externalNotSupportedyA2CmF":{"name":"externalNotSupported","abstract":"

External feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO23multiStreamNotSupportedyA2CmF":{"name":"multiStreamNotSupported","abstract":"

Coders with multiple in and/or out streams aren’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO29additionalStreamsNotSupportedyA2CmF":{"name":"additionalStreamsNotSupported","abstract":"

Additional streams feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO23compressionNotSupportedyA2CmF":{"name":"compressionNotSupported","abstract":"

Entry is compressed using unsupported compression method.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO22encryptionNotSupportedyA2CmF":{"name":"encryptionNotSupported","abstract":"

Entry or container’s header is encrypted. This feature isn’t supported.

","parent_name":"SevenZipError"},"Enums/SevenZipError.html#/s:13SWCompression13SevenZipErrorO017internalStructureD0yA2CmF":{"name":"internalStructureError","abstract":"

Unknown/incorrect internal 7-Zip structure was encountered or a required internal structure is missing.

","parent_name":"SevenZipError"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO19wrongDictionarySizeyA2CmF":{"name":"wrongDictionarySize","abstract":"

Dictionary size is too big, or has reserved bits set, or is in incorrect format in general.

","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO16wrongControlByteyA2CmF":{"name":"wrongControlByte","abstract":"

Unknown conrol byte value of LZMA2 packet.

","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO10wrongResetyA2CmF":{"name":"wrongReset","abstract":"

Unknown reset instruction encountered in LZMA2 packet.

","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:13SWCompression10LZMA2ErrorO10wrongSizesyA2CmF":{"name":"wrongSizes","abstract":"

Either size of decompressed data isn’t equal to the one specified in LZMA2 packet or","parent_name":"LZMA2Error"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO15wrongPropertiesyA2CmF":{"name":"wrongProperties","abstract":"

Properties’ byte is greater than 225.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO21rangeDecoderInitErroryA2CmF":{"name":"rangeDecoderInitError","abstract":"

Unable to initialize RanderDecorer.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO24exceededUncompressedSizeyA2CmF":{"name":"exceededUncompressedSize","abstract":"

Size of uncompressed data hit specified limit in the middle of decoding.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO13windowIsEmptyyA2CmF":{"name":"windowIsEmpty","abstract":"

Unable to perfrom repeat-distance decoding because there is nothing to repeat.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO23rangeDecoderFinishErroryA2CmF":{"name":"rangeDecoderFinishError","abstract":"

End of stream marker is reached, but range decoder is in incorrect state.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO16repeatWillExceedyA2CmF":{"name":"repeatWillExceed","abstract":"

The number of bytes to repeat is greater than the amount bytes that is left to decode.

","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:13SWCompression9LZMAErrorO17notEnoughToRepeatyA2CmF":{"name":"notEnoughToRepeat","abstract":"

The amount of already decoded bytes is smaller than repeat length.

","parent_name":"LZMAError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO10wrongMagicyA2CmF":{"name":"wrongMagic","abstract":"

First two bytes (‘magic’ number) of archive isn’t 31 and 139.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO22wrongCompressionMethodyA2CmF":{"name":"wrongCompressionMethod","abstract":"

Compression method used in archive is different from Deflate, which is the only supported one.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO10wrongFlagsyA2CmF":{"name":"wrongFlags","abstract":"

One of the reserved fields in archive has an unexpected value, which can also mean (apart from damaged archive),","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO14wrongHeaderCRCyA2CmF":{"name":"wrongHeaderCRC","abstract":"

Computed CRC of archive’s header doesn’t match the value stored in archive.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO8wrongCRCyACSayAA0B7ArchiveC6MemberVGcACmF":{"name":"wrongCRC(_:)","abstract":"

Computed checksum of uncompressed data doesn’t match the value stored in the archive.","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO10wrongISizeyA2CmF":{"name":"wrongISize","abstract":"

Computed ‘isize’ didn’t match the value stored in the archive.

","parent_name":"GzipError"},"Enums/GzipError.html#/s:13SWCompression9GzipErrorO21cannotEncodeISOLatin1yA2CmF":{"name":"cannotEncodeISOLatin1","abstract":"

Either specified file name or comment cannot be encoded using ISO Latin-1 encoding.

","parent_name":"GzipError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO29wrongUncompressedBlockLengthsyA2CmF":{"name":"wrongUncompressedBlockLengths","abstract":"

Uncompressed block’s length and nlength bytes isn’t consistent with each other.

","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO14wrongBlockTypeyA2CmF":{"name":"wrongBlockType","abstract":"

Unknown block type (not 0, 1 or 2).

","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO11wrongSymbolyA2CmF":{"name":"wrongSymbol","abstract":"

Decoded symbol was found in Huffman tree but is unknown.

","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:13SWCompression12DeflateErrorO14symbolNotFoundyA2CmF":{"name":"symbolNotFound","abstract":"

Symbol wasn’t found in Huffman tree.

","parent_name":"DeflateError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO9truncatedyA2CmF":{"name":"truncated","abstract":"

Indicates that input data is likely truncated or incomplete.

","parent_name":"DataError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO9corruptedyA2CmF":{"name":"corrupted","abstract":"

Indicates that input data is corrupted, e.g. does not conform to the format specifications or contains other","parent_name":"DataError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO16checksumMismatchyACSay10Foundation0B0VGcACmF":{"name":"checksumMismatch(_:)","abstract":"

Indicates that the computed checksum of the output data does not match the stored checksum. While usually the","parent_name":"DataError"},"Enums/DataError.html#/s:13SWCompression9DataErrorO18unsupportedFeatureyA2CmF":{"name":"unsupportedFeature","abstract":"

Indicates that input data was created using a feature that is not supported by the processing function.

","parent_name":"DataError"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO10wrongMagicyA2CmF":{"name":"wrongMagic","abstract":"

‘Magic’ number is not 0x425a.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO12wrongVersionyA2CmF":{"name":"wrongVersion","abstract":"

BZip version is not 2.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO14wrongBlockSizeyA2CmF":{"name":"wrongBlockSize","abstract":"

Unsupported block size (not from ‘0’ to ‘9’).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO14wrongBlockTypeyA2CmF":{"name":"wrongBlockType","abstract":"

Unsupported block type (is neither ‘pi’ nor ‘sqrt(pi)’).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO15randomizedBlockyA2CmF":{"name":"randomizedBlock","abstract":"

Block is randomized.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO18wrongHuffmanGroupsyA2CmF":{"name":"wrongHuffmanGroups","abstract":"

Wrong number of Huffman tables/groups (should be between 2 and 6).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO13wrongSelectoryA2CmF":{"name":"wrongSelector","abstract":"

Selector is greater than the total number of Huffman tables/groups.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO22wrongHuffmanCodeLengthyA2CmF":{"name":"wrongHuffmanCodeLength","abstract":"

Wrong length of Huffman code (should be between 0 and 20).

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO14symbolNotFoundyA2CmF":{"name":"symbolNotFound","abstract":"

Symbol wasn’t found in Huffman tree.

","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:13SWCompression10BZip2ErrorO8wrongCRCyAC10Foundation4DataVcACmF":{"name":"wrongCRC(_:)","abstract":"

Computed checksum of the uncompressed data does not match the value stored in the archive.","parent_name":"BZip2Error"},"Enums/BZip2Error.html":{"name":"BZip2Error","abstract":"

Represents an error which happened during BZip2 decompression."},"Enums/DataError.html":{"name":"DataError","abstract":"

Represents an error which happened during processing input data.

"},"Enums/DeflateError.html":{"name":"DeflateError","abstract":"

Represents an error which happened during Deflate compression or decompression."},"Enums/GzipError.html":{"name":"GzipError","abstract":"

Represents an error which happened while processing a GZip archive."},"Enums/LZMAError.html":{"name":"LZMAError","abstract":"

Represents an error which happened during LZMA decompression."},"Enums/LZMA2Error.html":{"name":"LZMA2Error","abstract":"

Represents an error which happened during LZMA2 decompression."},"Enums/SevenZipError.html":{"name":"SevenZipError","abstract":"

Represents an error which happened while processing a 7-Zip container."},"Enums/TarCreateError.html":{"name":"TarCreateError","abstract":"

Represents an error which happened during the creation of a new TAR container.

"},"Enums/TarError.html":{"name":"TarError","abstract":"

Represents an error which happened while processing a TAR container."},"Enums/XZError.html":{"name":"XZError","abstract":"

Represents an error which happened while unarchiving an XZ archive."},"Enums/ZipError.html":{"name":"ZipError","abstract":"

Represents an error which happened while processing a ZIP container."},"Enums/ZlibError.html":{"name":"ZlibError","abstract":"

Represents an error which happened while processing a Zlib archive."},"Enums/ZipExtraFieldLocation.html#/s:13SWCompression21ZipExtraFieldLocationO16centralDirectoryyA2CmF":{"name":"centralDirectory","abstract":"

ZIP extra field is located in container’s Central Directory.

","parent_name":"ZipExtraFieldLocation"},"Enums/ZipExtraFieldLocation.html#/s:13SWCompression21ZipExtraFieldLocationO11localHeaderyA2CmF":{"name":"localHeader","abstract":"

ZIP extra field is located in one of container’s Local Headers.

","parent_name":"ZipExtraFieldLocation"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP2ids6UInt16VvpZ":{"name":"id","abstract":"

ID of extra field. Must be equal to the key of extra field in ZipContainer.customExtraFields dictionary and","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP8locationAA0bcD8LocationOvp":{"name":"location","abstract":"

Location of extra field. Must be equal to the value of location argument of init?(_:_:location:).

","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP4sizeSivp":{"name":"size","abstract":"

Size of extra field’s data. Must be equal to the value of the second argument of init?(_:_:location:).

","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldP__8locationxSg11BitByteData012LittleEndianG6ReaderC_SiAA0bcD8LocationOtcfc":{"name":"init(_:_:location:)","abstract":"

Creates an extra field instance reading size amount of data from byteReader.

","parent_name":"ZipExtraField"},"Protocols/ZipExtraField.html#/s:13SWCompression13ZipExtraFieldPAAE2ids6UInt16Vvp":{"name":"id","abstract":"

ID of extra field. Must be equal to the key of extra field in ZipContainer.customExtraFields dictionary and","parent_name":"ZipExtraField"},"Structs/ZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4nameSSvp":{"name":"name","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4sizeSiSgvp":{"name":"size","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV10accessTime10Foundation4DateVSgvp":{"name":"accessTime","abstract":"

Entry’s last access time (nil, if not available).

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV12creationTime10Foundation4DateVSgvp":{"name":"creationTime","abstract":"

Entry’s creation time (nil, if not available).

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

Entry’s last modification time.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV11permissionsAA11PermissionsVSgvp":{"name":"permissions","abstract":"

Entry’s permissions in POSIX format.","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV7commentSSvp":{"name":"comment","abstract":"

Entry’s comment.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV22externalFileAttributess6UInt32Vvp":{"name":"externalFileAttributes","abstract":"

Entry’s external file attributes. ZIP internal property.","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV13dosAttributesAA03DosF0VSgvp":{"name":"dosAttributes","abstract":"

Entry’s attributes in DOS format.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV10isTextFileSbvp":{"name":"isTextFile","abstract":"

True, if entry is likely to be text or ASCII file.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV14fileSystemTypeAA04FilefG0Ovp":{"name":"fileSystemType","abstract":"

File system type of container’s origin.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV17compressionMethodAA011CompressionF0Ovp":{"name":"compressionMethod","abstract":"

Entry’s compression method.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV7ownerIDSiSgvp":{"name":"ownerID","abstract":"

ID of entry’s owner.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV7groupIDSiSgvp":{"name":"groupID","abstract":"

ID of the group of entry’s owner.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV17customExtraFieldsSayAA0bF5Field_pGvp":{"name":"customExtraFields","abstract":"

Entry’s custom extra fields from both Central Directory and Local Header.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntryInfo.html#/s:13SWCompression12ZipEntryInfoV3crcs6UInt32Vvp":{"name":"crc","abstract":"

CRC32 of entry’s data.

","parent_name":"ZipEntryInfo"},"Structs/ZipEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","parent_name":"ZipEntry"},"Structs/ZipEntry.html#/s:13SWCompression14ContainerEntryP4data10Foundation4DataVSgvp":{"name":"data","parent_name":"ZipEntry"},"Classes/ZipContainer.html#/s:13SWCompression12ZipContainerC17customExtraFieldsSDys6UInt16VAA0bE5Field_pXpGvpZ":{"name":"customExtraFields","abstract":"

Contains user-defined extra fields. When either ZipContainer.info(container:) or ZipContainer.open(container:)","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:13SWCompression12ZipContainerC4open9containerSayAA0B5EntryVG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

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

","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:13SWCompression12ZipContainerC4info9containerSayAA0B9EntryInfoVG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

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

","parent_name":"ZipContainer"},"Classes/ZipContainer.html":{"name":"ZipContainer","abstract":"

Provides functions for work with ZIP containers.

"},"Structs/ZipEntry.html":{"name":"ZipEntry","abstract":"

Represents an entry from the ZIP container.

"},"Structs/ZipEntryInfo.html":{"name":"ZipEntryInfo","abstract":"

Provides access to information about an entry from the ZIP container.

"},"Protocols/ZipExtraField.html":{"name":"ZipExtraField","abstract":"

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

"},"Enums/ZipExtraFieldLocation.html":{"name":"ZipExtraFieldLocation","abstract":"

Location of ZIP extra field inside a container.

"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV4nameSSvp":{"name":"name","abstract":"

Entry’s name.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV4sizeSiSgvp":{"name":"size","abstract":"

Entry’s data size.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV10accessTime10Foundation4DateVSgvp":{"name":"accessTime","abstract":"

Entry’s last access time (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV12creationTime10Foundation4DateVSgvp":{"name":"creationTime","abstract":"

Entry’s creation time (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

Entry’s last modification time.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP11permissionsAA11PermissionsVSgvp":{"name":"permissions","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV17compressionMethodAA011CompressionF0Ovp":{"name":"compressionMethod","abstract":"

Entry’s compression method. Always .copy for the entries of TAR containers.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7ownerIDSiSgvp":{"name":"ownerID","abstract":"

ID of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7groupIDSiSgvp":{"name":"groupID","abstract":"

ID of the group of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV13ownerUserNameSSSgvp":{"name":"ownerUserName","abstract":"

User name of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV14ownerGroupNameSSSgvp":{"name":"ownerGroupName","abstract":"

Name of the group of entry’s owner.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV17deviceMajorNumberSiSgvp":{"name":"deviceMajorNumber","abstract":"

Device major number (used when entry is either block or character special file).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV17deviceMinorNumberSiSgvp":{"name":"deviceMinorNumber","abstract":"

Device minor number (used when entry is either block or character special file).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7charsetSSSgvp":{"name":"charset","abstract":"

Name of the character set used to encode entry’s data (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV7commentSSSgvp":{"name":"comment","abstract":"

Entry’s comment (only available for PAX format; nil otherwise).

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV8linkNameSSvp":{"name":"linkName","abstract":"

Path to a linked file for symbolic link entry.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV28unknownExtendedHeaderRecordsSDyS2SGSgvp":{"name":"unknownExtendedHeaderRecords","abstract":"

All custom (unknown) records from global and local PAX extended headers. nil, if there were no headers.

","parent_name":"TarEntryInfo"},"Structs/TarEntryInfo.html#/s:13SWCompression12TarEntryInfoV4name4typeACSS_AA09ContainerC4TypeOtcfc":{"name":"init(name:type:)","abstract":"

Initializes the entry’s info with its name and type.

","parent_name":"TarEntryInfo"},"Structs/TarEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","parent_name":"TarEntry"},"Structs/TarEntry.html#/s:13SWCompression8TarEntryV4data10Foundation4DataVSgvp":{"name":"data","abstract":"

Entry’s data (nil if entry is a directory or data isn’t available).

","parent_name":"TarEntry"},"Structs/TarEntry.html#/s:13SWCompression8TarEntryV4info4dataAcA0bC4InfoV_10Foundation4DataVSgtcfc":{"name":"init(info:data:)","abstract":"

Initializes the entry with its info and data. The stored info.size will also be updated to be equal to","parent_name":"TarEntry"},"Structs/TarWriter.html#/s:13SWCompression9TarWriterV10fileHandle5forceACSo06NSFileE0C_AA0B9ContainerC6FormatOtcfc":{"name":"init(fileHandle:force:)","abstract":"

Creates a new instance for writing TAR entries using the specified format into the provided fileHandle.

","parent_name":"TarWriter"},"Structs/TarWriter.html#/s:13SWCompression9TarWriterV6appendyyAA0B5EntryVKF":{"name":"append(_:)","abstract":"

Adds a new TAR entry at the end of the TAR container.

","parent_name":"TarWriter"},"Structs/TarWriter.html#/s:13SWCompression9TarWriterV8finalizeyyKF":{"name":"finalize()","abstract":"

Finalizes the TAR container by adding an EOF marker.

","parent_name":"TarWriter"},"Structs/TarReader.html#/s:13SWCompression9TarReaderV10fileHandleACSo06NSFileE0C_tcfc":{"name":"init(fileHandle:)","abstract":"

Creates a new instance for reading TAR entries from the provided fileHandle.

","parent_name":"TarReader"},"Structs/TarReader.html#/s:13SWCompression9TarReaderV7processyxxAA0B5EntryVSgKXEKlF":{"name":"process(_:)","abstract":"

Processes the next TAR entry by reading it from the container and calling the provided closure on the result. If","parent_name":"TarReader"},"Structs/TarReader.html#/s:13SWCompression9TarReaderV4readAA0B5EntryVSgyKF":{"name":"read()","abstract":"

Reads the next TAR entry from the container.

","parent_name":"TarReader"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO8prePosixyA2EmF":{"name":"prePosix","abstract":"

Pre POSIX format (aka “basic TAR format”).

","parent_name":"Format"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO5ustaryA2EmF":{"name":"ustar","abstract":"

“UStar” format introduced by POSIX IEEE P1003.1 standard.

","parent_name":"Format"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO3gnuyA2EmF":{"name":"gnu","abstract":"

“UStar”-like format with GNU extensions (e.g. special container entries for long file and link names).

","parent_name":"Format"},"Classes/TarContainer/Format.html#/s:13SWCompression12TarContainerC6FormatO3paxyA2EmF":{"name":"pax","abstract":"

“PAX” format introduced by POSIX.1-2001 standard, a set of extensions to “UStar” format.

","parent_name":"Format"},"Classes/TarContainer/Format.html":{"name":"Format","abstract":"

Represents the “format” of a TAR container: a minimal set of extensions to basic TAR format required to","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC8formatOf9containerAC6FormatO10Foundation4DataV_tKFZ":{"name":"formatOf(container:)","abstract":"

Processes TAR container and returns its “format”: a minimal set of extensions to basic TAR format required to","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC6create4from10Foundation4DataVSayAA0B5EntryVG_tFZ":{"name":"create(from:)","abstract":"

Creates a new TAR container with entries as its content and generates its Data.

","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC6create4from5force10Foundation4DataVSayAA0B5EntryVG_AC6FormatOtFZ":{"name":"create(from:force:)","abstract":"

Creates a new TAR container with entries as its content and generates its Data using the specified format.

","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC4open9containerSayAA0B5EntryVG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

Processes TAR container and returns an array of TarEntry with information and data for all entries.

","parent_name":"TarContainer"},"Classes/TarContainer.html#/s:13SWCompression12TarContainerC4info9containerSayAA0B9EntryInfoVG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

Processes TAR container and returns an array of TarEntryInfo with information about entries in this container.

","parent_name":"TarContainer"},"Classes/TarContainer.html":{"name":"TarContainer","abstract":"

Provides functions for work with TAR containers.

"},"Structs/TarReader.html":{"name":"TarReader","abstract":"

A type that allows to iteratively read TAR entries from a container provided by a FileHandle.

"},"Structs/TarWriter.html":{"name":"TarWriter","abstract":"

A type that allows to iteratively create TAR containers with the output being written into a FileHandle.

"},"Structs/TarEntry.html":{"name":"TarEntry","abstract":"

Represents an entry from the TAR container.

"},"Structs/TarEntryInfo.html":{"name":"TarEntryInfo","abstract":"

Provides access to information about an entry from the TAR container.

"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4nameSSvp":{"name":"name","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4sizeSiSgvp":{"name":"size","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP4typeAA0bC4TypeOvp":{"name":"type","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP10accessTime10Foundation4DateVSgvp":{"name":"accessTime","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP12creationTime10Foundation4DateVSgvp":{"name":"creationTime","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression18ContainerEntryInfoP11permissionsAA11PermissionsVSgvp":{"name":"permissions","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV13winAttributess6UInt32VSgvp":{"name":"winAttributes","abstract":"

Entry’s “win attributes”. 7-Zip internal property.","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV13dosAttributesAA03DosG0VSgvp":{"name":"dosAttributes","abstract":"

Entry’s attributes in DOS format.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV9hasStreamSbvp":{"name":"hasStream","abstract":"

True, if entry has a stream (data) inside the container. 7-Zip internal propety.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV7isEmptySbvp":{"name":"isEmpty","abstract":"

True, if entry is an empty file. 7-Zip internal property.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV6isAntiSbvp":{"name":"isAnti","abstract":"

True, if entry is an anti-file. Used in differential backups to indicate that file should be deleted.","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntryInfo.html#/s:13SWCompression17SevenZipEntryInfoV3crcs6UInt32VSgvp":{"name":"crc","abstract":"

CRC32 of entry’s data.

","parent_name":"SevenZipEntryInfo"},"Structs/SevenZipEntry.html#/s:13SWCompression14ContainerEntryP4info4InfoQzvp":{"name":"info","parent_name":"SevenZipEntry"},"Structs/SevenZipEntry.html#/s:13SWCompression14ContainerEntryP4data10Foundation4DataVSgvp":{"name":"data","parent_name":"SevenZipEntry"},"Classes/SevenZipContainer.html#/s:13SWCompression17SevenZipContainerC4open9containerSayAA0bC5EntryVG10Foundation4DataV_tKFZ":{"name":"open(container:)","abstract":"

Processes 7-Zip container and returns an array of SevenZipEntry with information and data for all entries.

","parent_name":"SevenZipContainer"},"Classes/SevenZipContainer.html#/s:13SWCompression17SevenZipContainerC4info9containerSayAA0bC9EntryInfoVG10Foundation4DataV_tKFZ":{"name":"info(container:)","abstract":"

Processes 7-Zip container and returns an array of SevenZipEntryInfo with information about entries in this","parent_name":"SevenZipContainer"},"Classes/SevenZipContainer.html":{"name":"SevenZipContainer","abstract":"

Provides functions for work with 7-Zip containers.

"},"Structs/SevenZipEntry.html":{"name":"SevenZipEntry","abstract":"

Represents an entry from the 7-Zip container.

"},"Structs/SevenZipEntryInfo.html":{"name":"SevenZipEntryInfo","abstract":"

Provides access to information about an entry from the 7-Zip container.

"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO16fastestAlgorithmyA2EmF":{"name":"fastestAlgorithm","abstract":"

Fastest algorithm.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO13fastAlgorithmyA2EmF":{"name":"fastAlgorithm","abstract":"

Fast algorithm.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO16defaultAlgorithmyA2EmF":{"name":"defaultAlgorithm","abstract":"

Default algorithm.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:13SWCompression10ZlibHeaderV16CompressionLevelO13slowAlgorithmyA2EmF":{"name":"slowAlgorithm","abstract":"

Slowest algorithm but with maximum compression.

","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html":{"name":"CompressionLevel","abstract":"

Levels of compression which can be used to create Zlib archive.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV17compressionMethodAA011CompressionE0Ovp":{"name":"compressionMethod","abstract":"

Compression method of archive. Always .deflate for Zlib archives.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV16compressionLevelAC011CompressionE0Ovp":{"name":"compressionLevel","abstract":"

Level of compression used in archive.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV10windowSizeSivp":{"name":"windowSize","abstract":"

Size of ‘window’: moving interval of data which was used to make archive.

","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:13SWCompression10ZlibHeaderV7archiveAC10Foundation4DataV_tKcfc":{"name":"init(archive:)","abstract":"

Initializes the structure with the values from Zlib archive.

","parent_name":"ZlibHeader"},"Classes/ZlibArchive.html#/s:13SWCompression11ZlibArchiveC9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchives Zlib archive.

","parent_name":"ZlibArchive"},"Classes/ZlibArchive.html#/s:13SWCompression11ZlibArchiveC7archive4data10Foundation4DataVAH_tFZ":{"name":"archive(data:)","abstract":"

Archives data into Zlib archive. Data will be also compressed with Deflate algorithm.","parent_name":"ZlibArchive"},"Classes/XZArchive.html#/s:13SWCompression9XZArchiveC9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchives XZ archive. Archives with multiple streams are supported,","parent_name":"XZArchive"},"Classes/XZArchive.html#/s:13SWCompression9XZArchiveC14splitUnarchive7archiveSay10Foundation4DataVGAH_tKFZ":{"name":"splitUnarchive(archive:)","abstract":"

Unarchives XZ archive. Archives with multiple streams are supported,","parent_name":"XZArchive"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldV3si1s5UInt8Vvp":{"name":"si1","abstract":"

First byte of the extra field (subfield) ID.

","parent_name":"ExtraField"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldV3si2s5UInt8Vvp":{"name":"si2","abstract":"

Second byte of the extra field (subfield) ID.

","parent_name":"ExtraField"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldV5bytesSays5UInt8VGvp":{"name":"bytes","abstract":"

Binary content of the extra field.

","parent_name":"ExtraField"},"Structs/GzipHeader/ExtraField.html#/s:13SWCompression10GzipHeaderV10ExtraFieldVyAEs5UInt8V_AGSayAGGtcfc":{"name":"init(_:_:_:)","abstract":"

Initializes an extra field with the specified extra field (subfield) ID bytes and its binary content.

","parent_name":"ExtraField"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV17compressionMethodAA011CompressionE0Ovp":{"name":"compressionMethod","abstract":"

Compression method of archive. Always .deflate for GZip archives.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV16modificationTime10Foundation4DateVSgvp":{"name":"modificationTime","abstract":"

The most recent modification time of the original file. If corresponding archive’s field is set to 0, which means","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV6osTypeAA010FileSystemE0Ovp":{"name":"osType","abstract":"

Type of file system on which archivation took place.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV8fileNameSSSgvp":{"name":"fileName","abstract":"

Name of the original file. If archive doesn’t contain file’s name, then nil.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV7commentSSSgvp":{"name":"comment","abstract":"

Comment stored in archive. If archive doesn’t contain any comment, then nil.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV10isTextFileSbvp":{"name":"isTextFile","abstract":"

True, if file is likely to be text file or ASCII-file.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV11extraFieldsSayAC10ExtraFieldVGvp":{"name":"extraFields","abstract":"

Extra fields present in the header.

","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:13SWCompression10GzipHeaderV7archiveAC10Foundation4DataV_tKcfc":{"name":"init(archive:)","abstract":"

Initializes the structure with the values from the first ‘member’ of GZip archive.

","parent_name":"GzipHeader"},"Structs/GzipHeader/ExtraField.html":{"name":"ExtraField","abstract":"

Represents an extra field in the header of a GZip archive.

","parent_name":"GzipHeader"},"Classes/GzipArchive/Member.html#/s:13SWCompression11GzipArchiveC6MemberV6headerAA0B6HeaderVvp":{"name":"header","abstract":"

GZip header of a member.

","parent_name":"Member"},"Classes/GzipArchive/Member.html#/s:13SWCompression11GzipArchiveC6MemberV4data10Foundation4DataVvp":{"name":"data","abstract":"

Unarchived data from a member.

","parent_name":"Member"},"Classes/GzipArchive/Member.html":{"name":"Member","abstract":"

Represents the member of a multi-member GZip archive.

","parent_name":"GzipArchive"},"Classes/GzipArchive.html#/s:13SWCompression11GzipArchiveC9unarchive7archive10Foundation4DataVAH_tKFZ":{"name":"unarchive(archive:)","abstract":"

Unarchives GZip archive.

","parent_name":"GzipArchive"},"Classes/GzipArchive.html#/s:13SWCompression11GzipArchiveC14multiUnarchive7archiveSayAC6MemberVG10Foundation4DataV_tKFZ":{"name":"multiUnarchive(archive:)","abstract":"

Unarchives multi-member GZip archive.","parent_name":"GzipArchive"},"Classes/GzipArchive.html#/s:13SWCompression11GzipArchiveC7archive4data7comment8fileName14writeHeaderCRC10isTextFile6osType16modificationTime11extraFields10Foundation4DataVAO_SSSgAPS2bAA0n6SystemP0OSgAM4DateVSgSayAA0bJ0V10ExtraFieldVGtKFZ":{"name":"archive(data:comment:fileName:writeHeaderCRC:isTextFile:osType:modificationTime:extraFields:)","abstract":"

Archives data into GZip archive, using various specified options.","parent_name":"GzipArchive"},"Classes/GzipArchive.html":{"name":"GzipArchive","abstract":"

Provides unarchive and archive functions for GZip archives.

"},"Structs/GzipHeader.html":{"name":"GzipHeader","abstract":"

Represents the header of a GZip archive.

"},"Classes/XZArchive.html":{"name":"XZArchive","abstract":"

Provides unarchive function for XZ archives.

"},"Classes/ZlibArchive.html":{"name":"ZlibArchive","abstract":"

Provides unarchive and archive functions for Zlib archives.

"},"Structs/ZlibHeader.html":{"name":"ZlibHeader","abstract":"

Represents the header of a Zlib archive.

"},"Enums/LZ4.html#/s:13SWCompression3LZ4O10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using LZ4 algortihm.

","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O10decompress4data10dictionary0E2ID10Foundation4DataVAJ_AJSgs6UInt32VSgtKFZ":{"name":"decompress(data:dictionary:dictionaryID:)","abstract":"

Decompresses data using LZ4 algortihm and provided external dictionary.

","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O15multiDecompress4data10dictionary0F2IDSay10Foundation4DataVGAJ_AJSgs6UInt32VSgtKFZ":{"name":"multiDecompress(data:dictionary:dictionaryID:)","abstract":"

Decompresses data, which may represent several concatenated LZ4 frames, using LZ4 algortihm and provided external","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O8compress4data10Foundation4DataVAH_tFZ":{"name":"compress(data:)","abstract":"

Compresses data using LZ4 algortihm with default format and algorithm options.

","parent_name":"LZ4"},"Enums/LZ4.html#/s:13SWCompression3LZ4O8compress4data17independentBlocks14blockChecksums15contentChecksum0I4Size0gK010dictionary0L2ID10Foundation4DataVAO_S4bSiAOSgs6UInt32VSgtFZ":{"name":"compress(data:independentBlocks:blockChecksums:contentChecksum:contentSize:blockSize:dictionary:dictionaryID:)","abstract":"

Compresses data using LZ4 algortihm.

","parent_name":"LZ4"},"Classes/LZMA2.html#/s:13SWCompression5LZMA2C10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using LZMA2 algortihm.

","parent_name":"LZMA2"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2lcSivp":{"name":"lc","abstract":"

Number of bits used for the literal encoding context. Default value is 3.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2lpSivp":{"name":"lp","abstract":"

Number of bits to include in “literal position state”. Default value is 0.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2pbSivp":{"name":"pb","abstract":"

Number of bits to include in “position state”. Default value is 2.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV14dictionarySizeSivp":{"name":"dictionarySize","abstract":"

Size of the dictionary. Default value is 1 << 24.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesV2lc2lp2pb14dictionarySizeACSi_S3itcfc":{"name":"init(lc:lp:pb:dictionarySize:)","abstract":"

Initializes LZMA properties with values of lc, lp, pb, and dictionary size.

","parent_name":"LZMAProperties"},"Structs/LZMAProperties.html#/s:13SWCompression14LZMAPropertiesVACycfc":{"name":"init()","abstract":"

Initializes LZMA properties with default values of lc, lp, pb, and dictionary size.

","parent_name":"LZMAProperties"},"Classes/LZMA.html#/s:13SWCompression4LZMAC10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using LZMA.

","parent_name":"LZMA"},"Classes/LZMA.html#/s:13SWCompression4LZMAC10decompress4data10properties16uncompressedSize10Foundation4DataVAJ_AA14LZMAPropertiesVSiSgtKFZ":{"name":"decompress(data:properties:uncompressedSize:)","abstract":"

Decompresses data using LZMA with specified algorithm’s properties, and, optionally, output’s","parent_name":"LZMA"},"Classes/Deflate.html#/s:13SWCompression7DeflateC10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using Deflate algortihm.

","parent_name":"Deflate"},"Classes/Deflate.html#/s:13SWCompression7DeflateC8compress4data10Foundation4DataVAH_tFZ":{"name":"compress(data:)","abstract":"

Compresses data with Deflate algortihm.

","parent_name":"Deflate"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO3oneyA2EmF":{"name":"one","abstract":"

100 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO3twoyA2EmF":{"name":"two","abstract":"

200 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO5threeyA2EmF":{"name":"three","abstract":"

300 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO4fouryA2EmF":{"name":"four","abstract":"

400 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO4fiveyA2EmF":{"name":"five","abstract":"

500 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO3sixyA2EmF":{"name":"six","abstract":"

600 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO5sevenyA2EmF":{"name":"seven","abstract":"

700 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO5eightyA2EmF":{"name":"eight","abstract":"

800 KB.

","parent_name":"BlockSize"},"Classes/BZip2/BlockSize.html#/s:13SWCompression5BZip2C9BlockSizeO4nineyA2EmF":{"name":"nine","abstract":"

900 KB.

","parent_name":"BlockSize"},"Classes/BZip2.html#/s:13SWCompression5BZip2C10decompress4data10Foundation4DataVAH_tKFZ":{"name":"decompress(data:)","abstract":"

Decompresses data using BZip2 algortihm.

","parent_name":"BZip2"},"Classes/BZip2.html#/s:13SWCompression5BZip2C15multiDecompress4dataSay10Foundation4DataVGAH_tKFZ":{"name":"multiDecompress(data:)","abstract":"

Decompresses one or more concatenated BZip2 archives found in data.

","parent_name":"BZip2"},"Classes/BZip2/BlockSize.html":{"name":"BlockSize","abstract":"

Represents the size of the blocks in which data is split during BZip2 compression.

","parent_name":"BZip2"},"Classes/BZip2.html#/s:13SWCompression5BZip2C8compress4data10Foundation4DataVAH_tFZ":{"name":"compress(data:)","abstract":"

Compresses data with BZip2 algortihm.

","parent_name":"BZip2"},"Classes/BZip2.html#/s:13SWCompression5BZip2C8compress4data9blockSize10Foundation4DataVAI_AC05BlockF0OtFZ":{"name":"compress(data:blockSize:)","abstract":"

Compresses data with BZip2 algortihm, splitting data into blocks of specified blockSize.

","parent_name":"BZip2"},"Classes/BZip2.html":{"name":"BZip2","abstract":"

Provides functions for compression and decompression for BZip2 algorithm.

"},"Classes/Deflate.html":{"name":"Deflate","abstract":"

Provides functions for compression and decompression for Deflate algorithm.

"},"Classes/LZMA.html":{"name":"LZMA","abstract":"

Provides decompression function for LZMA.

"},"Structs/LZMAProperties.html":{"name":"LZMAProperties","abstract":"

Properties of LZMA. This API is intended to be used by advanced users.

"},"Classes/LZMA2.html":{"name":"LZMA2","abstract":"

Provides decompression function for LZMA2 algorithm.

"},"Enums/LZ4.html":{"name":"LZ4","abstract":"

Provides functions for compression and decompression for LZ4 algorithm.

"},"Compression.html":{"name":"Compression"},"Archives.html":{"name":"Archives"},"7-Zip.html":{"name":"7-Zip"},"TAR.html":{"name":"TAR"},"ZIP.html":{"name":"ZIP"},"Errors.html":{"name":"Errors"},"Protocols.html":{"name":"Protocols"},"Common%20Auxiliary%20Types.html":{"name":"Common Auxiliary Types"}} \ No newline at end of file diff --git a/undocumented.json b/undocumented.json new file mode 100644 index 00000000..f42809e0 --- /dev/null +++ b/undocumented.json @@ -0,0 +1,4 @@ +{ + "warnings": [], + "source_directory": "/Users/runner/work/1/s" +} \ No newline at end of file