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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
0.1.0
First Release
Introduces the ClassicFourCharCode type, which is a wrapper for the Foundation type FourCharCode. Older compilers supported the type natively, able to set the numeric value based on the four-character string given.
The adaptor type is represented as conforming ClassicFourCharCode to RawRepresentable. The basic behaviors of BitwiseCopyable, Equatable, and Hashable are automatically supported. The type is declared to be safe for Sendable.
Codes can be printed in its classic text (CustomStringConvertible) or a debug-friendly numeric (CustomDebugStringConvertible) representation. Since the classic representation can contain embedded NUL or other control characters, the computed read-only isPrintable property warns when that occurs. The type is also supports Encodable for export.
Codes can be imported from reversing the above serializations with Decodable and LosslessStringConvertible support. (The latter supports both the classic text or debugging numeric formats.) There are additional initializers for: four copies of the same octet value, four individual octet values, extraction from an iterator, and reading from a sequence. The latter two are failable if the input is too short (and possibly too long).
The individual octets of a code can be read/written with Collection support. They can be read through memory buffer(s) with ContiguousBytes and DataProtocol support.