42bcdcd332
Reason for revert: Breaking API change blocks Flutter rolls. Reverting to reconsider, work around, etc.. Revert "[ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used." This reverts commit916b9da48d. Revert "[ VM ] Fixed tests for non-UTF8 paths on Windows / Macos." This reverts commit6327fe91c2. Revert "[ VM ] Fix failing tests on Windows bots after non-UTF-8 paths change." This reverts commitb51f4b7956. Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS." This reverts commitbcb36247d2. Revert "Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS."" This reverts commit24450c79a5. Change-Id: I756f74f4acdde168d0984fe130f05f9252366334 Reviewed-on: https://dart-review.googlesource.com/55441 Reviewed-by: Todd Volkert <tvolkert@google.com> Commit-Queue: Zach Anderson <zra@google.com>
68 lines
2.2 KiB
Dart
68 lines
2.2 KiB
Dart
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// part of "common_patch.dart";
|
|
|
|
@patch
|
|
class _Directory {
|
|
@patch
|
|
static _current(_Namespace namespace) native "Directory_Current";
|
|
@patch
|
|
static _setCurrent(_Namespace namespace, path) native "Directory_SetCurrent";
|
|
@patch
|
|
static _createTemp(_Namespace namespace, String path)
|
|
native "Directory_CreateTemp";
|
|
@patch
|
|
static String _systemTemp(_Namespace namespace) native "Directory_SystemTemp";
|
|
@patch
|
|
static _exists(_Namespace namespace, String path) native "Directory_Exists";
|
|
@patch
|
|
static _create(_Namespace namespace, String path) native "Directory_Create";
|
|
@patch
|
|
static _deleteNative(_Namespace namespace, String path, bool recursive)
|
|
native "Directory_Delete";
|
|
@patch
|
|
static _rename(_Namespace namespace, String path, String newPath)
|
|
native "Directory_Rename";
|
|
@patch
|
|
static void _fillWithDirectoryListing(
|
|
_Namespace namespace,
|
|
List<FileSystemEntity> list,
|
|
String path,
|
|
bool recursive,
|
|
bool followLinks) native "Directory_FillWithDirectoryListing";
|
|
}
|
|
|
|
@patch
|
|
class _AsyncDirectoryListerOps {
|
|
@patch
|
|
factory _AsyncDirectoryListerOps(int pointer) =>
|
|
new _AsyncDirectoryListerOpsImpl(pointer);
|
|
}
|
|
|
|
class _AsyncDirectoryListerOpsImpl extends NativeFieldWrapperClass1
|
|
implements _AsyncDirectoryListerOps {
|
|
_AsyncDirectoryListerOpsImpl._();
|
|
|
|
factory _AsyncDirectoryListerOpsImpl(int pointer) =>
|
|
new _AsyncDirectoryListerOpsImpl._().._setPointer(pointer);
|
|
|
|
void _setPointer(int pointer)
|
|
native "Directory_SetAsyncDirectoryListerPointer";
|
|
int getPointer() native "Directory_GetAsyncDirectoryListerPointer";
|
|
}
|
|
|
|
// Corelib 'Uri.base' implementation.
|
|
// Uri.base is susceptible to changes in the current working directory.
|
|
Uri _uriBaseClosure() {
|
|
var result = _Directory._current(_Namespace._namespace);
|
|
if (result is OSError) {
|
|
throw new FileSystemException(
|
|
"Getting current working directory failed", "", result);
|
|
}
|
|
return new Uri.directory(result);
|
|
}
|
|
|
|
_getUriBaseClosure() => _uriBaseClosure;
|