Mercurial > projects > dstep
comparison dstep/coredata/NSFetchRequest.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 25, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.coredata.NSFetchRequest; | |
8 | |
9 import dstep.coredata.NSEntityDescription; | |
10 import dstep.coredata.NSManagedObjectModel; | |
11 import dstep.foundation.NSArray; | |
12 import dstep.foundation.NSCoder; | |
13 import dstep.foundation.NSObjCRuntime; | |
14 import dstep.foundation.NSObject; | |
15 import dstep.foundation.NSPredicate; | |
16 import dstep.foundation.NSString; | |
17 import dstep.foundation.NSZone; | |
18 import dstep.objc.bridge.Bridge; | |
19 import dstep.objc.objc; | |
20 | |
21 alias NSUInteger NSFetchRequestResultType; | |
22 | |
23 enum | |
24 { | |
25 NSManagedObjectResultType = 0x00, | |
26 NSManagedObjectIDResultType = 0x01 | |
27 } | |
28 | |
29 class NSFetchRequest : NSObject, INSCoding, INSCopying | |
30 { | |
31 mixin (ObjcWrap); | |
32 | |
33 NSEntityDescription entity () | |
34 { | |
35 return invokeObjcSelf!(NSEntityDescription, "entity"); | |
36 } | |
37 | |
38 void setEntity (NSEntityDescription entity) | |
39 { | |
40 return invokeObjcSelf!(void, "setEntity:", NSEntityDescription)(entity); | |
41 } | |
42 | |
43 NSPredicate predicate () | |
44 { | |
45 return invokeObjcSelf!(NSPredicate, "predicate"); | |
46 } | |
47 | |
48 void setPredicate (NSPredicate predicate) | |
49 { | |
50 return invokeObjcSelf!(void, "setPredicate:", NSPredicate)(predicate); | |
51 } | |
52 | |
53 NSArray sortDescriptors () | |
54 { | |
55 return invokeObjcSelf!(NSArray, "sortDescriptors"); | |
56 } | |
57 | |
58 void setSortDescriptors (NSArray sortDescriptors) | |
59 { | |
60 return invokeObjcSelf!(void, "setSortDescriptors:", NSArray)(sortDescriptors); | |
61 } | |
62 | |
63 NSUInteger fetchLimit () | |
64 { | |
65 return invokeObjcSelf!(NSUInteger, "fetchLimit"); | |
66 } | |
67 | |
68 void setFetchLimit (NSUInteger limit) | |
69 { | |
70 return invokeObjcSelf!(void, "setFetchLimit:", NSUInteger)(limit); | |
71 } | |
72 | |
73 NSArray affectedStores () | |
74 { | |
75 return invokeObjcSelf!(NSArray, "affectedStores"); | |
76 } | |
77 | |
78 void setAffectedStores (NSArray stores) | |
79 { | |
80 return invokeObjcSelf!(void, "setAffectedStores:", NSArray)(stores); | |
81 } | |
82 | |
83 uint resultType () | |
84 { | |
85 return invokeObjcSelf!(uint, "resultType"); | |
86 } | |
87 | |
88 void setResultType (uint type) | |
89 { | |
90 return invokeObjcSelf!(void, "setResultType:", uint)(type); | |
91 } | |
92 | |
93 bool includesSubentities () | |
94 { | |
95 return invokeObjcSelf!(bool, "includesSubentities"); | |
96 } | |
97 | |
98 void setIncludesSubentities (bool yesNo) | |
99 { | |
100 return invokeObjcSelf!(void, "setIncludesSubentities:", bool)(yesNo); | |
101 } | |
102 | |
103 bool includesPropertyValues () | |
104 { | |
105 return invokeObjcSelf!(bool, "includesPropertyValues"); | |
106 } | |
107 | |
108 void setIncludesPropertyValues (bool yesNo) | |
109 { | |
110 return invokeObjcSelf!(void, "setIncludesPropertyValues:", bool)(yesNo); | |
111 } | |
112 | |
113 bool returnsObjectsAsFaults () | |
114 { | |
115 return invokeObjcSelf!(bool, "returnsObjectsAsFaults"); | |
116 } | |
117 | |
118 void setReturnsObjectsAsFaults (bool yesNo) | |
119 { | |
120 return invokeObjcSelf!(void, "setReturnsObjectsAsFaults:", bool)(yesNo); | |
121 } | |
122 | |
123 NSArray relationshipKeyPathsForPrefetching () | |
124 { | |
125 return invokeObjcSelf!(NSArray, "relationshipKeyPathsForPrefetching"); | |
126 } | |
127 | |
128 void setRelationshipKeyPathsForPrefetching (NSArray keys) | |
129 { | |
130 return invokeObjcSelf!(void, "setRelationshipKeyPathsForPrefetching:", NSArray)(keys); | |
131 } | |
132 | |
133 void encodeWithCoder (NSCoder aCoder) | |
134 { | |
135 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
136 } | |
137 | |
138 typeof(this) initWithCoder (NSCoder aDecoder) | |
139 { | |
140 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); | |
141 } | |
142 | |
143 typeof(this) copyWithZone (NSZone* zone) | |
144 { | |
145 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone); | |
146 } | |
147 } | |
148 |