Skip to content

Commit f17b5a2

Browse files
authored
Merge pull request #2977 from spevans/pr_split_out_types
Split out some types into their own files
2 parents 09587ca + c6637cc commit f17b5a2

File tree

11 files changed

+1338
-1260
lines changed

11 files changed

+1338
-1260
lines changed

Foundation.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@
403403
B94B063C23FDE2BD00B244E8 /* SwiftFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B5D885D1BBC938800234F36 /* SwiftFoundation.framework */; };
404404
B951B5EC1F4E2A2000D8B332 /* TestNSLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B951B5EB1F4E2A2000D8B332 /* TestNSLock.swift */; };
405405
B95FC97622B84B0A005DEA0A /* TestNSSortDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152EF3932283457B001E1269 /* TestNSSortDescriptor.swift */; };
406+
B96C10F625BA1EFD00985A32 /* NSURLComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = B96C10F525BA1EFD00985A32 /* NSURLComponents.swift */; };
407+
B96C110025BA20A600985A32 /* NSURLQueryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B96C10FF25BA20A600985A32 /* NSURLQueryItem.swift */; };
408+
B96C110A25BA215800985A32 /* URLResourceKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = B96C110925BA215800985A32 /* URLResourceKey.swift */; };
409+
B96C112525BA2CE700985A32 /* URLQueryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B96C112425BA2CE700985A32 /* URLQueryItem.swift */; };
410+
B96C113725BA376D00985A32 /* NSDateComponents.swift in Sources */ = {isa = PBXBuildFile; fileRef = B96C113625BA376D00985A32 /* NSDateComponents.swift */; };
406411
B983E32C23F0C69600D9C402 /* Docs in Resources */ = {isa = PBXBuildFile; fileRef = B983E32B23F0C69600D9C402 /* Docs */; };
407412
B983E32E23F0C6E200D9C402 /* CONTRIBUTING.md in Resources */ = {isa = PBXBuildFile; fileRef = B983E32D23F0C6E200D9C402 /* CONTRIBUTING.md */; };
408413
B98E33DD2136AA740044EBE9 /* TestFileWithZeros.txt in Resources */ = {isa = PBXBuildFile; fileRef = B98E33DC2136AA740044EBE9 /* TestFileWithZeros.txt */; };
@@ -1108,6 +1113,11 @@
11081113
B951B5EB1F4E2A2000D8B332 /* TestNSLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestNSLock.swift; sourceTree = "<group>"; };
11091114
B95FC97222AF0050005DEA0A /* SwiftXCTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftXCTest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
11101115
B95FC97422AF051B005DEA0A /* xcode-build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "xcode-build.sh"; sourceTree = "<group>"; };
1116+
B96C10F525BA1EFD00985A32 /* NSURLComponents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSURLComponents.swift; sourceTree = "<group>"; };
1117+
B96C10FF25BA20A600985A32 /* NSURLQueryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSURLQueryItem.swift; sourceTree = "<group>"; };
1118+
B96C110925BA215800985A32 /* URLResourceKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLResourceKey.swift; sourceTree = "<group>"; };
1119+
B96C112425BA2CE700985A32 /* URLQueryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLQueryItem.swift; sourceTree = "<group>"; };
1120+
B96C113625BA376D00985A32 /* NSDateComponents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSDateComponents.swift; sourceTree = "<group>"; };
11111121
B983E32B23F0C69600D9C402 /* Docs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Docs; sourceTree = "<group>"; };
11121122
B983E32D23F0C6E200D9C402 /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = "<group>"; };
11131123
B98E33DC2136AA740044EBE9 /* TestFileWithZeros.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestFileWithZeros.txt; sourceTree = "<group>"; };
@@ -2095,6 +2105,7 @@
20952105
5BC1B9AB21F275D500524D8C /* NSData+DataProtocol.swift */,
20962106
5BDC3F331BCC5DCB00ED97BB /* NSData.swift */,
20972107
5BDC3F341BCC5DCB00ED97BB /* NSDate.swift */,
2108+
B96C113625BA376D00985A32 /* NSDateComponents.swift */,
20982109
EADE0B5A1BD15DFF00C49C64 /* NSDecimalNumber.swift */,
20992110
5BDC3F361BCC5DCB00ED97BB /* NSDictionary.swift */,
21002111
5BDC3F371BCC5DCB00ED97BB /* NSEnumerator.swift */,
@@ -2133,6 +2144,8 @@
21332144
EADE0B7B1BD15DFF00C49C64 /* NSTextCheckingResult.swift */,
21342145
5BDC3F491BCC5DCB00ED97BB /* NSTimeZone.swift */,
21352146
5BDC3F4A1BCC5DCB00ED97BB /* NSURL.swift */,
2147+
B96C10F525BA1EFD00985A32 /* NSURLComponents.swift */,
2148+
B96C10FF25BA20A600985A32 /* NSURLQueryItem.swift */,
21362149
EADE0B811BD15DFF00C49C64 /* NSURLError.swift */,
21372150
5BDC3F4B1BCC5DCB00ED97BB /* NSUUID.swift */,
21382151
5BDC3F4C1BCC5DCB00ED97BB /* NSValue.swift */,
@@ -2163,6 +2176,8 @@
21632176
5BECBA3B1D1CAF8800B39B1F /* Unit.swift */,
21642177
5B23AB8C1CE63228000DB898 /* URL.swift */,
21652178
5BCCA8D81CE6697F0059B963 /* URLComponents.swift */,
2179+
B96C112425BA2CE700985A32 /* URLQueryItem.swift */,
2180+
B96C110925BA215800985A32 /* URLResourceKey.swift */,
21662181
EADE0B871BD15DFF00C49C64 /* UserDefaults.swift */,
21672182
6EB768271D18C12C00D4B719 /* UUID.swift */,
21682183
);
@@ -2857,6 +2872,7 @@
28572872
5BF7AEBE1BCD51F9008F214A /* NSTimeZone.swift in Sources */,
28582873
EADE0B951BD15DFF00C49C64 /* DateComponentsFormatter.swift in Sources */,
28592874
5BC1B9AE21F275E900524D8C /* Pointers+DataProtocol.swift in Sources */,
2875+
B96C10F625BA1EFD00985A32 /* NSURLComponents.swift in Sources */,
28602876
EADE0BA21BD15E0000C49C64 /* JSONSerialization.swift in Sources */,
28612877
5BF7AEBA1BCD51F9008F214A /* NSString.swift in Sources */,
28622878
5BF7AEB81BCD51F9008F214A /* NSRange.swift in Sources */,
@@ -2900,6 +2916,7 @@
29002916
EADE0BB51BD15E0000C49C64 /* Scanner.swift in Sources */,
29012917
EADE0BA01BD15DFF00C49C64 /* NSIndexPath.swift in Sources */,
29022918
5BF7AEB51BCD51F9008F214A /* NSPathUtilities.swift in Sources */,
2919+
B96C113725BA376D00985A32 /* NSDateComponents.swift in Sources */,
29032920
EADE0B9D1BD15DFF00C49C64 /* NSGeometry.swift in Sources */,
29042921
5BF7AEAA1BCD51F9008F214A /* DateFormatter.swift in Sources */,
29052922
5BECBA361D1CACC500B39B1F /* MeasurementFormatter.swift in Sources */,
@@ -2935,19 +2952,22 @@
29352952
D3BCEBA01C2F6DDB00295652 /* NSKeyedCoderOldStyleArray.swift in Sources */,
29362953
5B8BA1621D0B773A00938C27 /* IndexSet.swift in Sources */,
29372954
EADE0BA71BD15E0000C49C64 /* NSNotification.swift in Sources */,
2955+
B96C110A25BA215800985A32 /* URLResourceKey.swift in Sources */,
29382956
5BF7AEB41BCD51F9008F214A /* NSObject.swift in Sources */,
29392957
EADE0B521BD09F2F00C49C64 /* ByteCountFormatter.swift in Sources */,
29402958
5BA0106E1DF212B300E56898 /* NSPlatform.swift in Sources */,
29412959
D3BCEB9E1C2EDED800295652 /* NSLog.swift in Sources */,
29422960
15CA750A24F8336A007DF6C1 /* NSCFTypeShims.swift in Sources */,
29432961
61E0117D1C1B5590000037DD /* RunLoop.swift in Sources */,
2962+
B96C110025BA20A600985A32 /* NSURLQueryItem.swift in Sources */,
29442963
5B23AB8B1CE62F9B000DB898 /* PersonNameComponents.swift in Sources */,
29452964
EADE0BA61BD15E0000C49C64 /* MassFormatter.swift in Sources */,
29462965
5BECBA3A1D1CAE9A00B39B1F /* NSMeasurement.swift in Sources */,
29472966
5BF7AEB21BCD51F9008F214A /* NSNumber.swift in Sources */,
29482967
1513A8432044893F00539722 /* FileManager+XDG.swift in Sources */,
29492968
91B668A52252B3E7001487A1 /* FileManager+Win32.swift in Sources */,
29502969
5BCD03821D3EE35C00E3FF9B /* TimeZone.swift in Sources */,
2970+
B96C112525BA2CE700985A32 /* URLQueryItem.swift in Sources */,
29512971
5BC1B9AC21F275D500524D8C /* NSData+DataProtocol.swift in Sources */,
29522972
5B4092121D1B30B40022B067 /* ExtraStringAPIs.swift in Sources */,
29532973
5BC46D541D05D6D900005853 /* DateInterval.swift in Sources */,

Sources/Foundation/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ add_library(Foundation
6363
NSData+DataProtocol.swift
6464
NSData.swift
6565
NSDate.swift
66+
NSDateComponents.swift
6667
NSDecimalNumber.swift
6768
NSDictionary.swift
6869
NSEnumerator.swift
@@ -100,6 +101,8 @@ add_library(Foundation
100101
NSTextCheckingResult.swift
101102
NSTimeZone.swift
102103
NSURL.swift
104+
NSURLComponents.swift
105+
NSURLQueryItem.swift
103106
NSURLError.swift
104107
NSUUID.swift
105108
NSValue.swift
@@ -130,6 +133,8 @@ add_library(Foundation
130133
Unit.swift
131134
URL.swift
132135
URLComponents.swift
136+
URLQueryItem.swift
137+
URLResourceKey.swift
133138
UserDefaults.swift
134139
UUID.swift)
135140
target_compile_definitions(Foundation PRIVATE

Sources/Foundation/DateComponents.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,3 +463,14 @@ extension DateComponents : Codable {
463463
try container.encodeIfPresent(self.yearForWeekOfYear, forKey: .yearForWeekOfYear)
464464
}
465465
}
466+
467+
extension DateComponents : _NSBridgeable {
468+
typealias NSType = NSDateComponents
469+
var _nsObject: NSType { return _bridgeToObjectiveC() }
470+
}
471+
472+
extension DateComponents {
473+
func _createCFDateComponents() -> CFDateComponents {
474+
return _nsObject._createCFDateComponents()
475+
}
476+
}

0 commit comments

Comments
 (0)