Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSDate.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
35 super(id); | 35 super(id); |
36 } | 36 } |
37 | 37 |
38 public id addTimeInterval (double seconds) | 38 public id addTimeInterval (double seconds) |
39 { | 39 { |
40 objc.id result = OS.objc_msgSend(this.id, OS.sel_addTimeInterval_1, seconds); | 40 objc.id result = OS.objc_msgSend(this.id_, OS.sel_addTimeInterval_1, seconds); |
41 return result !is null ? new id(result) : null; | 41 return result !is null ? new id(result) : null; |
42 } | 42 } |
43 | 43 |
44 public objc.id compare (NSDate other) | 44 public objc.id compare (NSDate other) |
45 { | 45 { |
46 return OS.objc_msgSend(this.id, OS.sel_compare_1, other !is null ? other.id : null); | 46 return OS.objc_msgSend(this.id_, OS.sel_compare_1, other !is null ? other.id_ : null); |
47 } | 47 } |
48 | 48 |
49 public static NSDate date () | 49 public static NSDate date () |
50 { | 50 { |
51 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_date); | 51 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_date); |
52 return result !is null ? new NSDate(result) : null; | 52 return result !is null ? new NSDate(result) : null; |
53 } | 53 } |
54 | 54 |
55 public NSCalendarDate dateWithCalendarFormat (NSString format, NSTimeZone aTimeZone) | 55 public NSCalendarDate dateWithCalendarFormat (NSString format, NSTimeZone aTimeZone) |
56 { | 56 { |
57 objc.id result = OS.objc_msgSend(this.id, OS.sel_dateWithCalendarFormat_1timeZone_1, format !is null ? format.id : null, | 57 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dateWithCalendarFormat_1timeZone_1, format !is null ? format.id_ : null, |
58 aTimeZone !is null ? aTimeZone.id : null); | 58 aTimeZone !is null ? aTimeZone.id_ : null); |
59 return result !is null ? new NSCalendarDate(result) : null; | 59 return result !is null ? new NSCalendarDate(result) : null; |
60 } | 60 } |
61 | 61 |
62 public static id static_dateWithNaturalLanguageString_ (NSString string) | 62 public static id static_dateWithNaturalLanguageString_ (NSString string) |
63 { | 63 { |
64 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithNaturalLanguageString_1, string !is null ? string.id : null); | 64 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithNaturalLanguageString_1, string !is null ? string.id_ : null); |
65 return result !is null ? new id(result) : null; | 65 return result !is null ? new id(result) : null; |
66 } | 66 } |
67 | 67 |
68 public static id static_dateWithNaturalLanguageString_locale_ (NSString string, id locale) | 68 public static id static_dateWithNaturalLanguageString_locale_ (NSString string, id locale) |
69 { | 69 { |
70 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithNaturalLanguageString_1locale_1, string !is null ? string.id : null, | 70 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithNaturalLanguageString_1locale_1, string !is null ? string.id_ : null, |
71 locale !is null ? locale.id : null); | 71 locale !is null ? locale.id_ : null); |
72 return result !is null ? new id(result) : null; | 72 return result !is null ? new id(result) : null; |
73 } | 73 } |
74 | 74 |
75 public static id dateWithString (NSString aString) | 75 public static id dateWithString (NSString aString) |
76 { | 76 { |
77 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithString_1, aString !is null ? aString.id : null); | 77 objc.id result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithString_1, aString !is null ? aString.id_ : null); |
78 return result !is null ? new id(result) : null; | 78 return result !is null ? new id(result) : null; |
79 } | 79 } |
80 | 80 |
81 public static id dateWithTimeIntervalSince1970 (double secs) | 81 public static id dateWithTimeIntervalSince1970 (double secs) |
82 { | 82 { |
96 return result !is null ? new id(result) : null; | 96 return result !is null ? new id(result) : null; |
97 } | 97 } |
98 | 98 |
99 public NSString description () | 99 public NSString description () |
100 { | 100 { |
101 objc.id result = OS.objc_msgSend(this.id, OS.sel_description); | 101 objc.id result = OS.objc_msgSend(this.id_, OS.sel_description); |
102 return result !is null ? new NSString(result) : null; | 102 return result !is null ? new NSString(result) : null; |
103 } | 103 } |
104 | 104 |
105 public NSString descriptionWithCalendarFormat (NSString format, NSTimeZone aTimeZone, id locale) | 105 public NSString descriptionWithCalendarFormat (NSString format, NSTimeZone aTimeZone, id locale) |
106 { | 106 { |
107 objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptionWithCalendarFormat_1timeZone_1locale_1, format !is null ? format.id : null, | 107 objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptionWithCalendarFormat_1timeZone_1locale_1, format !is null ? format.id_ : null, |
108 aTimeZone !is null ? aTimeZone.id : null, locale !is null ? locale.id : null); | 108 aTimeZone !is null ? aTimeZone.id_ : null, locale !is null ? locale.id_ : null); |
109 return result !is null ? new NSString(result) : null; | 109 return result !is null ? new NSString(result) : null; |
110 } | 110 } |
111 | 111 |
112 public NSString descriptionWithLocale (id locale) | 112 public NSString descriptionWithLocale (id locale) |
113 { | 113 { |
114 objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id : null); | 114 objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id_ : null); |
115 return result !is null ? new NSString(result) : null; | 115 return result !is null ? new NSString(result) : null; |
116 } | 116 } |
117 | 117 |
118 public static NSDate distantFuture () | 118 public static NSDate distantFuture () |
119 { | 119 { |
127 return result !is null ? new NSDate(result) : null; | 127 return result !is null ? new NSDate(result) : null; |
128 } | 128 } |
129 | 129 |
130 public NSDate earlierDate (NSDate anotherDate) | 130 public NSDate earlierDate (NSDate anotherDate) |
131 { | 131 { |
132 objc.id result = OS.objc_msgSend(this.id, OS.sel_earlierDate_1, anotherDate !is null ? anotherDate.id : null); | 132 objc.id result = OS.objc_msgSend(this.id_, OS.sel_earlierDate_1, anotherDate !is null ? anotherDate.id_ : null); |
133 return result is this.id ? this : (result !is null ? new NSDate(result) : null); | 133 return result is this.id_ ? this : (result !is null ? new NSDate(result) : null); |
134 } | 134 } |
135 | 135 |
136 public NSDate initWithString (NSString description) | 136 public NSDate initWithString (NSString description) |
137 { | 137 { |
138 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, description !is null ? description.id : null); | 138 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithString_1, description !is null ? description.id_ : null); |
139 return result !is null ? this : null; | 139 return result !is null ? this : null; |
140 } | 140 } |
141 | 141 |
142 public NSDate initWithTimeInterval (double secsToBeAdded, NSDate anotherDate) | 142 public NSDate initWithTimeInterval (double secsToBeAdded, NSDate anotherDate) |
143 { | 143 { |
144 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithTimeInterval_1sinceDate_1, secsToBeAdded, | 144 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithTimeInterval_1sinceDate_1, secsToBeAdded, |
145 anotherDate !is null ? anotherDate.id : null); | 145 anotherDate !is null ? anotherDate.id_ : null); |
146 return result !is null ? this : null; | 146 return result !is null ? this : null; |
147 } | 147 } |
148 | 148 |
149 public NSDate initWithTimeIntervalSinceNow (double secsToBeAddedToNow) | 149 public NSDate initWithTimeIntervalSinceNow (double secsToBeAddedToNow) |
150 { | 150 { |
151 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithTimeIntervalSinceNow_1, secsToBeAddedToNow); | 151 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithTimeIntervalSinceNow_1, secsToBeAddedToNow); |
152 return result !is null ? this : null; | 152 return result !is null ? this : null; |
153 } | 153 } |
154 | 154 |
155 public NSDate initWithTimeIntervalSinceReferenceDate (double secsToBeAdded) | 155 public NSDate initWithTimeIntervalSinceReferenceDate (double secsToBeAdded) |
156 { | 156 { |
157 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithTimeIntervalSinceReferenceDate_1, secsToBeAdded); | 157 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithTimeIntervalSinceReferenceDate_1, secsToBeAdded); |
158 return result !is null ? this : null; | 158 return result !is null ? this : null; |
159 } | 159 } |
160 | 160 |
161 public bool isEqualToDate (NSDate otherDate) | 161 public bool isEqualToDate (NSDate otherDate) |
162 { | 162 { |
163 return OS.objc_msgSend(this.id, OS.sel_isEqualToDate_1, otherDate !is null ? otherDate.id : null) !is null; | 163 return OS.objc_msgSend(this.id_, OS.sel_isEqualToDate_1, otherDate !is null ? otherDate.id_ : null) !is null; |
164 } | 164 } |
165 | 165 |
166 public NSDate laterDate (NSDate anotherDate) | 166 public NSDate laterDate (NSDate anotherDate) |
167 { | 167 { |
168 objc.id result = OS.objc_msgSend(this.id, OS.sel_laterDate_1, anotherDate !is null ? anotherDate.id : null); | 168 objc.id result = OS.objc_msgSend(this.id_, OS.sel_laterDate_1, anotherDate !is null ? anotherDate.id_ : null); |
169 return result is this.id ? this : (result !is null ? new NSDate(result) : null); | 169 return result is this.id_ ? this : (result !is null ? new NSDate(result) : null); |
170 } | 170 } |
171 | 171 |
172 public double timeIntervalSince1970 () | 172 public double timeIntervalSince1970 () |
173 { | 173 { |
174 return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSince1970); | 174 return OS.objc_msgSend_fpret(this.id_, OS.sel_timeIntervalSince1970); |
175 } | 175 } |
176 | 176 |
177 public double timeIntervalSinceDate (NSDate anotherDate) | 177 public double timeIntervalSinceDate (NSDate anotherDate) |
178 { | 178 { |
179 return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSinceDate_1, anotherDate !is null ? anotherDate.id : null); | 179 return OS.objc_msgSend_fpret(this.id_, OS.sel_timeIntervalSinceDate_1, anotherDate !is null ? anotherDate.id_ : null); |
180 } | 180 } |
181 | 181 |
182 public double timeIntervalSinceNow () | 182 public double timeIntervalSinceNow () |
183 { | 183 { |
184 return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSinceNow); | 184 return OS.objc_msgSend_fpret(this.id_, OS.sel_timeIntervalSinceNow); |
185 } | 185 } |
186 | 186 |
187 public static double static_timeIntervalSinceReferenceDate () | 187 public static double static_timeIntervalSinceReferenceDate () |
188 { | 188 { |
189 return OS.objc_msgSend_fpret(OS.class_NSDate, OS.sel_timeIntervalSinceReferenceDate); | 189 return OS.objc_msgSend_fpret(OS.class_NSDate, OS.sel_timeIntervalSinceReferenceDate); |
190 } | 190 } |
191 | 191 |
192 public double timeIntervalSinceReferenceDate () | 192 public double timeIntervalSinceReferenceDate () |
193 { | 193 { |
194 return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSinceReferenceDate); | 194 return OS.objc_msgSend_fpret(this.id_, OS.sel_timeIntervalSinceReferenceDate); |
195 } | 195 } |
196 | 196 |
197 } | 197 } |