Skip to content

3.0.0

Choose a tag to compare

@tsolomko tsolomko released this 31 May 20:28
· 1771 commits to develop since this release
v3.0.0
38bd80b

General

  • All errors have been renamed, so they conform to Swift Naming Conventions (lowerCamelCase).
  • Added Container and ContainerEntry protocols.
  • Most methods have their arguments' labels shortened.
  • Most documentation have been edited to improve readability.
  • Multiple files with results of performance tests replaced with consolidated one.

Containers

TAR

  • Added support for TAR containers of various formats.
    Comment: Supported versions include pre-POSIX standard, gnu format as well as pax format with extended headers.

ZIP

  • Enabled support for LZMA and BZip2 compression algorithms.
    Comment: If you use SWCompression through Cocoapods then this support is enabled depending on which subspecs are installed. For example, if you have SWCompression/LZMA and SWCompression/ZIP both installed, then containers with files compressed using LZMA will be automatically supported. Other configurations (Carthage or Swift Package Manager) include all parts of framework, so they will have this support enabled by default.
  • ZipEntry now conforms to ContainerEntry protocol.
  • ZipContainer now conforms to Container protocol.
  • Entry's data is now provided through ZipEntry.data() instead of ZipContainer's function.
  • Improved detection of directories if container was created on MS-DOS or UNIX-like systems.
  • Associated value of ZipError.wrongCRC32 now contains entry's data.
  • Fixed a problem where Zip64 sized fields weren't used during processing of Data Descriptor.
  • Added some measures to prevent crashes when it is impossible to read text fields (file name or comment) in UTF-8 encoding.
    Comment: This resulted in addition of new ZipError and it was necessary because, apparently, default ZIP encoding is IBM Code Page 437.

Archives

GZip

  • Now unarchive function unarchives only first 'member' of archive.
    Comment: Multi-member GZip archives are basically several concatenated archives. Previously, unarchiving such multi-member archive resulted in all data being compounded into one Data object, while in reality these were, probably, separate files. So, it was decided to remain unarchiving of only first member and add a multi-member unarchiving function in the future.
  • Added support for archive's options in archive function.
    Comment: This includes original file name, comment, modification time, etc.
  • GzipHeader.modificationTime is now Optional.
    Comment: nil value represents situation when no modification time was set in an archive.
  • GzipHeader.originalFileName renamed to GzipHeader.fileName.
  • Added GzipHeader.isTextFile property which corresponds to a flag in archive's header with the same name.

XZ

  • Now unarchive function unarchives only first stream of archive.
    Comment: The reasoning behind this change is the same as for similar GZip change. By the way, this also fixes (technically speaking) a problem of incorrect processing of Stream Padding. If you are worried, the actual fix for padding problem has also been developed.
  • Check for archive's footer's 'magic' bytes is now performed at the beginning of processing.
    Comment: According to XZ format specification, archives with wrong footer 'magic' bytes cannot be undamaged or complete. So by performing this check bad archives can be discarded without decoding the entire archive.
  • Header's checksum is now checked before parsing reserved flags.
    Comment: Earlier corrupted files could be mistakenly recognized as archives with set reserved flags. This change allows better detection of corruption.

Decompression

  • CRC32 check for decompressed data is now performed during BZip2 decompression.
    Comment: If it fails, then error is thrown, and associated value of error contains already decompressed data (similar to other checksums checks).
  • Removed internal LZMAOutWindow auxiliary class.