Mercurial > projects > dstep
annotate dstep/foundation/NSURLResponse.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.NSURLResponse; | |
8 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
9 import dstep.foundation.NSCoder; |
14 | 10 import dstep.foundation.NSDictionary; |
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.foundation.NSURL; | |
15 import dstep.foundation.NSURLRequest; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
16 import dstep.foundation.NSZone; |
14 | 17 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
18 import dstep.objc.objc; |
14 | 19 |
20 class NSHTTPURLResponse : NSURLResponse | |
21 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
22 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
23 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
24 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
25 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
26 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
27 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
28 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
29 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
30 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 } |
14 | 33 |
34 NSInteger statusCode () | |
35 { | |
36 return invokeObjcSelf!(NSInteger, "statusCode"); | |
37 } | |
38 | |
39 NSDictionary allHeaderFields () | |
40 { | |
41 return invokeObjcSelf!(NSDictionary, "allHeaderFields"); | |
42 } | |
43 | |
44 static NSString localizedStringForStatusCode (NSInteger statusCode) | |
45 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
46 return invokeObjcSuperClass!(NSString, "localizedStringForStatusCode:", NSInteger)(statusCode); |
14 | 47 } |
48 } | |
49 | |
50 class NSURLResponse : NSObject, INSCoding, INSCopying | |
51 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
52 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
53 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
54 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
55 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
56 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
57 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
58 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
59 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
60 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
61 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
62 } |
14 | 63 |
64 Object initWithURL (NSURL URL, NSString MIMEType, NSInteger length, NSString name) | |
65 { | |
66 return invokeObjcSelf!(Object, "initWithURL:MIMEType:expectedContentLength:textEncodingName:", NSURL, NSString, NSInteger, NSString)(URL, MIMEType, length, name); | |
67 } | |
68 | |
69 this (NSURL URL, NSString MIMEType, NSInteger length, NSString name) | |
70 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
71 typeof(this).alloc.initWithURL(URL, MIMEType, length, name); |
14 | 72 } |
73 | |
74 NSURL URL () | |
75 { | |
76 return invokeObjcSelf!(NSURL, "URL"); | |
77 } | |
78 | |
79 NSString MIMEType () | |
80 { | |
81 return invokeObjcSelf!(NSString, "MIMEType"); | |
82 } | |
83 | |
84 long expectedContentLength () | |
85 { | |
86 return invokeObjcSelf!(long, "expectedContentLength"); | |
87 } | |
88 | |
89 NSString textEncodingName () | |
90 { | |
91 return invokeObjcSelf!(NSString, "textEncodingName"); | |
92 } | |
93 | |
94 NSString suggestedFilename () | |
95 { | |
96 return invokeObjcSelf!(NSString, "suggestedFilename"); | |
97 } | |
98 | |
99 void encodeWithCoder (NSCoder aCoder) | |
100 { | |
101 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
102 } | |
103 | |
104 Object initWithCoder (NSCoder aDecoder) | |
105 { | |
106 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
107 } | |
108 | |
109 this (NSCoder aDecoder) | |
110 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
111 typeof(this).alloc.initWithCoder(aDecoder); |
14 | 112 } |
113 | |
114 Object copyWithZone (NSZone* zone) | |
115 { | |
116 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone); | |
117 } | |
118 } | |
119 |