diff --git a/CHANGELOG.md b/CHANGELOG.md index 577dcda..7420eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.1](https://github.com/LebJe/ArArchiveKit/releases/tag/0.2.1) - 2021-06-11 + +### Added + +- `Header` now conforms to `Codable`. +- `ArArchiveReader` now has a `count` property. + ## [0.2.0](https://github.com/LebJe/ArArchiveKit/releases/tag/0.2.0) - 2021-05-02 ### Added diff --git a/Sources/ArArchiveKit/ArArchiveReader.swift b/Sources/ArArchiveKit/ArArchiveReader.swift index f971bee..1977936 100644 --- a/Sources/ArArchiveKit/ArArchiveReader.swift +++ b/Sources/ArArchiveKit/ArArchiveReader.swift @@ -22,6 +22,9 @@ public struct ArArchiveReader { /// public var headers: [Header] = [] + /// The amount of files in this archive. + public var count: Int { self.headers.count } + /// The initializer reads all the `ar` headers in preparation for random access to the header's file contents later. /// /// - Parameters: diff --git a/Sources/ArArchiveKit/Header.swift b/Sources/ArArchiveKit/Header.swift index f473eb4..959191e 100644 --- a/Sources/ArArchiveKit/Header.swift +++ b/Sources/ArArchiveKit/Header.swift @@ -8,7 +8,7 @@ /// /// This header is placed atop the contents of a file in the archive to /// provide information such as the size of the file, the file's name, it's permissions, etc. -public struct Header: Equatable { +public struct Header: Equatable, Codable { /// The file's name. The name will be truncated to 16 characters if the archive's `Variant` is `common`. public internal(set) var name: String