OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef BIN_DIRECTORY_H_ | 5 #ifndef BIN_DIRECTORY_H_ |
6 #define BIN_DIRECTORY_H_ | 6 #define BIN_DIRECTORY_H_ |
7 | 7 |
8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "bin/dartutils.h" | 9 #include "bin/dartutils.h" |
10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 | 246 |
247 class Directory { | 247 class Directory { |
248 public: | 248 public: |
249 enum ExistsResult { | 249 enum ExistsResult { |
250 UNKNOWN, | 250 UNKNOWN, |
251 EXISTS, | 251 EXISTS, |
252 DOES_NOT_EXIST | 252 DOES_NOT_EXIST |
253 }; | 253 }; |
254 | 254 |
255 // This enum must be kept in sync with the request values in | |
256 // directory_impl.dart. | |
257 enum DirectoryRequest { | |
258 kCreateRequest = 0, | |
259 kDeleteRequest = 1, | |
260 kExistsRequest = 2, | |
261 kCreateTempRequest = 3, | |
262 kListStartRequest = 4, | |
263 kListNextRequest = 5, | |
264 kListStopRequest = 6, | |
265 kRenameRequest = 7 | |
266 }; | |
267 | |
268 static void List(DirectoryListing* listing); | 255 static void List(DirectoryListing* listing); |
269 static ExistsResult Exists(const char* path); | 256 static ExistsResult Exists(const char* path); |
270 static char* Current(); | 257 static char* Current(); |
271 static bool SetCurrent(const char* path); | 258 static bool SetCurrent(const char* path); |
272 static bool Create(const char* path); | 259 static bool Create(const char* path); |
273 static char* CreateTemp(const char* const_template); | 260 static char* CreateTemp(const char* const_template); |
274 static bool Delete(const char* path, bool recursive); | 261 static bool Delete(const char* path, bool recursive); |
275 static bool Rename(const char* path, const char* new_path); | 262 static bool Rename(const char* path, const char* new_path); |
276 | 263 |
277 static CObject* CreateRequest(const CObjectArray& request); | 264 static CObject* CreateRequest(const CObjectArray& request); |
278 static CObject* DeleteRequest(const CObjectArray& request); | 265 static CObject* DeleteRequest(const CObjectArray& request); |
279 static CObject* ExistsRequest(const CObjectArray& request); | 266 static CObject* ExistsRequest(const CObjectArray& request); |
280 static CObject* CreateTempRequest(const CObjectArray& request); | 267 static CObject* CreateTempRequest(const CObjectArray& request); |
281 static CObject* ListStartRequest(const CObjectArray& request); | 268 static CObject* ListStartRequest(const CObjectArray& request); |
282 static CObject* ListNextRequest(const CObjectArray& request); | 269 static CObject* ListNextRequest(const CObjectArray& request); |
283 static CObject* ListStopRequest(const CObjectArray& request); | 270 static CObject* ListStopRequest(const CObjectArray& request); |
284 static CObject* RenameRequest(const CObjectArray& request); | 271 static CObject* RenameRequest(const CObjectArray& request); |
285 | 272 |
286 private: | 273 private: |
287 DISALLOW_ALLOCATION(); | 274 DISALLOW_ALLOCATION(); |
288 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); | 275 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); |
289 }; | 276 }; |
290 | 277 |
291 } // namespace bin | 278 } // namespace bin |
292 } // namespace dart | 279 } // namespace dart |
293 | 280 |
294 #endif // BIN_DIRECTORY_H_ | 281 #endif // BIN_DIRECTORY_H_ |
OLD | NEW |