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 @patch | 5 @patch |
6 class _Directory { | 6 class _Directory { |
7 @patch | 7 @patch |
8 static _current() native "Directory_Current"; | 8 static _current(_Namespace namespace) native "Directory_Current"; |
9 @patch | 9 @patch |
10 static _setCurrent(path) native "Directory_SetCurrent"; | 10 static _setCurrent(_Namespace namespace, path) native "Directory_SetCurrent"; |
11 @patch | 11 @patch |
12 static _createTemp(String path) native "Directory_CreateTemp"; | 12 static _createTemp(_Namespace namespace, String path) |
| 13 native "Directory_CreateTemp"; |
13 @patch | 14 @patch |
14 static String _systemTemp() native "Directory_SystemTemp"; | 15 static String _systemTemp(_Namespace namespace) native "Directory_SystemTemp"; |
15 @patch | 16 @patch |
16 static _exists(String path) native "Directory_Exists"; | 17 static _exists(_Namespace namespace, String path) native "Directory_Exists"; |
17 @patch | 18 @patch |
18 static _create(String path) native "Directory_Create"; | 19 static _create(_Namespace namespace, String path) native "Directory_Create"; |
19 @patch | 20 @patch |
20 static _deleteNative(String path, bool recursive) native "Directory_Delete"; | 21 static _deleteNative(_Namespace namespace, String path, bool recursive) |
| 22 native "Directory_Delete"; |
21 @patch | 23 @patch |
22 static _rename(String path, String newPath) native "Directory_Rename"; | 24 static _rename(_Namespace namespace, String path, String newPath) |
| 25 native "Directory_Rename"; |
23 @patch | 26 @patch |
24 static void _fillWithDirectoryListing( | 27 static void _fillWithDirectoryListing( |
| 28 _Namespace namespace, |
25 List<FileSystemEntity> list, | 29 List<FileSystemEntity> list, |
26 String path, | 30 String path, |
27 bool recursive, | 31 bool recursive, |
28 bool followLinks) native "Directory_FillWithDirectoryListing"; | 32 bool followLinks) native "Directory_FillWithDirectoryListing"; |
29 } | 33 } |
30 | 34 |
31 @patch | 35 @patch |
32 class _AsyncDirectoryListerOps { | 36 class _AsyncDirectoryListerOps { |
33 @patch | 37 @patch |
34 factory _AsyncDirectoryListerOps(int pointer) => | 38 factory _AsyncDirectoryListerOps(int pointer) => |
35 new _AsyncDirectoryListerOpsImpl(pointer); | 39 new _AsyncDirectoryListerOpsImpl(pointer); |
36 } | 40 } |
37 | 41 |
38 class _AsyncDirectoryListerOpsImpl extends NativeFieldWrapperClass1 | 42 class _AsyncDirectoryListerOpsImpl extends NativeFieldWrapperClass1 |
39 implements _AsyncDirectoryListerOps { | 43 implements _AsyncDirectoryListerOps { |
40 _AsyncDirectoryListerOpsImpl._(); | 44 _AsyncDirectoryListerOpsImpl._(); |
41 | 45 |
42 factory _AsyncDirectoryListerOpsImpl(int pointer) => | 46 factory _AsyncDirectoryListerOpsImpl(int pointer) => |
43 new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer); | 47 new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer); |
44 | 48 |
45 void _setPointer(int pointer) | 49 void _setPointer(int pointer) |
46 native "Directory_SetAsyncDirectoryListerPointer"; | 50 native "Directory_SetAsyncDirectoryListerPointer"; |
47 int getPointer() native "Directory_GetAsyncDirectoryListerPointer"; | 51 int getPointer() native "Directory_GetAsyncDirectoryListerPointer"; |
48 } | 52 } |
49 | 53 |
50 // Corelib 'Uri.base' implementation. | 54 // Corelib 'Uri.base' implementation. |
51 // Uri.base is susceptible to changes in the current working directory. | 55 // Uri.base is susceptible to changes in the current working directory. |
52 Uri _uriBaseClosure() { | 56 Uri _uriBaseClosure() { |
53 var result = _Directory._current(); | 57 var result = _Directory._current(_Namespace._namespace); |
54 if (result is OSError) { | 58 if (result is OSError) { |
55 throw new FileSystemException( | 59 throw new FileSystemException( |
56 "Getting current working directory failed", "", result); | 60 "Getting current working directory failed", "", result); |
57 } | 61 } |
58 return new Uri.directory(result); | 62 return new Uri.directory(result); |
59 } | 63 } |
60 | 64 |
61 _getUriBaseClosure() => _uriBaseClosure; | 65 _getUriBaseClosure() => _uriBaseClosure; |
OLD | NEW |