Skip to content

Commit ced59de

Browse files
committed
remove old NSError/NSException handling, which seems unused now; remove Constants.h
1 parent 25222a5 commit ced59de

File tree

6 files changed

+2
-262
lines changed

6 files changed

+2
-262
lines changed

Source/ios-framework/CommonSource/Constants.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

Source/ios-framework/CommonSource/Errors.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,6 @@ public enum ObjectBoxError: Swift.Error {
7777
case unexpected(error: Error)
7878
}
7979

80-
// This method uses our Swift code for generating ObjectBoxErrors and then wraps that ObjectBoxError in an ObjC error.
81-
// This means that it allows Objective-C code to "throw" Swift errors, but only ones for which an obx_err exists.
82-
//
83-
// NOTE: _cdecl is a temporary feature of Swift that may get removed/replaced in the future.
84-
// It also doesn't actually check that the signature of the parameter and return types can be expressed in C. You have
85-
// to do all of that correctly in your C header. Since it happens at link/compile time, I deem it safe to use.
86-
@_cdecl("OBXErrorToNSError")
87-
internal func errorToSwift(_ error: Int32 /* obx_err */, _ msg: UnsafePointer<CChar>) -> NSError? {
88-
do {
89-
try check(error: obx_err(error), message: String(utf8String: msg) ?? "Error \(error).")
90-
return nil
91-
} catch {
92-
return error as NSError
93-
}
94-
}
95-
9680
/// Check whether obx_last_error_code() contains an error, and if yes, throw that as a Swift error, together with the
9781
/// text from obx_last_error_message(). Note that C API functions with a void return do not give errors. Call this only
9882
/// for C API functions with a return value, or call checkLastError(error:) for C API functions that return obx_err.

Source/ios-framework/CommonSource/OBXErrorHelper.h

Lines changed: 0 additions & 66 deletions
This file was deleted.

Source/ios-framework/CommonSource/OBXErrorHelper.mm

Lines changed: 0 additions & 133 deletions
This file was deleted.

Source/ios-framework/CommonSource/ObjectBox.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
//
16+
// TODO can we get rid of this file?
1617

17-
#import "Constants.h"
18-
19-
// Temporarily exposed, private, do not use directly!
20-
#import "OBXErrorHelper.h"
18+
#import <Foundation/Foundation.h> // we still depend on stuff like
2119
#import "obx_fbb.h"
2220
#import "ObjectBoxC.h"

Source/ios-framework/ObjectBox.xcodeproj/project.pbxproj

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,12 @@
4141
28A6B3E0247EEB8700C163B4 /* ManyToManyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A6B3DF247EEB8700C163B4 /* ManyToManyTests.swift */; };
4242
28A6B3E1247EEB8700C163B4 /* ManyToManyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A6B3DF247EEB8700C163B4 /* ManyToManyTests.swift */; };
4343
503962EB216363A1000DFB7E /* ToMany.swift in Sources */ = {isa = PBXBuildFile; fileRef = 503962EA216363A1000DFB7E /* ToMany.swift */; };
44-
5052616320BD72A500405B13 /* OBXErrorHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052614720BD72A500405B13 /* OBXErrorHelper.h */; settings = {ATTRIBUTES = (Public, ); }; };
4544
5052616920BD72A500405B13 /* ObjectBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052614D20BD72A500405B13 /* ObjectBox.h */; settings = {ATTRIBUTES = (Public, ); }; };
46-
5052616C20BD72A500405B13 /* Constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052615020BD72A500405B13 /* Constants.h */; settings = {ATTRIBUTES = (Public, ); }; };
47-
5052617320BD72A500405B13 /* OBXErrorHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5052615720BD72A500405B13 /* OBXErrorHelper.mm */; };
4845
506858CF211B1864003F7D02 /* QueryConditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506858CE211B1864003F7D02 /* QueryConditions.swift */; };
4946
506B0938215377410016C7AA /* ToOne.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506B0937215377410016C7AA /* ToOne.swift */; };
5047
506B093A2153775E0016C7AA /* LazyProxyRelation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506B09392153775E0016C7AA /* LazyProxyRelation.swift */; };
5148
5070A96E217F479C002305F8 /* ObjectBox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5070A965217F479C002305F8 /* ObjectBox.framework */; };
5249
5070A97D217F48D7002305F8 /* ObjectBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052614D20BD72A500405B13 /* ObjectBox.h */; settings = {ATTRIBUTES = (Public, ); }; };
53-
5070A97E217F48DD002305F8 /* Constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052615020BD72A500405B13 /* Constants.h */; settings = {ATTRIBUTES = (Public, ); }; };
5450
5070A998217F4934002305F8 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5089AB2A21367D0200CB7871 /* Entity.swift */; };
5551
5070A999217F4937002305F8 /* EntityPropertyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5089AB2C21367D3500CB7871 /* EntityPropertyType.swift */; };
5652
5070A99B217F493B002305F8 /* Id.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5089AB2E21367D5A00CB7871 /* Id.swift */; };
@@ -64,8 +60,6 @@
6460
5070A9B7217F4997002305F8 /* QueryConditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506858CE211B1864003F7D02 /* QueryConditions.swift */; };
6561
5070A9B8217F49A3002305F8 /* PropertyQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5089AB2221367BF100CB7871 /* PropertyQuery.swift */; };
6662
5070A9B9217F49A5002305F8 /* PropertyAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50FCFEFE212EEF0B00A44B32 /* PropertyAlias.swift */; };
67-
5070A9BA217F49A9002305F8 /* OBXErrorHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 5052614720BD72A500405B13 /* OBXErrorHelper.h */; settings = {ATTRIBUTES = (Public, ); }; };
68-
5070A9BB217F49AB002305F8 /* OBXErrorHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5052615720BD72A500405B13 /* OBXErrorHelper.mm */; };
6963
5070A9C3217F49C7002305F8 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5089AB2821367CC900CB7871 /* Box.swift */; };
7064
5070A9C4217F49CA002305F8 /* Store+SwiftRefinedAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5089AB2621367CA900CB7871 /* Store+SwiftRefinedAPI.swift */; };
7165
5070A9F0217F4C72002305F8 /* SwiftRefinedAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5070A9C9217F4C3B002305F8 /* SwiftRefinedAPITests.swift */; };
@@ -238,10 +232,7 @@
238232
28A6B3DF247EEB8700C163B4 /* ManyToManyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManyToManyTests.swift; sourceTree = "<group>"; };
239233
503962EA216363A1000DFB7E /* ToMany.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToMany.swift; sourceTree = "<group>"; };
240234
5042FDB220CBE18600EBCA52 /* ObjectBoxTests-macOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ObjectBoxTests-macOS-Bridging-Header.h"; sourceTree = "<group>"; };
241-
5052614720BD72A500405B13 /* OBXErrorHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OBXErrorHelper.h; sourceTree = "<group>"; };
242235
5052614D20BD72A500405B13 /* ObjectBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectBox.h; sourceTree = "<group>"; };
243-
5052615020BD72A500405B13 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
244-
5052615720BD72A500405B13 /* OBXErrorHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OBXErrorHelper.mm; sourceTree = "<group>"; };
245236
506858CE211B1864003F7D02 /* QueryConditions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueryConditions.swift; sourceTree = "<group>"; };
246237
506B0937215377410016C7AA /* ToOne.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToOne.swift; sourceTree = "<group>"; };
247238
506B09392153775E0016C7AA /* LazyProxyRelation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LazyProxyRelation.swift; sourceTree = "<group>"; };
@@ -383,12 +374,9 @@
383374
isa = PBXGroup;
384375
children = (
385376
5052614D20BD72A500405B13 /* ObjectBox.h */,
386-
5052615020BD72A500405B13 /* Constants.h */,
387377
50C82D5620DBF3ED00A0EB3C /* Entities */,
388378
506B0935215377300016C7AA /* Relation */,
389379
5086A1DB210869A400F9B628 /* Query */,
390-
5052614720BD72A500405B13 /* OBXErrorHelper.h */,
391-
5052615720BD72A500405B13 /* OBXErrorHelper.mm */,
392380
55420B562326A9C50070BB3E /* GeneratedStoreInitializer.swift */,
393381
5541760B2271C1E400B3A225 /* Errors.swift */,
394382
55471224228C767800DB4136 /* Date+Timestamp.swift */,
@@ -605,13 +593,11 @@
605593
isa = PBXHeadersBuildPhase;
606594
buildActionMask = 2147483647;
607595
files = (
608-
5070A9BA217F49A9002305F8 /* OBXErrorHelper.h in Headers */,
609596
5070A97D217F48D7002305F8 /* ObjectBox.h in Headers */,
610597
55EB4BF122AA69490091CDB1 /* flatbuffers.h in Headers */,
611598
55EB4BF322AA69490091CDB1 /* stl_emulation.h in Headers */,
612599
5547123F228D656D00DB4136 /* ObjectBoxC.h in Headers */,
613600
55DD1A492268AFC5007F8D30 /* obx_fbb.h in Headers */,
614-
5070A97E217F48DD002305F8 /* Constants.h in Headers */,
615601
55EB4BF522AA69490091CDB1 /* base.h in Headers */,
616602
);
617603
runOnlyForDeploymentPostprocessing = 0;
@@ -632,8 +618,6 @@
632618
55DD1A482268AFC5007F8D30 /* obx_fbb.h in Headers */,
633619
55EB4BF022AA69490091CDB1 /* flatbuffers.h in Headers */,
634620
55EB4BF222AA69490091CDB1 /* stl_emulation.h in Headers */,
635-
5052616320BD72A500405B13 /* OBXErrorHelper.h in Headers */,
636-
5052616C20BD72A500405B13 /* Constants.h in Headers */,
637621
55EB4BF422AA69490091CDB1 /* base.h in Headers */,
638622
);
639623
runOnlyForDeploymentPostprocessing = 0;
@@ -956,7 +940,6 @@
956940
55C14CEA2306ECF800F10D7D /* AsyncBox.swift in Sources */,
957941
55BC4174226F4A69008195D0 /* Transaction.swift in Sources */,
958942
5541760D2271C1E400B3A225 /* Errors.swift in Sources */,
959-
5070A9BB217F49AB002305F8 /* OBXErrorHelper.mm in Sources */,
960943
550974DA2285D84F006B24B7 /* EntityBuilder.swift in Sources */,
961944
551530822369A18900B2FF12 /* Cursor.swift in Sources */,
962945
55D1A39E22B38EF60032361C /* InstanceVisitor.swift in Sources */,
@@ -1062,7 +1045,6 @@
10621045
55BC4173226F4A69008195D0 /* Transaction.swift in Sources */,
10631046
5089AB2921367CC900CB7871 /* Box.swift in Sources */,
10641047
5089AB2F21367D5A00CB7871 /* Id.swift in Sources */,
1065-
5052617320BD72A500405B13 /* OBXErrorHelper.mm in Sources */,
10661048
55A79D1323018AB000039BBB /* ToManyProperty.swift in Sources */,
10671049
55471225228C767800DB4136 /* Date+Timestamp.swift in Sources */,
10681050
5527B7A22292CC0000585FD2 /* QueryBuilderCondition.swift in Sources */,

0 commit comments

Comments
 (0)