15 Commits

Author SHA1 Message Date
Jeremy Schonfeld
acae3d26b6
Implement isoLatin1 and macOSRoman encoding (#743)
* Implement isoLatin1 and macOSRoman encoding

* Limit new behavior to non-framework build
2024-07-25 08:52:30 -07:00
Tony Parker
9218bda96a
Only use the underscored utf16 function when we are a contiguous UTF8 string. (#685)
Co-authored-by: Jeremy Schonfeld <jschonfeld@apple.com>
2024-06-17 15:23:13 -07:00
Jeremy Schonfeld
b1acbafbca
Fix calloc build failure on macOS (#680) 2024-06-14 09:47:54 -07:00
Tony Parker
e53bc1ccd4
Unify UTF16 conversion path for String (#670) 2024-06-13 10:00:04 -07:00
Jeremy Schonfeld
727bd07830
Utilize URL in FileManager (#589)
* Use URL in FileManager

* Fix warnings

* Fix build failures on Linux

* Remove Locale_ICU warning fix
2024-05-07 15:55:08 -07:00
Jeremy Schonfeld
cd9c0da71b
(123921236) Implement ASCII encoding for String.data(using:) (#557)
* Implement ASCII encoding for String.data(using:)

* Add early check for allASCII if available

* Move from Collections API to stdlib API
2024-04-26 14:32:32 -07:00
Jeremy Schonfeld
ad1c3fc865
(123127047) Remove _foundation_essentials_feature_enabled
Co-authored-by: Tony Parker <anthony.parker@apple.com>
2024-04-09 16:06:05 -07:00
Tony Parker
0be1758b4f Various fixes to make PropertyListEncoder and PropertyListDecoder build cross-platform 2024-03-06 15:57:33 -08:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Tina Liu
b316fad5dc
Remove _foundation_essentials_feature_enabled guard in FOUNDATION_FRAMEWORK (#387)
Enable the code paths guarded behind the feature flag unconditionally now that the feature flag has been enabled for quite a while now.
2024-01-29 11:12:11 -08:00
Charles Hu
14eb5a1f60
Addressed compiler warnings and updated the incorrect license headers (#190) 2023-06-28 11:00:02 -07:00
Karoy Lorentey
85d1021e51
rdar://109907151&110477287 Fix StringProtocol.lineRange(for:)/paragraphRange(for:) (#174)
These started by converting `self` into a `String`. This lead to crashes when `self` happened to be a Substring, as the input range isn’t necessarily a valid index range in the resulting string in that case.

While I’m here, review related helper functions to improve performance and to avoid more correctness issues.
2023-06-09 14:21:12 -07:00
Alexander Cyon
09606b457d
Fix typos (#68) 2023-04-29 06:28:00 -07:00
Charles Hu
c01e9dadee
rdar://107955097 (FoundationPreview: Batch move string API (continued)) (#34)
* 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>
2023-04-17 18:23:51 -07:00
Charles Hu
e2c177e867 Rebased on top of the new String APIs 2023-03-29 09:56:22 -07:00