Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
cmo-me committed Nov 14, 2020
1 parent 16fda8d commit ecf81be
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/Piz/Piz.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

/// A simple unzipper.
public struct Piz {
public class Piz {
/// Zip data.
public let data: Data

Expand All @@ -21,13 +21,17 @@ public struct Piz {
_bytes = bytes
_cdirs = dirs
}

deinit {
_bytes.deallocate()
}

/// Creates an instance from `fileURL`.
public init?(fileURL: URL) {
public convenience init?(fileURL: URL) {
guard let data = try? Data(contentsOf: fileURL) else { return nil }
self.init(data: data)
}

private let _bytes: UnsafePointer<UInt8>
private let _cdirs: [String: CDir]
}
Expand Down

0 comments on commit ecf81be

Please sign in to comment.