comparison dwt/internal/cocoa/NSHTTPCookie.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSHTTPCookie;
15
16 import dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSArray;
18 import dwt.internal.cocoa.NSDate;
19 import dwt.internal.cocoa.NSDictionary;
20 import dwt.internal.cocoa.NSInteger;
21 import dwt.internal.cocoa.NSObject;
22 import dwt.internal.cocoa.NSString;
23 import dwt.internal.cocoa.NSURL;
24 import dwt.internal.cocoa.OS;
25 import objc = dwt.internal.objc.runtime;
26
27 public class NSHTTPCookie : NSObject
28 {
29
30 public this ()
31 {
32 super();
33 }
34
35 public this (objc.id id)
36 {
37 super(id);
38 }
39
40 public NSString comment ()
41 {
42 objc.id result = OS.objc_msgSend(this.id, OS.sel_comment);
43 return result !is null ? new NSString(result) : null;
44 }
45
46 public NSURL commentURL ()
47 {
48 objc.id result = OS.objc_msgSend(this.id, OS.sel_commentURL);
49 return result !is null ? new NSURL(result) : null;
50 }
51
52 public static id cookieWithProperties (NSDictionary properties)
53 {
54 objc.id result = OS.objc_msgSend(OS.class_NSHTTPCookie, OS.sel_cookieWithProperties_1, properties !is null ? properties.id : null);
55 return result !is null ? new id(result) : null;
56 }
57
58 public static NSArray cookiesWithResponseHeaderFields (NSDictionary headerFields, NSURL URL)
59 {
60 objc.id result = OS.objc_msgSend(OS.class_NSHTTPCookie, OS.sel_cookiesWithResponseHeaderFields_1forURL_1,
61 headerFields !is null ? headerFields.id : null, URL !is null ? URL.id : null);
62 return result !is null ? new NSArray(result) : null;
63 }
64
65 public NSString domain ()
66 {
67 objc.id result = OS.objc_msgSend(this.id, OS.sel_domain);
68 return result !is null ? new NSString(result) : null;
69 }
70
71 public NSDate expiresDate ()
72 {
73 objc.id result = OS.objc_msgSend(this.id, OS.sel_expiresDate);
74 return result !is null ? new NSDate(result) : null;
75 }
76
77 public id initWithProperties (NSDictionary properties)
78 {
79 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithProperties_1, properties !is null ? properties.id : null);
80 return result !is null ? new id(result) : null;
81 }
82
83 public bool isSecure ()
84 {
85 return OS.objc_msgSend(this.id, OS.sel_isSecure) !is null;
86 }
87
88 public bool isSessionOnly ()
89 {
90 return OS.objc_msgSend(this.id, OS.sel_isSessionOnly) !is null;
91 }
92
93 public NSString name ()
94 {
95 objc.id result = OS.objc_msgSend(this.id, OS.sel_name);
96 return result !is null ? new NSString(result) : null;
97 }
98
99 public NSString path ()
100 {
101 objc.id result = OS.objc_msgSend(this.id, OS.sel_path);
102 return result !is null ? new NSString(result) : null;
103 }
104
105 public NSArray portList ()
106 {
107 objc.id result = OS.objc_msgSend(this.id, OS.sel_portList);
108 return result !is null ? new NSArray(result) : null;
109 }
110
111 public NSDictionary properties ()
112 {
113 objc.id result = OS.objc_msgSend(this.id, OS.sel_properties);
114 return result !is null ? new NSDictionary(result) : null;
115 }
116
117 public static NSDictionary requestHeaderFieldsWithCookies (NSArray cookies)
118 {
119 objc.id result = OS.objc_msgSend(OS.class_NSHTTPCookie, OS.sel_requestHeaderFieldsWithCookies_1, cookies !is null ? cookies.id : null);
120 return result !is null ? new NSDictionary(result) : null;
121 }
122
123 public NSString value ()
124 {
125 objc.id result = OS.objc_msgSend(this.id, OS.sel_value);
126 return result !is null ? new NSString(result) : null;
127 }
128
129 //public NSUInteger version() {
130 // return OS.objc_msgSend(this.id, OS.sel_version);
131 //}
132
133 }