Mercurial > projects > dstep
annotate dstep/foundation/NSPropertyList.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 | 89f3c3ef1fd2 |
children | b9de51448c6b |
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.NSPropertyList; | |
8 | |
9 import dstep.corefoundation.CFPropertyList; | |
10 import dstep.foundation.NSData; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
11 import dstep.foundation.NSObjCRuntime; |
14 | 12 import dstep.foundation.NSObject; |
13 import dstep.foundation.NSString; | |
14 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
15 import dstep.objc.objc; |
14 | 16 |
17 alias NSUInteger NSPropertyListMutabilityOptions; | |
18 alias NSUInteger NSPropertyListFormat; | |
19 | |
20 enum | |
21 { | |
22 NSPropertyListImmutable = kCFPropertyListImmutable, | |
23 NSPropertyListMutableContainers = kCFPropertyListMutableContainers, | |
24 NSPropertyListMutableContainersAndLeaves = kCFPropertyListMutableContainersAndLeaves | |
25 } | |
26 | |
27 enum | |
28 { | |
29 NSPropertyListOpenStepFormat = kCFPropertyListOpenStepFormat, | |
30 NSPropertyListXMLFormat_v1_0 = kCFPropertyListXMLFormat_v1_0, | |
31 NSPropertyListBinaryFormat_v1_0 = kCFPropertyListBinaryFormat_v1_0 | |
32 } | |
33 | |
34 class NSPropertyListSerialization : NSObject | |
35 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
36 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
37 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
38 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
39 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
40 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
43 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
44 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
45 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
46 } |
14 | 47 |
48 static bool propertyList (Object plist, uint format) | |
49 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
50 return invokeObjcSuperClass!(bool, "propertyList:isValidForFormat:", Object, uint)(plist, format); |
14 | 51 } |
52 | |
53 static NSData dataFromPropertyList (Object plist, uint format, NSString** errorString) | |
54 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
55 return invokeObjcSuperClass!(NSData, "dataFromPropertyList:format:errorDescription:", Object, uint, NSString**)(plist, format, errorString); |
14 | 56 } |
57 | |
58 static Object propertyListFromData (NSData data, uint opt, NSPropertyListFormat* format, NSString** errorString) | |
59 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
60 return invokeObjcSuperClass!(Object, "propertyListFromData:mutabilityOption:format:errorDescription:", NSData, uint, NSPropertyListFormat*, NSString**)(data, opt, format, errorString); |
14 | 61 } |
62 } | |
63 |