Commit Graph

10 Commits

Author SHA1 Message Date
Michael LeHew
ef35a001e6 NSKeyed{Una,A}rchiver should support Codable 2017-07-19 16:43:55 -07:00
Itai Ferber
e1007a2e3b Make coding paths non-optional
For the benefit of unkeyed containers, coding paths currently contain optional `CodingKey`s — unkeyed containers are allowed to report a `nil` key in a path. However, this is unhelpful for debugging purposes, or inspecting the coding path for context, since any unkeyed container simply reports `nil`, whether it’s at index 1 or 1000.

Now all containers are required to report a non-optional CodingKey for their segment of the coding path, and coding paths are now exposed as `[CodingKey]`.
2017-06-30 12:43:40 -07:00
Itai Ferber
92fccf964b Fix coding error bridging to NSError
CustomNSError briding only works when the CustomNSError conformance is in the same module as the original error declaration. We need to sink these down into the standard library.
2017-06-28 14:33:15 -07:00
Itai Ferber
012ea9373b Add Codable conformance to common Foundation types
Add conformances + unit tests for

* CGFloat
* AffineTransform
* Calendar
* CharacterSet
* DateComponents
* DateInterval
* Decimal
* IndexPath
* IndexSet
* Locale
* Measurement
* NSRange
* PersonNameComponents
* TimeZone
* URL
* UUID

along with some unit tests for each.
2017-05-18 07:56:03 -07:00
Michael Ilseman
75c476b984 Revert "Add Codable conformance to common Foundation types"
This reverts commit dee889f4d0.
2017-05-17 11:56:31 -07:00
Itai Ferber
dee889f4d0 Add Codable conformance to common Foundation types
Add conformances + unit tests for
* CGFloat
* AffineTransform
* Calendar
* CharacterSet
* DateComponents
* DateInterval
* Decimal
* IndexPath
* IndexSet
* Locale
* Measurement
* NSRange
* PersonNameComponents
* TimeZone
* URL
* UUID

along with some unit tests for each.
2017-05-16 16:57:46 -07:00
Itai Ferber
c5fc1e3f78 Use encode(contentsOf:) instead of a loop 2017-04-28 23:38:26 -07:00
Itai Ferber
c6f8834d26 Remove unnecessary CodingKey implementation 2017-04-28 23:38:26 -07:00
Itai Ferber
44682f7a72 Ensure all Dates can always round-trip by default 2017-04-28 23:38:26 -07:00
Itai Ferber
2ce58c1eb3 Add JSON and property list encoders and decoders
* Integrate {JSON,PropertyList}{Encoder,Decoder} types to facilitate
  encoding types in JSON and property list formats
* Adds Foundation-specific extensions to allow errors exposed from the
  stdlib to bridge to NSErrors
2017-04-28 23:38:25 -07:00