Mercurial > projects > dstep
comparison dstep/foundation/NSURLAuthenticationChallenge.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 |
---|---|
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.NSURLAuthenticationChallenge; | 7 module dstep.foundation.NSURLAuthenticationChallenge; |
8 | 8 |
9 import dstep.AvailabilityMacros; | |
10 import dstep.foundation.NSError; | 9 import dstep.foundation.NSError; |
10 import dstep.foundation.NSObjCRuntime; | |
11 import dstep.foundation.NSObject; | 11 import dstep.foundation.NSObject; |
12 import dstep.foundation.NSURLAuthenticationChallengeInternal; | |
13 import dstep.foundation.NSURLCredential; | 12 import dstep.foundation.NSURLCredential; |
14 import dstep.foundation.NSURLProtectionSpace; | 13 import dstep.foundation.NSURLProtectionSpace; |
15 import dstep.foundation.NSURLResponse; | 14 import dstep.foundation.NSURLResponse; |
16 import dstep.objc.bridge.Bridge; | 15 import dstep.objc.bridge.Bridge; |
17 import dstep.objc.objc : id; | 16 import dstep.objc.objc; |
18 | 17 |
19 class NSURLAuthenticationChallenge : NSObject | 18 class NSURLAuthenticationChallenge : NSObject |
20 { | 19 { |
21 mixin ObjcWrap; | 20 mixin (ObjcWrap); |
22 | 21 |
22 this () | |
23 { | |
24 super(typeof(this).alloc.init.objcObject); | |
25 } | |
26 | |
27 typeof(this) init () | |
28 { | |
29 return invokeObjcSelf!(typeof(this), "init"); | |
30 } | |
31 | |
23 Object initWithProtectionSpace (NSURLProtectionSpace space, NSURLCredential credential, NSInteger previousFailureCount, NSURLResponse response, NSError error, INSURLAuthenticationChallengeSender sender) | 32 Object initWithProtectionSpace (NSURLProtectionSpace space, NSURLCredential credential, NSInteger previousFailureCount, NSURLResponse response, NSError error, INSURLAuthenticationChallengeSender sender) |
24 { | 33 { |
25 return invokeObjcSelf!(Object, "initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:", NSURLProtectionSpace, NSURLCredential, NSInteger, NSURLResponse, NSError, INSURLAuthenticationChallengeSender)(space, credential, previousFailureCount, response, error, sender); | 34 return invokeObjcSelf!(Object, "initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:", NSURLProtectionSpace, NSURLCredential, NSInteger, NSURLResponse, NSError, INSURLAuthenticationChallengeSender)(space, credential, previousFailureCount, response, error, sender); |
26 } | 35 } |
27 | 36 |
29 { | 38 { |
30 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); | 39 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); |
31 id result = Bridge.invokeObjcMethod!(id, "initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:", NSURLProtectionSpace, NSURLCredential, NSInteger, NSURLResponse, NSError, INSURLAuthenticationChallengeSender)(objcObject, space, credential, previousFailureCount, response, error, sender); | 40 id result = Bridge.invokeObjcMethod!(id, "initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:", NSURLProtectionSpace, NSURLCredential, NSInteger, NSURLResponse, NSError, INSURLAuthenticationChallengeSender)(objcObject, space, credential, previousFailureCount, response, error, sender); |
32 | 41 |
33 if (result) | 42 if (result) |
34 objcObject = ret; | 43 objcObject = result; |
35 | 44 |
36 dObject = this; | 45 dObject = this; |
37 } | 46 } |
38 | 47 |
39 Object initWithAuthenticationChallenge (NSURLAuthenticationChallenge challenge, INSURLAuthenticationChallengeSender sender) | 48 Object initWithAuthenticationChallenge (NSURLAuthenticationChallenge challenge, INSURLAuthenticationChallengeSender sender) |
45 { | 54 { |
46 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); | 55 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); |
47 id result = Bridge.invokeObjcMethod!(id, "initWithAuthenticationChallenge:sender:", NSURLAuthenticationChallenge, INSURLAuthenticationChallengeSender)(objcObject, challenge, sender); | 56 id result = Bridge.invokeObjcMethod!(id, "initWithAuthenticationChallenge:sender:", NSURLAuthenticationChallenge, INSURLAuthenticationChallengeSender)(objcObject, challenge, sender); |
48 | 57 |
49 if (result) | 58 if (result) |
50 objcObject = ret; | 59 objcObject = result; |
51 | 60 |
52 dObject = this; | 61 dObject = this; |
53 } | 62 } |
54 | 63 |
55 NSURLProtectionSpace protectionSpace () | 64 NSURLProtectionSpace protectionSpace () |