49 Commits

Author SHA1 Message Date
Jonathan Flat
27476f9814
(149316573) Remove URL workaround for Linux crash once SCL-F is rebuilt (#1252) 2025-04-23 12:51:10 -06:00
Jonathan Flat
914b9f7bbd
Support NS/CFURL re-core in Swift (#1238)
* (146349351) Support NS/CFURL re-core in Swift

* Fix .fileSystemPath() calls in Windows test

* Use encoded strings for .absoluteURL, fix NSURL bridging and CFURL lastPathComponent edge cases

* Add workaround for crash on Linux

* Fix typo
2025-04-11 22:37:51 -06:00
Jonathan Flat
f751db3371
Use lstat() semantics for URL directory detection (#1204)
* (145233243) Use lstat() semantics for URL directory detection

* Fix Windows try?, fix symlink path in test

* Check for reparse point flag explicitly

* Move path.isEmpty check outside
2025-03-07 16:15:51 -07:00
Jonathan Flat
cb0cab29fc
(141584267) URL inits should resolve file reference paths (#1140) 2025-01-27 11:00:17 -07:00
Jonathan Flat
0784cfebb9
(142574625) Allow non-numeric port when bridging from CFURL (#1129) 2025-01-22 09:13:57 -08:00
Jonathan Flat
b9852c2b4a
(142667792) URL.absoluteString crashes if baseURL starts with colon (#1119) 2025-01-21 12:36:28 -08:00
Jonathan Flat
2bc9094c21
(142589056) URLComponents.string should percent-encode colons in first path segment if needed (#1117) 2025-01-13 12:33:35 -07:00
Charles Hu
37fcb35724
Make URLResourceValues private properties internal (#1116) 2025-01-09 16:57:58 -08:00
Jonathan Flat
bbe96fcad5
(141691128) Add URL compatibility path for .deletingLastPathComponent().standardized (#1114) 2025-01-09 17:12:57 -07:00
Jonathan Flat
b1b2add3de
(142446243) Compatibility behaviors for Swift URL (#1113) 2025-01-08 11:34:13 -07:00
Jonathan Flat
61811e3b87
(142076445) Allow URL.standardized to return an empty string URL (#1110)
* (142076445) Allow URL.standardized to return an empty string URL

* Add ?? self to prevent force-unwrap
2025-01-03 11:45:35 -07:00
Jonathan Flat
ee1a608fc5
(141549683) Restore behavior of URL(string: "") returning nil (#1103) 2024-12-20 12:02:57 -07:00
Jonathan Flat
6bf5c90b86
(141256674) Add compatibility check for malformed URL(filePath:) input (#1097) 2024-12-16 10:49:43 -07:00
Jonathan Flat
309d460181
(141225066) Add linked-on-or-after check for empty URL.host() (#1092) 2024-12-12 15:55:00 -08:00
Jonathan Flat
8a95c62e3e
(141294361) URL.appendingPathExtension("") appends a trailing dot (#1082) 2024-12-11 14:20:31 -08:00
Jonathan Flat
105cf0830a
Clean up Swift URL build flags (#1063)
* (138140144) Clean up Swift URL build flag

* Skip home tilde URL test on Windows
2024-12-02 15:20:59 -07:00
Jonathan Flat
13c8aeb5c2
URL.path should not strip trailing slash for root paths on Windows (#1038)
* (139379934) URL should not strip trailing slash for root paths on Windows

* Use PathIsRootW to ensure we don't strip a root slash
2024-11-11 15:38:21 -07:00
Jonathan Flat
78fa839860
(138354331) Add linked-on-or-after check for apps that pass an empty URL string (#1042) 2024-11-11 10:55:06 -07:00
Jonathan Flat
09d9e34688
(138788176) Add flag for CFURLs originating from Swift (#1026) 2024-10-30 12:29:12 -07:00
Jonathan Flat
255c8b16e7
(138781500) Fix IS_DECOMPOSABLE flag when bridging to CFURL (#1018) 2024-10-28 15:15:33 -06:00
Jonathan Flat
d14ef7ea2b
(138168197) Restore URL.host bracket stripping for compatibility (#1008) 2024-10-25 14:14:48 -06:00
Jonathan Flat
5a497cc503
(138059777) URL.deletingLastPathComponent() should append .. in special cases (#989) 2024-10-25 10:46:53 -06:00
Jonathan Flat
f0779922da
(138059051) URL: Appending to an empty file path results in an absolute path (#988) 2024-10-23 13:24:26 -06:00
Jonathan Flat
efdf0f3c38
(138167666) Prevent crash when bridging an invalid CFURL to Swift URL (#993) 2024-10-21 10:44:29 -06:00
Jonathan Flat
002921d5e3
Add back Swift URL code for compatibility debugging (#970)
This reverts "Remove unused Swift URL code (#949)" commit b2d323e1a805ec4f2db19d4cc49ed4430a201b2a.
2024-10-08 16:41:35 -07:00
Jonathan Flat
5141cf6957
(137068266) URL.fileSystemPath should strip leading slash for Windows drive letters (#964) 2024-10-07 12:01:37 -06:00
Jonathan Flat
d44a56f621
(137129292) URL(filePath:) should not treat "~" as absolute (#961) 2024-10-03 13:55:26 -07:00
Janosch Hildebrand
847ad03e94
Fix minor copy-paste error in deprecation message (#955)
Fix two instances of visionOS deprecation messages mentioning the wrong replacement method.
2024-10-02 09:54:51 -07:00
Jonathan Flat
b2d323e1a8
(135904218) Remove unused Swift URL code (#949) 2024-09-27 15:03:11 -07:00
Jeremy Schonfeld
da80d51fa3
(134376602) Change @_nonSendable to unavailable extensions (#892) 2024-09-03 10:46:46 -07:00
Jonathan Flat
2966e02ae6
(134231086) URL.host should not return percent-encoded host (#875) 2024-08-21 16:41:59 -07:00
Jonathan Flat
37fd6b8b25
(133882014) URL(filePath: path, directoryHint: .notDirectory) should strip trailing slashes (#867) 2024-08-19 11:19:35 -07:00
Jonathan Flat
83073e236e
(133878310) URL.fileSystemPath should drop all trailing slashes (#852) 2024-08-16 09:32:42 -07:00
LamTrinh.Dev
22b8e4600c
Adding some more tests for [U]Int128 in BinaryInteger+FormatStyleTests.swift and JSONEncoderTests.swift (#806)
* Update JSONEncoderTests.swift

Update minimum OS version for Int128 in testTypeCoercion()

* Update JSONEncoderTests.swift

Add more Int128 test for testTypeCoercion()

* Update JSONEncoderTests.swift

Add more test case Int128 for for testTypeCoercion()

* Update JSONEncoderTests.swift

Add more test case UInt128 for for testTypeCoercion()

* Update URL.swift

Correct typo comment from "resovled" to "resolved" at URL.swift

* Update BinaryInteger+FormatStyleTests.swift

Adding more case to testing [U]Int128

* Update BinaryInteger+FormatStyleTests.swift

Adding more case to testing [U]Int128

* Update JSONEncoderTests.swift

Replace "@available" with "#available".

* Update BinaryInteger+FormatStyleTests.swift

Replace "@available" with "#available".
2024-08-02 08:51:08 -07:00
Jonathan Flat
628fe671f9
Prevent null character in Windows home directory (#808) 2024-08-01 21:03:00 -07:00
Jonathan Flat
e1223a03f5
(132587065) URL: Don't standardize relative file paths (#792) 2024-07-27 10:48:00 -07:00
Jonathan Flat
4956b8fc19
(132421368) URL: Don't percent-encode an appended component as a first path segment (#766) 2024-07-25 10:42:09 -07:00
Jeremy Schonfeld
f0adc5ede6
(132269652) Avoid checking filesystem when constructing path errors (#762) 2024-07-24 09:50:00 -07:00
Tina Liu
2d517e846d
Missing visionOS availability for API_TO_BE_DEPRECATED (#737)
* Missing visionOS availability for API_TO_BE_DEPRECATED

Fixed 131763349

* Fix deprecation message
2024-07-16 13:58:55 -07:00
Jonathan Flat
b22ff2b757
(129922624) Don't convert already-converted NSURLs (#692) 2024-06-20 22:27:39 -06:00
Jeremy Schonfeld
762698ea5e
(128609033) Avoid crashing due to malformed paths creating URLs (#646) 2024-05-31 13:50:26 -07:00
Saleem Abdulrasool
6946239486
FoundationEssentials: use named constants for characters (#620)
Use more named constants when checking for matching constants in the
string.
2024-05-20 11:58:38 -06:00
Saleem Abdulrasool
67c4d1a12b
FoundationEssentials: do not strip non-absolute paths (#621)
We would strip the first characters of a path if it were non-absolute.
For special files like `CON` we would end up stripping the name to `N`.
2024-05-20 09:36:50 -07:00
Jonathan Flat
e991656bd0
URL.init(filePath:) should resolve against the base URL before checking if the file is a directory (#606) 2024-05-13 17:22:28 -07:00
Jonathan Flat
4a526630f8
Support Windows URL paths in FoundationEssentials (#602) 2024-05-13 19:22:08 +00:00
Jeremy Schonfeld
df5fa4e8c6
Minor fixes to support using URL in swift-corelibs-foundation (#601)
* Respect directory status when standardizing/resolving symlinks in URL

* Use correct NSURLErrorKey declaration
2024-05-09 17:20:21 -07:00
Saleem Abdulrasool
e07817cbd6
FoundationEssentials: recover from backslide on Windows (#593)
This new helper was added but did not support windows as `stat` is a
Unix operation and the Windows equivalent is more nuanced when you are
trying to minimise IO overheads. Add a Windows specific path to repair
the build on Windows.
2024-05-08 14:04:19 -07:00
Jeremy Schonfeld
543a9e4cd7
Use URL in JSON/Data APIs (#588)
* Use URL in JSON/Data APIs

* path -> URL

* Use fileSystemPath instead of path(percentEncoded:)

* Correct resource loading on linux
2024-05-08 12:58:00 -07:00
Jonathan Flat
361efcf5fe
Port URL and URLComponents to swift-foundation (#586) 2024-05-06 09:51:18 -07:00