Mercurial > projects > dstep
annotate dstep/foundation/NSComparisonPredicate.d @ 27:57371c29ef73 default tip
ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 09 Apr 2010 23:00:22 +0200 |
parents | b9de51448c6b |
children |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSComparisonPredicate; | |
8 | |
9 import dstep.foundation.NSExpression; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
10 import dstep.foundation.NSObjCRuntime; |
14 | 11 import dstep.foundation.NSPredicate; |
12 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.objc.objc; |
14 | 14 |
15 alias NSUInteger NSComparisonPredicateModifier; | |
16 alias NSUInteger NSPredicateOperatorType; | |
17 | |
18 enum | |
19 { | |
20 NSCaseInsensitivePredicateOption = 0x01, | |
21 NSDiacriticInsensitivePredicateOption = 0x02 | |
22 } | |
23 | |
24 enum | |
25 { | |
26 NSDirectPredicateModifier = 0, | |
27 NSAllPredicateModifier, | |
28 NSAnyPredicateModifier | |
29 } | |
30 | |
31 enum | |
32 { | |
33 NSLessThanPredicateOperatorType = 0, | |
34 NSLessThanOrEqualToPredicateOperatorType, | |
35 NSGreaterThanPredicateOperatorType, | |
36 NSGreaterThanOrEqualToPredicateOperatorType, | |
37 NSEqualToPredicateOperatorType, | |
38 NSNotEqualToPredicateOperatorType, | |
39 NSMatchesPredicateOperatorType, | |
40 NSLikePredicateOperatorType, | |
41 NSBeginsWithPredicateOperatorType, | |
42 NSEndsWithPredicateOperatorType, | |
43 NSInPredicateOperatorType, | |
44 NSCustomSelectorPredicateOperatorType, | |
45 NSContainsPredicateOperatorType = 99, | |
46 NSBetweenPredicateOperatorType | |
47 } | |
48 | |
49 class NSComparisonPredicate : NSPredicate | |
50 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
51 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
52 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
53 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
54 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
55 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
56 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
57 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
58 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
59 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
60 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
61 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
62 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
63 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
64 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
65 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
66 } |
14 | 67 |
68 static NSPredicate predicateWithLeftExpression (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) | |
69 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
70 return invokeObjcSuperClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(lhs, rhs, modifier, type, options); |
14 | 71 } |
72 | |
73 static NSPredicate predicateWithLeftExpression (NSExpression lhs, NSExpression rhs, SEL selector) | |
74 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
75 return invokeObjcSuperClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(lhs, rhs, selector); |
14 | 76 } |
77 | |
78 Object initWithLeftExpression (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) | |
79 { | |
80 return invokeObjcSelf!(Object, "initWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(lhs, rhs, modifier, type, options); | |
81 } | |
82 | |
83 this (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) | |
84 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
85 typeof(this).alloc.initWithLeftExpression(lhs, rhs, modifier, type, options); |
14 | 86 } |
87 | |
88 Object initWithLeftExpression (NSExpression lhs, NSExpression rhs, SEL selector) | |
89 { | |
90 return invokeObjcSelf!(Object, "initWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(lhs, rhs, selector); | |
91 } | |
92 | |
93 this (NSExpression lhs, NSExpression rhs, SEL selector) | |
94 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
95 typeof(this).alloc.initWithLeftExpression(lhs, rhs, selector); |
14 | 96 } |
97 | |
98 uint predicateOperatorType () | |
99 { | |
100 return invokeObjcSelf!(uint, "predicateOperatorType"); | |
101 } | |
102 | |
103 uint comparisonPredicateModifier () | |
104 { | |
105 return invokeObjcSelf!(uint, "comparisonPredicateModifier"); | |
106 } | |
107 | |
108 NSExpression leftExpression () | |
109 { | |
110 return invokeObjcSelf!(NSExpression, "leftExpression"); | |
111 } | |
112 | |
113 NSExpression rightExpression () | |
114 { | |
115 return invokeObjcSelf!(NSExpression, "rightExpression"); | |
116 } | |
117 | |
118 SEL customSelector () | |
119 { | |
120 return invokeObjcSelf!(SEL, "customSelector"); | |
121 } | |
122 | |
123 NSUInteger options () | |
124 { | |
125 return invokeObjcSelf!(NSUInteger, "options"); | |
126 } | |
127 } | |
128 |