Mercurial > projects > dstep
annotate dstep/foundation/NSClassDescription.d @ 15:7ff919f595d5
Added the Foundation framework, again
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 03 Aug 2009 15:31:48 +0200 |
parents | 89f3c3ef1fd2 |
children | 19885b43130e |
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.NSClassDescription; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSDictionary; | |
11 import dstep.foundation.NSException; | |
12 import dstep.foundation.NSObject; | |
13 import dstep.foundation.NSString; | |
14 import dstep.objc.bridge.Bridge; | |
15 import dstep.objc.objc : id; | |
16 | |
17 import bindings = dstep.foundation.NSClassDescription_bindings; | |
18 | |
19 NSString NSClassDescriptionNeededForClassNotification; | |
20 | |
21 static this () | |
22 { | |
23 NSClassDescriptionNeededForClassNotification = new NSString(bindings.NSClassDescriptionNeededForClassNotification); | |
24 } | |
25 | |
26 class NSClassDescription : NSObject | |
27 { | |
28 mixin ObjcWrap; | |
29 | |
30 static void registerClassDescription (NSClassDescription description, Class aClass) | |
31 { | |
32 return invokeObjcSelfClass!(void, "registerClassDescription:forClass:", NSClassDescription, Class)(description, aClass); | |
33 } | |
34 | |
35 static void invalidateClassDescriptionCache () | |
36 { | |
37 return invokeObjcSelfClass!(void, "invalidateClassDescriptionCache"); | |
38 } | |
39 | |
40 static NSClassDescription classDescriptionForClass (Class aClass) | |
41 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 return invokeObjcSelfClass!(NSClassDescription, "classDescriptionForClass:", Class)(aClass); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
43 } |
14 | 44 |
45 NSArray attributeKeys () | |
46 { | |
47 return invokeObjcSelf!(NSArray, "attributeKeys"); | |
48 } | |
49 | |
50 NSArray toOneRelationshipKeys () | |
51 { | |
52 return invokeObjcSelf!(NSArray, "toOneRelationshipKeys"); | |
53 } | |
54 | |
55 NSArray toManyRelationshipKeys () | |
56 { | |
57 return invokeObjcSelf!(NSArray, "toManyRelationshipKeys"); | |
58 } | |
59 | |
60 NSString inverseForRelationshipKey (NSString relationshipKey) | |
61 { | |
62 return invokeObjcSelf!(NSString, "inverseForRelationshipKey:", NSString)(relationshipKey); | |
63 } | |
64 } | |
65 | |
66 template TNSClassDescriptionPrimitives () | |
67 { | |
68 NSClassDescription classDescription (); | |
69 NSArray attributeKeys (); | |
70 NSArray toOneRelationshipKeys (); | |
71 NSArray toManyRelationshipKeys (); | |
72 NSString inverseForRelationshipKey (NSString relationshipKey); | |
73 } | |
74 |