* (rdar://106881898) JSONEncoder should only use references for JSON encoding tree
* (rdar://107967520) Initial opportunities for JSONEncoder performance optimization
---------
Co-authored-by: Kevin Perry <kperry@apple.com>
* rdar://107729601 (Move Error to FoundationPreview)
* rdar://107729601 -- Use stub URL and regular String Encoding
* rdar://107729601 -- Take out RawRepresentable conformance, because changing it was an ABI break
* rdar://107729601 -- Rename Error.swift to CocoaError.swift
Co-authored-by: Tony Parker <anthony.parker@apple.com>
* rdar://107955097 (FoundationPreview: Batch move string API (continued))
- Move localized uppercase and lowercase to FoundationLocalization
- if-def out of CharacterSet from FoundationPreview. It's not implemented at all there, and having a no-op stub is misleading
* rdar://107955097 (FoundationPreview: Batch move string API (continued))
- Move components separated by string and range of string functions
* rdar://107955097 (FoundationPreview: Batch move string API (continued))
Enable snake case options for JSON encoder and decoder. We haven't been able to enable this option because it needed `CharacterSet`, which hasn't been properly implemented for FoundationPreview. Now that we have `BuiltInUnicodeScalarSet`, which mirrors `CharacterSet`, we can switch to that and enable the options.
* rdar://107955097 (FoundationPreview: Batch move string API (continued))
- Move `StringProtocol.lineRange(for:)` and `paragraphRange(for:)` to FoundationEssentials
- Rename String+Regex.swift to RegexPatternCache.swift
- Consolidate extensions on various String family members and remove one redundant swift file
---------
Co-authored-by: I-Ting Tina Liu <iting_liu@apple.com>
Move case mapping API to FoundationEssentials and FoundationInternationalization:
- Essentials: Unlocalized caplitalized
- Internationalization: Localized caplitalized, lowercased, uppercased
Note that in the tests, we test the internal implementation instead of the public function. This is because these functions are declared as public function of
`extension StringProtocol`, so there are two declarations on Darwin: once in FoundationPreview and once in system SDK. There is currently no way to specify which one is intended when building the package on Darwin.
Add a Swift-native character set that mirrors CF/NSCharacterSet to support FoundationEssentials. We will use this type to back `CharacterSet`, which is currently NS-bridged, when we get to re-core it when the time comes.
Currently it's only used for String capitalization.