comparison dstep/foundation/NSURLCredentialStorage.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 7ff919f595d5
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
4 * Version: Initial created: Aug 3, 2009 4 * Version: Initial created: Aug 3, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) 5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */ 6 */
7 module dstep.foundation.NSURLCredentialStorage; 7 module dstep.foundation.NSURLCredentialStorage;
8 8
9 import dstep.AvailabilityMacros;
10 import dstep.foundation.NSDictionary; 9 import dstep.foundation.NSDictionary;
11 import dstep.foundation.NSObject; 10 import dstep.foundation.NSObject;
12 import dstep.foundation.NSString; 11 import dstep.foundation.NSString;
13 import dstep.foundation.NSURLCredential; 12 import dstep.foundation.NSURLCredential;
14 import dstep.foundation.NSURLCredentialStorageInternal;
15 import dstep.foundation.NSURLProtectionSpace; 13 import dstep.foundation.NSURLProtectionSpace;
16 import dstep.objc.bridge.Bridge; 14 import dstep.objc.bridge.Bridge;
17 import dstep.objc.objc : id; 15 import dstep.objc.objc;
16
17
18 18
19 import bindings = dstep.foundation.NSURLCredentialStorage_bindings; 19 import bindings = dstep.foundation.NSURLCredentialStorage_bindings;
20 20
21 const NSString NSURLCredentialStorageChangedNotification; 21 private NSString NSURLCredentialStorageChangedNotification_;
22 22
23 static this () 23 NSString NSURLCredentialStorageChangedNotification ()
24 { 24 {
25 NSURLCredentialStorageChangedNotification = new NSString(bindings.NSURLCredentialStorageChangedNotification); 25 if (NSURLCredentialStorageChangedNotification_)
26 return NSURLCredentialStorageChangedNotification_;
27
28 return NSURLCredentialStorageChangedNotification_ = new NSString(bindings.NSURLCredentialStorageChangedNotification);
26 } 29 }
27 30
28 class NSURLCredentialStorage : NSObject 31 class NSURLCredentialStorage : NSObject
29 { 32 {
30 mixin ObjcWrap; 33 mixin (ObjcWrap);
34
35 this ()
36 {
37 super(typeof(this).alloc.init.objcObject);
38 }
39
40 typeof(this) init ()
41 {
42 return invokeObjcSelf!(typeof(this), "init");
43 }
31 44
32 static NSURLCredentialStorage sharedCredentialStorage () 45 static NSURLCredentialStorage sharedCredentialStorage ()
33 { 46 {
34 return invokeObjcSelfClass!(NSURLCredentialStorage, "sharedCredentialStorage"); 47 return invokeObjcSuperClass!(NSURLCredentialStorage, "sharedCredentialStorage");
35 } 48 }
36 49
37 NSDictionary credentialsForProtectionSpace (NSURLProtectionSpace space) 50 NSDictionary credentialsForProtectionSpace (NSURLProtectionSpace space)
38 { 51 {
39 return invokeObjcSelf!(NSDictionary, "credentialsForProtectionSpace:", NSURLProtectionSpace)(space); 52 return invokeObjcSelf!(NSDictionary, "credentialsForProtectionSpace:", NSURLProtectionSpace)(space);