-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
break up LZ77.DecompressionError into subtypes, and objectify the LZ7…
…7.MRC32 type
- Loading branch information
1 parent
60f7347
commit 9567397
Showing
9 changed files
with
181 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
extension LZ77 | ||
{ | ||
/// Errors that can occur when decompressing a DEFLATE stream embedded in the ‘zlib’ wrapper | ||
/// format. | ||
public | ||
enum StreamHeaderError:Error, Equatable | ||
{ | ||
/// A compressed data stream had an invalid compression method code. | ||
/// | ||
/// The compression method code should always be `8`. | ||
case invalidCompressionMethod(UInt8) | ||
|
||
/// A compressed data stream specified an invalid window size. | ||
/// | ||
/// The window size exponent should be in the range `8 ... 15`. | ||
case invalidWindowSize(exponent:Int) | ||
|
||
/// A compressed data stream had invalid header check bits. | ||
/// | ||
/// The header check bits should not be confused with the modular redundancy checksum, | ||
/// which corresponds to the ``invalidStreamChecksum(declared:computed:)`` error case. | ||
case invalidCheckBits | ||
|
||
/// A compressed data stream contains a stream dictionary, which is not allowed in a | ||
/// compressed PNG data stream. | ||
case unexpectedDictionary | ||
} | ||
} |
Oops, something went wrong.