You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,66 @@
1
+
# 0.2.0
2
+
3
+
This minor unstable release renames `sequentialContainer` to `container` for both the BinaryEncoder and BinaryDecoder types, adds support for `BinaryFloatingPoint` decoding and encoding, automatic BinaryCodable conformance for floating point and array types, and a variety of performance improvements.
4
+
5
+
## Breaking changes
6
+
7
+
`BinaryDecoder` and `BinaryEncoder`'s `sequentialContainer` has been renamed to `container`. This is a straightforward find-and-replace operation.
8
+
9
+
## New features
10
+
11
+
`Array<BinaryCodable>` types automatically conform to BinaryCodable. It's easier now to code sequential binary objects like so:
12
+
13
+
```swift
14
+
// Decoding
15
+
let objects =try container.decode([SomeBinaryObject].self)
16
+
17
+
// Encoding
18
+
try container.encode(objects)
19
+
```
20
+
21
+
`Float` and `Double` RawRepresentable types automatically conform to BinaryCodable.
22
+
23
+
## Source changes
24
+
25
+
*[Remove excessive conditionals and buffer containment. (#40)](https://github.com/jverkoey/BinaryCodable/commit/4daaee9f3cf4c66da0f488940f5681e03b510306) (featherless)
*[Fix bug and improve performance. (#39)](https://github.com/jverkoey/BinaryCodable/commit/1e9c21bc4be6e5501825665c0a73f9e87b909ffa) (featherless)
28
+
*[Remove unnecessary Data creation. (#38)](https://github.com/jverkoey/BinaryCodable/commit/49ca3e2430a51af9fd37afb15ee9b902789153e3) (featherless)
29
+
*[Use dropFirst instead of subscript notation when reading data. (#37)](https://github.com/jverkoey/BinaryCodable/commit/b1889da65bde47336bf9fa9418cde40863ffb09e) (featherless)
30
+
*[Add floating point support. (#23)](https://github.com/jverkoey/BinaryCodable/commit/2e3185ec72a7371ef9402e46b80f161849052ae9) (featherless)
31
+
*[Add array coding support + tests. (#14)](https://github.com/jverkoey/BinaryCodable/commit/9a56a79308d1096c31479f1c592b5fa331be0707) (featherless)
32
+
*[Drop "Sequential" from the container name. (#12)](https://github.com/jverkoey/BinaryCodable/commit/6b9d1ab11d77f1654dc7ef9c28eec2f52dbccf8f) (featherless)
33
+
34
+
## Non-source changes
35
+
36
+
*[Update all docs with new container APIs. (#41)](https://github.com/jverkoey/BinaryCodable/commit/c2843b87559d485cbffe7b299fd31e6ac841dc59) (featherless)
*[Add support for embedded types in the proto decoder. (#35)](https://github.com/jverkoey/BinaryCodable/commit/397ccc9bb1dff24bba000b7d42d82a0115a8c74c) (featherless)
41
+
*[Add bytes decoding support to the proto decoder. (#34)](https://github.com/jverkoey/BinaryCodable/commit/1328fce67b03b5a41d99730389f21068150d2d4a) (featherless)
42
+
*[Add String support to the proto decoder. (#33)](https://github.com/jverkoey/BinaryCodable/commit/07e1c1c3fea8ac4def6fa89639a7c30e9ace217d) (featherless)
43
+
*[Add bool support to the proto decoder. (#32)](https://github.com/jverkoey/BinaryCodable/commit/0e93d2224f1a5303ec411015f8ae312aa17beb28) (featherless)
44
+
*[Add sint64 support to the proto decoder. (#31)](https://github.com/jverkoey/BinaryCodable/commit/8108735cc28ec8ad1cda549b6b5ce30ca3783427) (featherless)
*[Add support for optional proto decoding. (#29)](https://github.com/jverkoey/BinaryCodable/commit/b87134d57dc152978bc214f0c7c5a13a3c033144) (featherless)
47
+
*[Add double decoding support to the proto decoder. (#28)](https://github.com/jverkoey/BinaryCodable/commit/4c303bfa0d1a6e259ab55674a7afe18409e2ebad) (featherless)
48
+
*[Rename the message fields to match the underlying types. (#27)](https://github.com/jverkoey/BinaryCodable/commit/6d937eca935c2eaed901771be83d3c124aa338d8) (featherless)
49
+
*[Add proper fixed64 support to the proto decoder. (#26)](https://github.com/jverkoey/BinaryCodable/commit/1c227a1e8f15e709d42cf8cdf0a13221b7a96e49) (featherless)
50
+
*[ Add fixed32 support to the proto decoder. (#25)](https://github.com/jverkoey/BinaryCodable/commit/e135e3ca651b91cafe5bcb3ae5babec3935fbad3) (featherless)
51
+
*[Add double/fixed64 support to the proto proof of concept. (#24)](https://github.com/jverkoey/BinaryCodable/commit/6e32bee3c8fc98a0ab4b588a0fad0df6226e7769) (featherless)
52
+
*[Add a rudimentary Codable-compatible proto decoder built on top of a BinaryCodable message decoder. (#22)](https://github.com/jverkoey/BinaryCodable/commit/21cf2f7c4a7e03f039bd8750ee1e6c91869aecd2) (featherless)
53
+
*[Add sint32 proto tests (#21)](https://github.com/jverkoey/BinaryCodable/commit/33f58fc19bbc7ca2bdfd78cc1aee034cdf06607d) (featherless)
54
+
*[Add int64 proto tests. (#20)](https://github.com/jverkoey/BinaryCodable/commit/17adab86bedc1981254ac431134a1fd6ed812ab2) (featherless)
55
+
*[Add int32 overflow tests to verify the behavior of the protoc compiler. (#19)](https://github.com/jverkoey/BinaryCodable/commit/6d4b7c9eb11643904602c68bfb5079d5e71fe5d2) (featherless)
56
+
*[ Add proof of concept protobuf decoder tests (#15)](https://github.com/jverkoey/BinaryCodable/commit/96bf29b4f9fc808c5e1772fe2712f4018e1265ee) (featherless)
57
+
*[Update Swift to the latest development snapshot (#13)](https://github.com/jverkoey/BinaryCodable/commit/9cca6e629d352890181d81ce0d2dd47dd2bd6649) (featherless)
*[Fix typo in readme. (#10)](https://github.com/jverkoey/BinaryCodable/commit/ba811ac24e7114628d22792e60620e144b410c88) (featherless)
60
+
*[Add missing linux tests. (#9)](https://github.com/jverkoey/BinaryCodable/commit/d2d2c558f0c4d205ff51816965dc3be62fb69a10) (featherless)
61
+
62
+
---
63
+
1
64
# 0.1.0
2
65
3
66
This is the first minor, unstable release of BinaryCodable. The public API for this library is subject to change unexpectedly until 1.0.0 is reached, at which point breaking changes will be mitigated and communicated ahead of time. This initial release includes the following features:
Copy file name to clipboardExpand all lines: Docs/README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,6 @@ struct GIFHeader {
22
22
23
23
We'll implement decoding first because it's easier to test our code against an existing gif file.
24
24
25
-
Aside: the biggest distinction between Swift Codable and Binary Codable is that we do not get encoding and decoding implementations for complex types for free. This is presently by design, though there are [opportunities for improving this in the future](https://github.com/jverkoey/BinaryCodable/issues/4). That being said, Binary Codable does provide automatic implementations for RawRepresentable types (namely enums with raw values).
26
-
27
25
```swift
28
26
// New
29
27
importBinaryCodable
@@ -41,6 +39,8 @@ let decoder = BinaryDataDecoder()
41
39
let header =try decoder.decode(GIFHeader.self, from: data)
42
40
```
43
41
42
+
Aside: the biggest distinction between Swift Codable and Binary Codable is that we do not get encoding and decoding implementations for complex types for free. This is presently by design, though there are [opportunities for improving this in the future](https://github.com/jverkoey/BinaryCodable/issues/4). That being said, Binary Codable does provide automatic implementations for RawRepresentable types (namely enums with raw values).
43
+
44
44
Like Swift Codable, we first create a sequential container.
45
45
46
46
Note: the container variable needs to be a `var` because we will mutate it.
1. Clearly defined the expected values for this field.
148
-
2. Added error handling for unexpected values: if a GIF format version other than 87a or 89a are encountered, a `BinaryDecodingError.dataCorrupted` exception will be thrown.
148
+
2. Added error handling for unexpected values: if a GIF format version other than 87a or 89a is encountered, a `BinaryDecodingError.dataCorrupted` exception will be thrown.
149
149
150
150
Note: we can also apply this pattern to `signature` using a single-value String enum. Try cleaning up your implementation accordingly!
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Binary Codable
2
2
3
-
Binary Codable provides Swift Codable-like interfaces for converting types into and from binary representations.
3
+
Binary Codable provides Swift Codable-like interfaces for converting types to and from binary representations.
4
4
5
5
Binary Codable is optimized for reading and writing blocks of binary data as a stream of bytes. This makes Binary Codable useful for network protocols, binary file formats, and other forms of tightly-packed binary information.
6
6
@@ -34,7 +34,8 @@ This is not an official Google product.
34
34
35
35
## Known usage in the wild
36
36
37
-
-[MySqlConnector](https://github.com/jverkoey/MySqlConnector): Translates between Swift types and MySql client/server protocol.
37
+
-[BinaryCookies](https://github.com/interstateone/BinaryCookies): Read and write Apple's .binarycookies files.
38
+
-[MySqlConnector](https://github.com/jverkoey/MySqlConnector): A pure Swift implementation of the MySql client/server protocol.
0 commit comments