comparison dwt/internal/cocoa/NSFileManager.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
37 super(id); 37 super(id);
38 } 38 }
39 39
40 public NSDictionary attributesOfFileSystemForPath (NSString path, objc.id** error) 40 public NSDictionary attributesOfFileSystemForPath (NSString path, objc.id** error)
41 { 41 {
42 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributesOfFileSystemForPath_1error_1, path !is null ? path.id : null, error); 42 objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributesOfFileSystemForPath_1error_1, path !is null ? path.id_ : null, error);
43 return result !is null ? new NSDictionary(result) : null; 43 return result !is null ? new NSDictionary(result) : null;
44 } 44 }
45 45
46 public NSDictionary attributesOfItemAtPath (NSString path, objc.id** error) 46 public NSDictionary attributesOfItemAtPath (NSString path, objc.id** error)
47 { 47 {
48 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributesOfItemAtPath_1error_1, path !is null ? path.id : null, error); 48 objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributesOfItemAtPath_1error_1, path !is null ? path.id_ : null, error);
49 return result !is null ? new NSDictionary(result) : null; 49 return result !is null ? new NSDictionary(result) : null;
50 } 50 }
51 51
52 public bool changeCurrentDirectoryPath (NSString path) 52 public bool changeCurrentDirectoryPath (NSString path)
53 { 53 {
54 return OS.objc_msgSend(this.id, OS.sel_changeCurrentDirectoryPath_1, path !is null ? path.id : null) !is null; 54 return OS.objc_msgSend(this.id_, OS.sel_changeCurrentDirectoryPath_1, path !is null ? path.id_ : null) !is null;
55 } 55 }
56 56
57 public bool changeFileAttributes (NSDictionary attributes, NSString path) 57 public bool changeFileAttributes (NSDictionary attributes, NSString path)
58 { 58 {
59 return OS.objc_msgSend(this.id, OS.sel_changeFileAttributes_1atPath_1, attributes !is null ? attributes.id : null, 59 return OS.objc_msgSend(this.id_, OS.sel_changeFileAttributes_1atPath_1, attributes !is null ? attributes.id_ : null,
60 path !is null ? path.id : null) !is null; 60 path !is null ? path.id_ : null) !is null;
61 } 61 }
62 62
63 public NSArray componentsToDisplayForPath (NSString path) 63 public NSArray componentsToDisplayForPath (NSString path)
64 { 64 {
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_componentsToDisplayForPath_1, path !is null ? path.id : null); 65 objc.id result = OS.objc_msgSend(this.id_, OS.sel_componentsToDisplayForPath_1, path !is null ? path.id_ : null);
66 return result !is null ? new NSArray(result) : null; 66 return result !is null ? new NSArray(result) : null;
67 } 67 }
68 68
69 public NSData contentsAtPath (NSString path) 69 public NSData contentsAtPath (NSString path)
70 { 70 {
71 objc.id result = OS.objc_msgSend(this.id, OS.sel_contentsAtPath_1, path !is null ? path.id : null); 71 objc.id result = OS.objc_msgSend(this.id_, OS.sel_contentsAtPath_1, path !is null ? path.id_ : null);
72 return result !is null ? new NSData(result) : null; 72 return result !is null ? new NSData(result) : null;
73 } 73 }
74 74
75 public bool contentsEqualAtPath (NSString path1, NSString path2) 75 public bool contentsEqualAtPath (NSString path1, NSString path2)
76 { 76 {
77 return OS.objc_msgSend(this.id, OS.sel_contentsEqualAtPath_1andPath_1, path1 !is null ? path1.id : null, path2 !is null ? path2.id : null) !is null; 77 return OS.objc_msgSend(this.id_, OS.sel_contentsEqualAtPath_1andPath_1, path1 !is null ? path1.id_ : null, path2 !is null ? path2.id_ : null) !is null;
78 } 78 }
79 79
80 public NSArray contentsOfDirectoryAtPath (NSString path, objc.id** error) 80 public NSArray contentsOfDirectoryAtPath (NSString path, objc.id** error)
81 { 81 {
82 objc.id result = OS.objc_msgSend(this.id, OS.sel_contentsOfDirectoryAtPath_1error_1, path !is null ? path.id : null, error); 82 objc.id result = OS.objc_msgSend(this.id_, OS.sel_contentsOfDirectoryAtPath_1error_1, path !is null ? path.id_ : null, error);
83 return result !is null ? new NSArray(result) : null; 83 return result !is null ? new NSArray(result) : null;
84 } 84 }
85 85
86 public bool copyItemAtPath (NSString srcPath, NSString dstPath, objc.id** error) 86 public bool copyItemAtPath (NSString srcPath, NSString dstPath, objc.id** error)
87 { 87 {
88 return OS.objc_msgSend(this.id, OS.sel_copyItemAtPath_1toPath_1error_1, srcPath !is null ? srcPath.id : null, 88 return OS.objc_msgSend(this.id_, OS.sel_copyItemAtPath_1toPath_1error_1, srcPath !is null ? srcPath.id_ : null,
89 dstPath !is null ? dstPath.id : null, error) !is null; 89 dstPath !is null ? dstPath.id_ : null, error) !is null;
90 } 90 }
91 91
92 public bool copyPath (NSString src, NSString dest, id handler) 92 public bool copyPath (NSString src, NSString dest, id handler)
93 { 93 {
94 return OS.objc_msgSend(this.id, OS.sel_copyPath_1toPath_1handler_1, src !is null ? src.id : null, dest !is null ? dest.id : null, 94 return OS.objc_msgSend(this.id_, OS.sel_copyPath_1toPath_1handler_1, src !is null ? src.id_ : null, dest !is null ? dest.id_ : null,
95 handler !is null ? handler.id : null) !is null; 95 handler !is null ? handler.id_ : null) !is null;
96 } 96 }
97 97
98 public bool createDirectoryAtPath_attributes_ (NSString path, NSDictionary attributes) 98 public bool createDirectoryAtPath_attributes_ (NSString path, NSDictionary attributes)
99 { 99 {
100 return OS.objc_msgSend(this.id, OS.sel_createDirectoryAtPath_1attributes_1, path !is null ? path.id : null, 100 return OS.objc_msgSend(this.id_, OS.sel_createDirectoryAtPath_1attributes_1, path !is null ? path.id_ : null,
101 attributes !is null ? attributes.id : null) !is null; 101 attributes !is null ? attributes.id_ : null) !is null;
102 } 102 }
103 103
104 public bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_ (NSString path, bool createIntermediates, 104 public bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_ (NSString path, bool createIntermediates,
105 NSDictionary attributes, objc.id** error) 105 NSDictionary attributes, objc.id** error)
106 { 106 {
107 return OS.objc_msgSend(this.id, OS.sel_createDirectoryAtPath_1withIntermediateDirectories_1attributes_1error_1, 107 return OS.objc_msgSend(this.id_, OS.sel_createDirectoryAtPath_1withIntermediateDirectories_1attributes_1error_1,
108 path !is null ? path.id : null, createIntermediates, attributes !is null ? attributes.id : null, error) !is null; 108 path !is null ? path.id_ : null, createIntermediates, attributes !is null ? attributes.id_ : null, error) !is null;
109 } 109 }
110 110
111 public bool createFileAtPath (NSString path, NSData data, NSDictionary attr) 111 public bool createFileAtPath (NSString path, NSData data, NSDictionary attr)
112 { 112 {
113 return OS.objc_msgSend(this.id, OS.sel_createFileAtPath_1contents_1attributes_1, path !is null ? path.id : null, 113 return OS.objc_msgSend(this.id_, OS.sel_createFileAtPath_1contents_1attributes_1, path !is null ? path.id_ : null,
114 data !is null ? data.id : null, attr !is null ? attr.id : null) !is null; 114 data !is null ? data.id_ : null, attr !is null ? attr.id_ : null) !is null;
115 } 115 }
116 116
117 public bool createSymbolicLinkAtPath_pathContent_ (NSString path, NSString otherpath) 117 public bool createSymbolicLinkAtPath_pathContent_ (NSString path, NSString otherpath)
118 { 118 {
119 return OS.objc_msgSend(this.id, OS.sel_createSymbolicLinkAtPath_1pathContent_1, path !is null ? path.id : null, 119 return OS.objc_msgSend(this.id_, OS.sel_createSymbolicLinkAtPath_1pathContent_1, path !is null ? path.id_ : null,
120 otherpath !is null ? otherpath.id : null) !is null; 120 otherpath !is null ? otherpath.id_ : null) !is null;
121 } 121 }
122 122
123 public bool createSymbolicLinkAtPath_withDestinationPath_error_ (NSString path, NSString destPath, objc.id** error) 123 public bool createSymbolicLinkAtPath_withDestinationPath_error_ (NSString path, NSString destPath, objc.id** error)
124 { 124 {
125 return OS.objc_msgSend(this.id, OS.sel_createSymbolicLinkAtPath_1withDestinationPath_1error_1, path !is null ? path.id : null, 125 return OS.objc_msgSend(this.id_, OS.sel_createSymbolicLinkAtPath_1withDestinationPath_1error_1, path !is null ? path.id_ : null,
126 destPath !is null ? destPath.id : null, error) !is null; 126 destPath !is null ? destPath.id_ : null, error) !is null;
127 } 127 }
128 128
129 public NSString currentDirectoryPath () 129 public NSString currentDirectoryPath ()
130 { 130 {
131 objc.id result = OS.objc_msgSend(this.id, OS.sel_currentDirectoryPath); 131 objc.id result = OS.objc_msgSend(this.id_, OS.sel_currentDirectoryPath);
132 return result !is null ? new NSString(result) : null; 132 return result !is null ? new NSString(result) : null;
133 } 133 }
134 134
135 public static NSFileManager defaultManager () 135 public static NSFileManager defaultManager ()
136 { 136 {
138 return result !is null ? new NSFileManager(result) : null; 138 return result !is null ? new NSFileManager(result) : null;
139 } 139 }
140 140
141 public id delegatee () 141 public id delegatee ()
142 { 142 {
143 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); 143 objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate);
144 return result !is null ? new id(result) : null; 144 return result !is null ? new id(result) : null;
145 } 145 }
146 146
147 public NSString destinationOfSymbolicLinkAtPath (NSString path, objc.id** error) 147 public NSString destinationOfSymbolicLinkAtPath (NSString path, objc.id** error)
148 { 148 {
149 objc.id result = OS.objc_msgSend(this.id, OS.sel_destinationOfSymbolicLinkAtPath_1error_1, path !is null ? path.id : null, error); 149 objc.id result = OS.objc_msgSend(this.id_, OS.sel_destinationOfSymbolicLinkAtPath_1error_1, path !is null ? path.id_ : null, error);
150 return result !is null ? new NSString(result) : null; 150 return result !is null ? new NSString(result) : null;
151 } 151 }
152 152
153 public NSArray directoryContentsAtPath (NSString path) 153 public NSArray directoryContentsAtPath (NSString path)
154 { 154 {
155 objc.id result = OS.objc_msgSend(this.id, OS.sel_directoryContentsAtPath_1, path !is null ? path.id : null); 155 objc.id result = OS.objc_msgSend(this.id_, OS.sel_directoryContentsAtPath_1, path !is null ? path.id_ : null);
156 return result !is null ? new NSArray(result) : null; 156 return result !is null ? new NSArray(result) : null;
157 } 157 }
158 158
159 public NSString displayNameAtPath (NSString path) 159 public NSString displayNameAtPath (NSString path)
160 { 160 {
161 objc.id result = OS.objc_msgSend(this.id, OS.sel_displayNameAtPath_1, path !is null ? path.id : null); 161 objc.id result = OS.objc_msgSend(this.id_, OS.sel_displayNameAtPath_1, path !is null ? path.id_ : null);
162 return result !is null ? new NSString(result) : null; 162 return result !is null ? new NSString(result) : null;
163 } 163 }
164 164
165 public NSDirectoryEnumerator enumeratorAtPath (NSString path) 165 public NSDirectoryEnumerator enumeratorAtPath (NSString path)
166 { 166 {
167 objc.id result = OS.objc_msgSend(this.id, OS.sel_enumeratorAtPath_1, path !is null ? path.id : null); 167 objc.id result = OS.objc_msgSend(this.id_, OS.sel_enumeratorAtPath_1, path !is null ? path.id_ : null);
168 return result !is null ? new NSDirectoryEnumerator(result) : null; 168 return result !is null ? new NSDirectoryEnumerator(result) : null;
169 } 169 }
170 170
171 public NSDictionary fileAttributesAtPath (NSString path, bool yorn) 171 public NSDictionary fileAttributesAtPath (NSString path, bool yorn)
172 { 172 {
173 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileAttributesAtPath_1traverseLink_1, path !is null ? path.id : null, yorn); 173 objc.id result = OS.objc_msgSend(this.id_, OS.sel_fileAttributesAtPath_1traverseLink_1, path !is null ? path.id_ : null, yorn);
174 return result !is null ? new NSDictionary(result) : null; 174 return result !is null ? new NSDictionary(result) : null;
175 } 175 }
176 176
177 public bool fileExistsAtPath_ (NSString path) 177 public bool fileExistsAtPath_ (NSString path)
178 { 178 {
179 return OS.objc_msgSend(this.id, OS.sel_fileExistsAtPath_1, path !is null ? path.id : null) !is null; 179 return OS.objc_msgSend(this.id_, OS.sel_fileExistsAtPath_1, path !is null ? path.id_ : null) !is null;
180 } 180 }
181 181
182 public bool fileExistsAtPath_isDirectory_ (NSString path, bool* isDirectory) 182 public bool fileExistsAtPath_isDirectory_ (NSString path, bool* isDirectory)
183 { 183 {
184 return OS.objc_msgSend(this.id, OS.sel_fileExistsAtPath_1isDirectory_1, path !is null ? path.id : null, isDirectory) !is null; 184 return OS.objc_msgSend(this.id_, OS.sel_fileExistsAtPath_1isDirectory_1, path !is null ? path.id_ : null, isDirectory) !is null;
185 } 185 }
186 186
187 public NSDictionary fileSystemAttributesAtPath (NSString path) 187 public NSDictionary fileSystemAttributesAtPath (NSString path)
188 { 188 {
189 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileSystemAttributesAtPath_1, path !is null ? path.id : null); 189 objc.id result = OS.objc_msgSend(this.id_, OS.sel_fileSystemAttributesAtPath_1, path !is null ? path.id_ : null);
190 return result !is null ? new NSDictionary(result) : null; 190 return result !is null ? new NSDictionary(result) : null;
191 } 191 }
192 192
193 public /*const*/char* fileSystemRepresentationWithPath (NSString path) 193 public /*const*/char* fileSystemRepresentationWithPath (NSString path)
194 { 194 {
195 return OS.objc_msgSend(this.id, OS.sel_fileSystemRepresentationWithPath_1, path !is null ? path.id : null); 195 return cast(/*const*/char*) OS.objc_msgSend(this.id_, OS.sel_fileSystemRepresentationWithPath_1, path !is null ? path.id_ : null);
196 } 196 }
197 197
198 public bool isDeletableFileAtPath (NSString path) 198 public bool isDeletableFileAtPath (NSString path)
199 { 199 {
200 return OS.objc_msgSend(this.id, OS.sel_isDeletableFileAtPath_1, path !is null ? path.id : null) !is null; 200 return OS.objc_msgSend(this.id_, OS.sel_isDeletableFileAtPath_1, path !is null ? path.id_ : null) !is null;
201 } 201 }
202 202
203 public bool isExecutableFileAtPath (NSString path) 203 public bool isExecutableFileAtPath (NSString path)
204 { 204 {
205 return OS.objc_msgSend(this.id, OS.sel_isExecutableFileAtPath_1, path !is null ? path.id : null) !is null; 205 return OS.objc_msgSend(this.id_, OS.sel_isExecutableFileAtPath_1, path !is null ? path.id_ : null) !is null;
206 } 206 }
207 207
208 public bool isReadableFileAtPath (NSString path) 208 public bool isReadableFileAtPath (NSString path)
209 { 209 {
210 return OS.objc_msgSend(this.id, OS.sel_isReadableFileAtPath_1, path !is null ? path.id : null) !is null; 210 return OS.objc_msgSend(this.id_, OS.sel_isReadableFileAtPath_1, path !is null ? path.id_ : null) !is null;
211 } 211 }
212 212
213 public bool isWritableFileAtPath (NSString path) 213 public bool isWritableFileAtPath (NSString path)
214 { 214 {
215 return OS.objc_msgSend(this.id, OS.sel_isWritableFileAtPath_1, path !is null ? path.id : null) !is null; 215 return OS.objc_msgSend(this.id_, OS.sel_isWritableFileAtPath_1, path !is null ? path.id_ : null) !is null;
216 } 216 }
217 217
218 public bool linkItemAtPath (NSString srcPath, NSString dstPath, objc.id** error) 218 public bool linkItemAtPath (NSString srcPath, NSString dstPath, objc.id** error)
219 { 219 {
220 return OS.objc_msgSend(this.id, OS.sel_linkItemAtPath_1toPath_1error_1, srcPath !is null ? srcPath.id : null, 220 return OS.objc_msgSend(this.id_, OS.sel_linkItemAtPath_1toPath_1error_1, srcPath !is null ? srcPath.id_ : null,
221 dstPath !is null ? dstPath.id : null, error) !is null; 221 dstPath !is null ? dstPath.id_ : null, error) !is null;
222 } 222 }
223 223
224 public bool linkPath (NSString src, NSString dest, id handler) 224 public bool linkPath (NSString src, NSString dest, id handler)
225 { 225 {
226 return OS.objc_msgSend(this.id, OS.sel_linkPath_1toPath_1handler_1, src !is null ? src.id : null, dest !is null ? dest.id : null, 226 return OS.objc_msgSend(this.id_, OS.sel_linkPath_1toPath_1handler_1, src !is null ? src.id_ : null, dest !is null ? dest.id_ : null,
227 handler !is null ? handler.id : null) !is null; 227 handler !is null ? handler.id_ : null) !is null;
228 } 228 }
229 229
230 public bool moveItemAtPath (NSString srcPath, NSString dstPath, objc.id** error) 230 public bool moveItemAtPath (NSString srcPath, NSString dstPath, objc.id** error)
231 { 231 {
232 return OS.objc_msgSend(this.id, OS.sel_moveItemAtPath_1toPath_1error_1, srcPath !is null ? srcPath.id : null, 232 return OS.objc_msgSend(this.id_, OS.sel_moveItemAtPath_1toPath_1error_1, srcPath !is null ? srcPath.id_ : null,
233 dstPath !is null ? dstPath.id : null, error) !is null; 233 dstPath !is null ? dstPath.id_ : null, error) !is null;
234 } 234 }
235 235
236 public bool movePath (NSString src, NSString dest, id handler) 236 public bool movePath (NSString src, NSString dest, id handler)
237 { 237 {
238 return OS.objc_msgSend(this.id, OS.sel_movePath_1toPath_1handler_1, src !is null ? src.id : null, dest !is null ? dest.id : null, 238 return OS.objc_msgSend(this.id_, OS.sel_movePath_1toPath_1handler_1, src !is null ? src.id_ : null, dest !is null ? dest.id_ : null,
239 handler !is null ? handler.id : null) !is null; 239 handler !is null ? handler.id_ : null) !is null;
240 } 240 }
241 241
242 public NSString pathContentOfSymbolicLinkAtPath (NSString path) 242 public NSString pathContentOfSymbolicLinkAtPath (NSString path)
243 { 243 {
244 objc.id result = OS.objc_msgSend(this.id, OS.sel_pathContentOfSymbolicLinkAtPath_1, path !is null ? path.id : null); 244 objc.id result = OS.objc_msgSend(this.id_, OS.sel_pathContentOfSymbolicLinkAtPath_1, path !is null ? path.id_ : null);
245 return result !is null ? new NSString(result) : null; 245 return result !is null ? new NSString(result) : null;
246 } 246 }
247 247
248 public bool removeFileAtPath (NSString path, id handler) 248 public bool removeFileAtPath (NSString path, id handler)
249 { 249 {
250 return OS.objc_msgSend(this.id, OS.sel_removeFileAtPath_1handler_1, path !is null ? path.id : null, handler !is null ? handler.id : null) !is null; 250 return OS.objc_msgSend(this.id_, OS.sel_removeFileAtPath_1handler_1, path !is null ? path.id_ : null, handler !is null ? handler.id_ : null) !is null;
251 } 251 }
252 252
253 public bool removeItemAtPath (NSString path, objc.id** error) 253 public bool removeItemAtPath (NSString path, objc.id** error)
254 { 254 {
255 return OS.objc_msgSend(this.id, OS.sel_removeItemAtPath_1error_1, path !is null ? path.id : null, error) !is null; 255 return OS.objc_msgSend(this.id_, OS.sel_removeItemAtPath_1error_1, path !is null ? path.id_ : null, error) !is null;
256 } 256 }
257 257
258 public bool setAttributes (NSDictionary attributes, NSString path, objc.id** error) 258 public bool setAttributes (NSDictionary attributes, NSString path, objc.id** error)
259 { 259 {
260 return OS.objc_msgSend(this.id, OS.sel_setAttributes_1ofItemAtPath_1error_1, attributes !is null ? attributes.id : null, 260 return OS.objc_msgSend(this.id_, OS.sel_setAttributes_1ofItemAtPath_1error_1, attributes !is null ? attributes.id_ : null,
261 path !is null ? path.id : null, error) !is null; 261 path !is null ? path.id_ : null, error) !is null;
262 } 262 }
263 263
264 public void setDelegate (id delegatee) 264 public void setDelegate (id delegatee)
265 { 265 {
266 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null); 266 OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id_ : null);
267 } 267 }
268 268
269 public NSString stringWithFileSystemRepresentation (/*const*/char* str, NSUInteger len) 269 public NSString stringWithFileSystemRepresentation (/*const*/char* str, NSUInteger len)
270 { 270 {
271 objc.id result = OS.objc_msgSend(this.id, OS.sel_stringWithFileSystemRepresentation_1length_1, str, len); 271 objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringWithFileSystemRepresentation_1length_1, str, len);
272 return result !is null ? new NSString(result) : null; 272 return result !is null ? new NSString(result) : null;
273 } 273 }
274 274
275 public NSArray subpathsAtPath (NSString path) 275 public NSArray subpathsAtPath (NSString path)
276 { 276 {
277 objc.id result = OS.objc_msgSend(this.id, OS.sel_subpathsAtPath_1, path !is null ? path.id : null); 277 objc.id result = OS.objc_msgSend(this.id_, OS.sel_subpathsAtPath_1, path !is null ? path.id_ : null);
278 return result !is null ? new NSArray(result) : null; 278 return result !is null ? new NSArray(result) : null;
279 } 279 }
280 280
281 public NSArray subpathsOfDirectoryAtPath (NSString path, objc.id** error) 281 public NSArray subpathsOfDirectoryAtPath (NSString path, objc.id** error)
282 { 282 {
283 objc.id result = OS.objc_msgSend(this.id, OS.sel_subpathsOfDirectoryAtPath_1error_1, path !is null ? path.id : null, error); 283 objc.id result = OS.objc_msgSend(this.id_, OS.sel_subpathsOfDirectoryAtPath_1error_1, path !is null ? path.id_ : null, error);
284 return result !is null ? new NSArray(result) : null; 284 return result !is null ? new NSArray(result) : null;
285 } 285 }
286 286
287 } 287 }