comparison 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
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
6 */ 6 */
7 module dstep.foundation.NSPropertyList; 7 module dstep.foundation.NSPropertyList;
8 8
9 import dstep.corefoundation.CFPropertyList; 9 import dstep.corefoundation.CFPropertyList;
10 import dstep.foundation.NSData; 10 import dstep.foundation.NSData;
11 import dstep.foundation.NSObjCRuntime;
11 import dstep.foundation.NSObject; 12 import dstep.foundation.NSObject;
12 import dstep.foundation.NSString; 13 import dstep.foundation.NSString;
13 import dstep.objc.bridge.Bridge; 14 import dstep.objc.bridge.Bridge;
14 import dstep.objc.objc : id; 15 import dstep.objc.objc;
15 16
16 alias NSUInteger NSPropertyListMutabilityOptions; 17 alias NSUInteger NSPropertyListMutabilityOptions;
17 alias NSUInteger NSPropertyListFormat; 18 alias NSUInteger NSPropertyListFormat;
18 19
19 enum 20 enum
30 NSPropertyListBinaryFormat_v1_0 = kCFPropertyListBinaryFormat_v1_0 31 NSPropertyListBinaryFormat_v1_0 = kCFPropertyListBinaryFormat_v1_0
31 } 32 }
32 33
33 class NSPropertyListSerialization : NSObject 34 class NSPropertyListSerialization : NSObject
34 { 35 {
35 mixin ObjcWrap; 36 mixin (ObjcWrap);
37
38 this ()
39 {
40 super(typeof(this).alloc.init.objcObject);
41 }
42
43 typeof(this) init ()
44 {
45 return invokeObjcSelf!(typeof(this), "init");
46 }
36 47
37 static bool propertyList (Object plist, uint format) 48 static bool propertyList (Object plist, uint format)
38 { 49 {
39 return invokeObjcSelfClass!(bool, "propertyList:isValidForFormat:", Object, uint)(plist, format); 50 return invokeObjcSuperClass!(bool, "propertyList:isValidForFormat:", Object, uint)(plist, format);
40 } 51 }
41 52
42 static NSData dataFromPropertyList (Object plist, uint format, NSString** errorString) 53 static NSData dataFromPropertyList (Object plist, uint format, NSString** errorString)
43 { 54 {
44 return invokeObjcSelfClass!(NSData, "dataFromPropertyList:format:errorDescription:", Object, uint, NSString**)(plist, format, errorString); 55 return invokeObjcSuperClass!(NSData, "dataFromPropertyList:format:errorDescription:", Object, uint, NSString**)(plist, format, errorString);
45 } 56 }
46 57
47 static Object propertyListFromData (NSData data, uint opt, NSPropertyListFormat* format, NSString** errorString) 58 static Object propertyListFromData (NSData data, uint opt, NSPropertyListFormat* format, NSString** errorString)
48 { 59 {
49 return invokeObjcSelfClass!(Object, "propertyListFromData:mutabilityOption:format:errorDescription:", NSData, uint, NSPropertyListFormat*, NSString**)(data, opt, format, errorString); 60 return invokeObjcSuperClass!(Object, "propertyListFromData:mutabilityOption:format:errorDescription:", NSData, uint, NSPropertyListFormat*, NSString**)(data, opt, format, errorString);
50 } 61 }
51 } 62 }
52 63