Skip to content

Commit

Permalink
Add Codable conformance to Header and add count property to `ArArch…
Browse files Browse the repository at this point in the history
…iveReader` (#5)
  • Loading branch information
LebJe authored Jun 11, 2021
1 parent 83199a6 commit d21ccf5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Sources/ArArchiveKit/ArArchiveReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Sources/ArArchiveKit/Header.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d21ccf5

Please sign in to comment.