You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Foundation/NSComparisonPredicate.swift
+24-17Lines changed: 24 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,28 @@
7
7
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8
8
//
9
9
10
-
// Flags(s) that can be passed to the factory to indicate that a operator operating on strings should do so in a case insensitive fashion.
11
-
extensionNSComparisonPredicate{
10
+
// Comparison predicates are predicates which do some form of comparison between the results of two expressions and return a BOOL. They take an operator, a left expression, and a right expression, and return the result of invoking the operator with the results of evaluating the expressions.
11
+
@available(*, deprecated, message:"NSExpression and classes that rely on its functionality are unsupported in swift-corelibs-foundation: NSComparisonPredicate is unavailable.")
12
+
openclassNSComparisonPredicate:NSPredicate{
13
+
14
+
@available(*, unavailable, message:"NSComparisonPredicate is unsupported in swift-corelibs-foundation. Use a closure-based NSPredicate instead if possible.")
publicstaticletnormalized=Options(rawValue :0x4) /* Indicate that the strings to be compared have been preprocessed; this supersedes other options and is intended as a performance optimization option */
19
39
}
20
-
40
+
21
41
// Describes how the operator is modified: can be direct, ALL, or ANY
22
42
publicenumModifier:UInt{
23
43
case direct // Do a direct comparison
24
44
case all // ALL toMany.x = y
25
45
case any // ANY toMany.x = y
26
46
}
27
-
47
+
28
48
// Type basic set of operators defined. Most are obvious
29
49
publicenumOperator:UInt{
30
50
case lessThan // compare: returns NSOrderedAscending
// Comparison predicates are predicates which do some form of comparison between the results of two expressions and return a BOOL. They take an operator, a left expression, and a right expression, and return the result of invoking the operator with the results of evaluating the expressions.
@available(*, deprecated, message:"NSExpression is not available in swift-corelibs-foundation")
32
+
openclassNSExpression:NSObject,NSCopying{
44
33
45
34
openoverridefunc copy()->Any{
46
35
returncopy(with:nil)
47
36
}
48
37
49
38
openfunc copy(with zone:NSZone?=nil)->Any{
50
-
NSUnimplemented()
39
+
NSUnsupported()
51
40
}
52
-
53
-
public /*not inherited*/ init(format expressionFormat:String, argumentArray arguments:[Any]){NSUnimplemented()}
54
-
public /*not inherited*/ init(format expressionFormat:String, arguments argList:CVaListPointer){NSUnimplemented()}
55
41
56
-
public /*not inherited*/ init(forConstantValue obj:Any?){NSUnimplemented()} // Expression that returns a constant value
57
-
openclassfunc expressionForEvaluatedObject()->NSExpression{NSUnimplemented()} // Expression that returns the object being evaluated
58
-
public /*not inherited*/ init(forVariable string:String){NSUnimplemented()} // Expression that pulls a value from the variable bindings dictionary
59
-
public /*not inherited*/ init(forKeyPath keyPath:String){NSUnimplemented()} // Expression that invokes valueForKeyPath with keyPath
60
-
public /*not inherited*/ init(forFunction name:String, arguments parameters:[Any]){NSUnimplemented()} // Expression that invokes one of the predefined functions. Will throw immediately if the selector is bad; will throw at runtime if the parameters are incorrect.
42
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
48
+
publicconvenienceinit(forConstantValue obj:Any?){NSUnsupported()} // Expression that returns a constant value
49
+
50
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
51
+
openclassfunc expressionForEvaluatedObject()->NSExpression{NSUnsupported()} // Expression that returns the object being evaluated
52
+
53
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
54
+
publicconvenienceinit(forVariable string:String){NSUnsupported()} // Expression that pulls a value from the variable bindings dictionary
55
+
56
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
57
+
publicconvenienceinit(forKeyPath keyPath:String){NSUnsupported()} // Expression that invokes valueForKeyPath with keyPath
58
+
59
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
60
+
publicconvenienceinit(forFunction name:String, arguments parameters:[Any]){NSUnsupported()} // Expression that invokes one of the predefined functions. Will throw immediately if the selector is bad; will throw at runtime if the parameters are incorrect.
@@ -99,43 +99,77 @@ open class NSExpression : NSObject, NSSecureCoding, NSCopying {
99
99
// two NSExpression instances representing CLLocations NSNumber
100
100
// length: an NSExpression instance representing a string NSNumber
101
101
102
-
public /*not inherited*/ init(forAggregate subexpressions:[Any]){NSUnimplemented()} // Expression that returns a collection containing the results of other expressions
103
-
public /*not inherited*/ init(forUnionSet left:NSExpression, with right:NSExpression){NSUnimplemented()} // return an expression that will return the union of the collections expressed by left and right
104
-
public /*not inherited*/ init(forIntersectSet left:NSExpression, with right:NSExpression){NSUnimplemented()} // return an expression that will return the intersection of the collections expressed by left and right
105
-
public /*not inherited*/ init(forMinusSet left:NSExpression, with right:NSExpression){NSUnimplemented()} // return an expression that will return the disjunction of the collections expressed by left and right
106
-
public /*not inherited*/ init(forSubquery expression:NSExpression, usingIteratorVariable variable:String, predicate:Any){NSUnimplemented()} // Expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifer returns true; variable is used as a local variable, and will shadow any instances of variable in the bindings dictionary, the variable is removed or the old value replaced once evaluation completes
107
-
public /*not inherited*/ init(forFunction target:NSExpression, selectorName name:String, arguments parameters:[Any]?){NSUnimplemented()} // Expression that invokes the selector on target with parameters. Will throw at runtime if target does not implement selector or if parameters are wrong.
public /*not inherited*/ init(block:@escaping(Any?,[Any],NSMutableDictionary?)->Any, arguments:[NSExpression]?){NSUnimplemented()} // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
110
-
public /*not inherited*/ init(forConditional predicate:Any, trueExpression:NSExpression, falseExpression:NSExpression){NSUnimplemented()} // Expression that will return the result of trueExpression or falseExpression depending on the value of predicate
102
+
103
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
104
+
publicconvenienceinit(forAggregate subexpressions:[Any]){NSUnsupported()} // Expression that returns a collection containing the results of other expressions
105
+
106
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
107
+
publicconvenienceinit(forUnionSet left:NSExpression, with right:NSExpression){NSUnsupported()} // return an expression that will return the union of the collections expressed by left and right
108
+
109
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
110
+
publicconvenienceinit(forIntersectSet left:NSExpression, with right:NSExpression){NSUnsupported()} // return an expression that will return the intersection of the collections expressed by left and right
111
+
112
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
113
+
publicconvenienceinit(forMinusSet left:NSExpression, with right:NSExpression){NSUnsupported()} // return an expression that will return the disjunction of the collections expressed by left and right
114
+
115
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
116
+
publicconvenienceinit(forSubquery expression:NSExpression, usingIteratorVariable variable:String, predicate:Any){NSUnsupported()} // Expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifer returns true; variable is used as a local variable, and will shadow any instances of variable in the bindings dictionary, the variable is removed or the old value replaced once evaluation completes
117
+
118
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
119
+
publicconvenienceinit(forFunction target:NSExpression, selectorName name:String, arguments parameters:[Any]?){NSUnsupported()} // Expression that invokes the selector on target with parameters. Will throw at runtime if target does not implement selector or if parameters are wrong.
120
+
121
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
125
+
publicconvenienceinit(block:@escaping(Any?,[Any],NSMutableDictionary?)->Any, arguments:[NSExpression]?){NSUnsupported()} // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
126
+
127
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
128
+
publicconvenienceinit(forConditional predicate:Any, trueExpression:NSExpression, falseExpression:NSExpression){NSUnsupported()} // Expression that will return the result of trueExpression or falseExpression depending on the value of predicate
/*@NSCopying*/ openvaroperand:NSExpression{NSUnimplemented()} // the object on which the selector will be invoked (the result of evaluating a key path or one of the defined functions)
121
-
openvararguments:[NSExpression]?{NSUnimplemented()} // array of expressions which will be passed as parameters during invocation of the selector on the operand of a function expression
134
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
137
+
openvarconstantValue:Any{NSUnsupported()}
138
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
139
+
openvarkeyPath:String{NSUnsupported()}
140
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
141
+
openvarfunction:String{NSUnsupported()}
142
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
143
+
openvarvariable:String{NSUnsupported()}
144
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
145
+
/*@NSCopying*/ openvaroperand:NSExpression{NSUnsupported()} // the object on which the selector will be invoked (the result of evaluating a key path or one of the defined functions)
146
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
147
+
openvararguments:[NSExpression]?{NSUnsupported()} // array of expressions which will be passed as parameters during invocation of the selector on the operand of a function expression
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
154
+
/*@NSCopying*/ openvarleft:NSExpression{NSUnsupported()} // expression which represents the left side of a set expression
155
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
156
+
/*@NSCopying*/ openvarright:NSExpression{NSUnsupported()} // expression which represents the right side of a set expression
127
157
128
-
/*@NSCopying*/ openvar`true`:NSExpression{NSUnimplemented()} // expression which will be evaluated if a conditional expression's predicate evaluates to true
129
-
/*@NSCopying*/ openvar`false`:NSExpression{NSUnimplemented()} // expression which will be evaluated if a conditional expression's predicate evaluates to false
158
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
159
+
/*@NSCopying*/ openvar`true`:NSExpression{NSUnsupported()} // expression which will be evaluated if a conditional expression's predicate evaluates to true
160
+
@available(*, unavailable, message:"NSExpression is not available in swift-corelibs-foundation")
161
+
/*@NSCopying*/ openvar`false`:NSExpression{NSUnsupported()} // expression which will be evaluated if a conditional expression's predicate evaluates to false
// evaluate the expression using the object and bindings- note that context is mutable here and can be used by expressions to store temporary state for one predicate evaluation
0 commit comments