Mercurial > projects > dstep
annotate dstep/foundation/NSNull.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.NSNull; | |
8 | |
9 import dstep.foundation.NSObject; | |
10 import dstep.objc.bridge.Bridge; | |
11 import dstep.objc.objc : id; | |
12 | |
13 class NSNull : NSObject, INSCopying, INSCoding | |
14 { | |
15 mixin ObjcWrap; | |
16 | |
17 static NSNull null_ () | |
18 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
19 return invokeObjcSelfClass!(NSNull, "null"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
20 } |
14 | 21 |
22 Object copyWithZone (NSZone* zone) | |
23 { | |
24 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone); | |
25 } | |
26 | |
27 void encodeWithCoder (NSCoder aCoder) | |
28 { | |
29 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
30 } | |
31 | |
32 Object initWithCoder (NSCoder aDecoder) | |
33 { | |
34 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
35 } | |
36 | |
37 this (NSCoder aDecoder) | |
38 { | |
39 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); | |
40 id result = Bridge.invokeObjcMethod!(id, "initWithCoder:", NSCoder)(objcObject, aDecoder); | |
41 | |
42 if (result) | |
43 objcObject = ret; | |
44 | |
45 dObject = this; | |
46 } | |
47 } | |
48 |