Skip to content

Releases: CTMacUser/ClassicFourCharCode

0.3.0

25 Dec 18:51

Choose a tag to compare

  • Third release
  • "ClassicFourCharCode" is a prohibitively long name to repeatedly use, so "Simple4CC" is added to shorten code.

0.2.0

29 Oct 06:13

Choose a tag to compare

  • Second Release
  • As codes are typically used as values frequently defined or read atomically but almost never read or changed at the coded-character level:
    • Mutability at the coded-character level has been removed.
    • Sequence, Collection, and DataProtocol support have been removed.
    • Since inline arrays have been added to the language, all the old additional initializers have been replaced. There is now an initializer that takes an inline array of four bytes.
    • To complement that inline-array initializer, the octets property returns the coded characters as separate elements of an inline array of four bytes.

0.1.0

15 Apr 03:11
8cf77ce

Choose a tag to compare

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.