mirror of
https://github.com/apple/swift-foundation.git
synced 2025-05-16 01:42:23 +08:00
Compare commits
3 Commits
60ff1d9990
...
4afc919603
Author | SHA1 | Date | |
---|---|---|---|
|
4afc919603 | ||
|
fa43c96f5f | ||
|
e201fe928a |
Proposals
Sources/FoundationEssentials
@ -1,6 +1,6 @@
|
||||
# URI Templating
|
||||
|
||||
* Proposal: [SF-00020](00020-uri-templating.md)
|
||||
* Proposal: [SF-0020](0020-uri-templating.md)
|
||||
* Authors: [Daniel Eggert](https://github.com/danieleggert)
|
||||
* Review Manager: [Tina L](https://github.com/itingliu)
|
||||
* Status: **Review: March 14, 2025...March 21, 2025**
|
@ -201,7 +201,40 @@ extension stat {
|
||||
}
|
||||
}
|
||||
|
||||
#if FOUNDATION_FRAMEWORK
|
||||
extension FileProtectionType {
|
||||
var intValue: Int32? {
|
||||
switch self {
|
||||
case .complete: PROTECTION_CLASS_A
|
||||
case .init(rawValue: "NSFileProtectionWriteOnly"), .completeUnlessOpen: PROTECTION_CLASS_B
|
||||
case .init(rawValue: "NSFileProtectionCompleteUntilUserAuthentication"), .completeUntilFirstUserAuthentication: PROTECTION_CLASS_C
|
||||
case .none: PROTECTION_CLASS_D
|
||||
#if !os(macOS)
|
||||
case .completeWhenUserInactive: PROTECTION_CLASS_CX
|
||||
#endif
|
||||
default: nil
|
||||
}
|
||||
}
|
||||
|
||||
init?(intValue value: Int32) {
|
||||
switch value {
|
||||
case PROTECTION_CLASS_A: self = .complete
|
||||
case PROTECTION_CLASS_B: self = .completeUnlessOpen
|
||||
case PROTECTION_CLASS_C: self = .completeUntilFirstUserAuthentication
|
||||
case PROTECTION_CLASS_D: self = .none
|
||||
#if !os(macOS)
|
||||
case PROTECTION_CLASS_CX: self = .completeWhenUserInactive
|
||||
#endif
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extension FileAttributeKey {
|
||||
fileprivate static var _extendedAttributes: Self { Self("NSFileExtendedAttributes") }
|
||||
}
|
||||
|
||||
extension _FileManagerImpl {
|
||||
func createFile(
|
||||
|
@ -69,6 +69,12 @@ extension stat {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if FOUNDATION_FRAMEWORK && os(macOS)
|
||||
extension URLResourceKey {
|
||||
static var _finderInfoKey: Self { URLResourceKey("_NSURLFinderInfoKey") }
|
||||
}
|
||||
#endif
|
||||
|
||||
extension _FileManagerImpl {
|
||||
#if os(macOS) && FOUNDATION_FRAMEWORK
|
||||
private struct _HFSFinderInfo {
|
||||
|
@ -271,65 +271,4 @@ extension BidirectionalCollection where Element == Unicode.Scalar, Index == Stri
|
||||
|
||||
}
|
||||
|
||||
// START: Workaround for https://github.com/swiftlang/swift/pull/78697
|
||||
|
||||
// The extensions below are temporarily relocated to work around a compiler crash.
|
||||
// Once that crash is resolved, they should be moved back to their original files.
|
||||
|
||||
#if !NO_FILESYSTEM
|
||||
|
||||
// Relocated from FileManager+Utilities.swift
|
||||
#if FOUNDATION_FRAMEWORK && os(macOS)
|
||||
extension URLResourceKey {
|
||||
static var _finderInfoKey: Self { URLResourceKey("_NSURLFinderInfoKey") }
|
||||
}
|
||||
#endif
|
||||
|
||||
// Relocated from FileManager+Files.swift
|
||||
#if FOUNDATION_FRAMEWORK
|
||||
internal import DarwinPrivate.sys.content_protection
|
||||
#endif
|
||||
|
||||
#if !os(Windows)
|
||||
#if FOUNDATION_FRAMEWORK
|
||||
extension FileProtectionType {
|
||||
var intValue: Int32? {
|
||||
switch self {
|
||||
case .complete: PROTECTION_CLASS_A
|
||||
case .init(rawValue: "NSFileProtectionWriteOnly"), .completeUnlessOpen: PROTECTION_CLASS_B
|
||||
case .init(rawValue: "NSFileProtectionCompleteUntilUserAuthentication"), .completeUntilFirstUserAuthentication: PROTECTION_CLASS_C
|
||||
case .none: PROTECTION_CLASS_D
|
||||
#if !os(macOS)
|
||||
case .completeWhenUserInactive: PROTECTION_CLASS_CX
|
||||
#endif
|
||||
default: nil
|
||||
}
|
||||
}
|
||||
|
||||
init?(intValue value: Int32) {
|
||||
switch value {
|
||||
case PROTECTION_CLASS_A: self = .complete
|
||||
case PROTECTION_CLASS_B: self = .completeUnlessOpen
|
||||
case PROTECTION_CLASS_C: self = .completeUntilFirstUserAuthentication
|
||||
case PROTECTION_CLASS_D: self = .none
|
||||
#if !os(macOS)
|
||||
case PROTECTION_CLASS_CX: self = .completeWhenUserInactive
|
||||
#endif
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if !NO_FILESYSTEM
|
||||
// Relocated from FileManager+Files.swift. Originally fileprivate.
|
||||
extension FileAttributeKey {
|
||||
internal static var _extendedAttributes: Self { Self("NSFileExtendedAttributes") }
|
||||
}
|
||||
#endif
|
||||
|
||||
// END: Workaround for https://github.com/swiftlang/swift/pull/78697
|
||||
|
Loading…
x
Reference in New Issue
Block a user