Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: runtime/bin/directory_impl.dart

Issue 10639004: Add .fromPath constructors to File and Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/directory.dart ('k') | runtime/bin/file.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 class _Directory implements Directory { 6 class _Directory implements Directory {
7 static final CREATE_REQUEST = 0; 7 static final CREATE_REQUEST = 0;
8 static final DELETE_REQUEST = 1; 8 static final DELETE_REQUEST = 1;
9 static final EXISTS_REQUEST = 2; 9 static final EXISTS_REQUEST = 2;
10 static final CREATE_TEMP_REQUEST = 3; 10 static final CREATE_TEMP_REQUEST = 3;
11 static final LIST_REQUEST = 4; 11 static final LIST_REQUEST = 4;
12 static final RENAME_REQUEST = 5; 12 static final RENAME_REQUEST = 5;
13 13
14 static final SUCCESS_RESPONSE = 0; 14 static final SUCCESS_RESPONSE = 0;
15 static final ILLEGAL_ARGUMENT_RESPONSE = 1; 15 static final ILLEGAL_ARGUMENT_RESPONSE = 1;
16 static final OSERROR_RESPONSE = 2; 16 static final OSERROR_RESPONSE = 2;
17 17
18 _Directory(String this._path); 18 _Directory(String this._path);
19 _Directory.current() : _path = _current(); 19 _Directory.fromPath(Path path) : this(path.toNativePath());
20 _Directory.current() : this(_current());
20 21
21 static String _current() native "Directory_Current"; 22 static String _current() native "Directory_Current";
22 static _createTemp(String template) native "Directory_CreateTemp"; 23 static _createTemp(String template) native "Directory_CreateTemp";
23 static int _exists(String path) native "Directory_Exists"; 24 static int _exists(String path) native "Directory_Exists";
24 static _create(String path) native "Directory_Create"; 25 static _create(String path) native "Directory_Create";
25 static _delete(String path, bool recursive) native "Directory_Delete"; 26 static _delete(String path, bool recursive) native "Directory_Delete";
26 static _rename(String path, String newPath) native "Directory_Rename"; 27 static _rename(String path, String newPath) native "Directory_Rename";
27 static SendPort _newServicePort() native "Directory_NewServicePort"; 28 static SendPort _newServicePort() native "Directory_NewServicePort";
28 29
29 Future<bool> exists() { 30 Future<bool> exists() {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } else { 285 } else {
285 throw e; 286 throw e;
286 } 287 }
287 } 288 }
288 289
289 Function _onDir; 290 Function _onDir;
290 Function _onFile; 291 Function _onFile;
291 Function _onDone; 292 Function _onDone;
292 Function _onError; 293 Function _onError;
293 } 294 }
OLDNEW
« no previous file with comments | « runtime/bin/directory.dart ('k') | runtime/bin/file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698