Files
SWCompression/Sources/ZlibError.swift
T
Timofey Solomko 39eea7c42a Split code into separate files
Overtime size of source files became unmanageble, so it is better to split them. Also internal zip structure have been renamed to include word zip.
2017-07-06 18:41:30 +03:00

27 lines
986 B
Swift

// Copyright (c) 2017 Timofey Solomko
// Licensed under MIT License
//
// See LICENSE for license information
import Foundation
/**
Represents an error, which happened during processing Zlib archive.
It may indicate that either archive is damaged or it might not be Zlib archive at all.
*/
public enum ZlibError: Error {
/// Compression method used in archive is different from Deflate, which is the only supported one.
case wrongCompressionMethod
/// Compression info has value incompatible with Deflate compression method.
case wrongCompressionInfo
/// First two bytes of archive's flags are inconsistent with each other.
case wrongFcheck
/// Compression level has value, which is different from the supported ones.
case wrongCompressionLevel
/**
Computed checksum of uncompressed data doesn't match the value stored in archive.
Associated value of the error contains already decompressed data.
*/
case wrongAdler32(Data)
}