Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSCharacterSet.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.NSCharacterSet; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSData; | |
18 import dwt.internal.cocoa.NSObject; | |
19 import dwt.internal.cocoa.NSRange; | |
20 import dwt.internal.cocoa.NSString; | |
21 import dwt.internal.cocoa.OS; | |
22 import objc = dwt.internal.objc.runtime; | |
23 | |
24 public class NSCharacterSet : NSObject | |
25 { | |
26 | |
27 public this () | |
28 { | |
29 super(); | |
30 } | |
31 | |
32 public this (objc.id id) | |
33 { | |
34 super(id); | |
35 } | |
36 | |
37 public static id alphanumericCharacterSet () | |
38 { | |
39 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_alphanumericCharacterSet); | |
40 return result !is null ? new id(result) : null; | |
41 } | |
42 | |
43 public NSData bitmapRepresentation () | |
44 { | |
45 objc.id result = OS.objc_msgSend(this.id, OS.sel_bitmapRepresentation); | |
46 return result !is null ? new NSData(result) : null; | |
47 } | |
48 | |
49 public static id capitalizedLetterCharacterSet () | |
50 { | |
51 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_capitalizedLetterCharacterSet); | |
52 return result !is null ? new id(result) : null; | |
53 } | |
54 | |
55 public bool characterIsMember (short aCharacter) | |
56 { | |
57 return OS.objc_msgSend(this.id, OS.sel_characterIsMember_1, aCharacter) !is null; | |
58 } | |
59 | |
60 public static id characterSetWithBitmapRepresentation (NSData data) | |
61 { | |
62 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithBitmapRepresentation_1, data !is null ? data.id : null); | |
63 return result !is null ? new id(result) : null; | |
64 } | |
65 | |
66 public static id characterSetWithCharactersInString (NSString aString) | |
67 { | |
68 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithCharactersInString_1, aString !is null ? aString.id : null); | |
69 return result !is null ? new id(result) : null; | |
70 } | |
71 | |
72 public static id characterSetWithContentsOfFile (NSString fName) | |
73 { | |
74 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithContentsOfFile_1, fName !is null ? fName.id : null); | |
75 return result !is null ? new id(result) : null; | |
76 } | |
77 | |
78 public static id characterSetWithRange (NSRange aRange) | |
79 { | |
80 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithRange_1, aRange); | |
81 return result !is null ? new id(result) : null; | |
82 } | |
83 | |
84 public static id controlCharacterSet () | |
85 { | |
86 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_controlCharacterSet); | |
87 return result !is null ? new id(result) : null; | |
88 } | |
89 | |
90 public static id decimalDigitCharacterSet () | |
91 { | |
92 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_decimalDigitCharacterSet); | |
93 return result !is null ? new id(result) : null; | |
94 } | |
95 | |
96 public static id decomposableCharacterSet () | |
97 { | |
98 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_decomposableCharacterSet); | |
99 return result !is null ? new id(result) : null; | |
100 } | |
101 | |
102 public bool hasMemberInPlane (byte thePlane) | |
103 { | |
104 return OS.objc_msgSend(this.id, OS.sel_hasMemberInPlane_1, thePlane) !is null; | |
105 } | |
106 | |
107 public static id illegalCharacterSet () | |
108 { | |
109 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_illegalCharacterSet); | |
110 return result !is null ? new id(result) : null; | |
111 } | |
112 | |
113 public NSCharacterSet invertedSet () | |
114 { | |
115 objc.id result = OS.objc_msgSend(this.id, OS.sel_invertedSet); | |
116 return result is this.id ? this : (result !is null ? new NSCharacterSet(result) : null); | |
117 } | |
118 | |
119 public bool isSupersetOfSet (NSCharacterSet theOtherSet) | |
120 { | |
121 return OS.objc_msgSend(this.id, OS.sel_isSupersetOfSet_1, theOtherSet !is null ? theOtherSet.id : null) !is null; | |
122 } | |
123 | |
124 public static id letterCharacterSet () | |
125 { | |
126 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_letterCharacterSet); | |
127 return result !is null ? new id(result) : null; | |
128 } | |
129 | |
130 public bool longCharacterIsMember (dchar theLongChar) | |
131 { | |
132 return OS.objc_msgSend(this.id, OS.sel_longCharacterIsMember_1, theLongChar) !is null; | |
133 } | |
134 | |
135 public static id lowercaseLetterCharacterSet () | |
136 { | |
137 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_lowercaseLetterCharacterSet); | |
138 return result !is null ? new id(result) : null; | |
139 } | |
140 | |
141 public static id newlineCharacterSet () | |
142 { | |
143 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_newlineCharacterSet); | |
144 return result !is null ? new id(result) : null; | |
145 } | |
146 | |
147 public static id nonBaseCharacterSet () | |
148 { | |
149 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_nonBaseCharacterSet); | |
150 return result !is null ? new id(result) : null; | |
151 } | |
152 | |
153 public static id punctuationCharacterSet () | |
154 { | |
155 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_punctuationCharacterSet); | |
156 return result !is null ? new id(result) : null; | |
157 } | |
158 | |
159 public static id symbolCharacterSet () | |
160 { | |
161 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_symbolCharacterSet); | |
162 return result !is null ? new id(result) : null; | |
163 } | |
164 | |
165 public static id uppercaseLetterCharacterSet () | |
166 { | |
167 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_uppercaseLetterCharacterSet); | |
168 return result !is null ? new id(result) : null; | |
169 } | |
170 | |
171 public static id whitespaceAndNewlineCharacterSet () | |
172 { | |
173 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_whitespaceAndNewlineCharacterSet); | |
174 return result !is null ? new id(result) : null; | |
175 } | |
176 | |
177 public static id whitespaceCharacterSet () | |
178 { | |
179 objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_whitespaceCharacterSet); | |
180 return result !is null ? new id(result) : null; | |
181 } | |
182 | |
183 } |