Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.file_system.file_system; | 5 library analyzer.file_system.file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:analyzer/src/util/absolute_path.dart'; | 10 import 'package:analyzer/src/util/absolute_path.dart'; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 * an exception is thrown. | 52 * an exception is thrown. |
| 53 */ | 53 */ |
| 54 File renameSync(String newPath); | 54 File renameSync(String newPath); |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Synchronously write a list of bytes to the file. | 57 * Synchronously write a list of bytes to the file. |
| 58 * | 58 * |
| 59 * Throws a [FileSystemException] if the operation fails. | 59 * Throws a [FileSystemException] if the operation fails. |
| 60 */ | 60 */ |
| 61 void writeAsBytesSync(List<int> bytes); | 61 void writeAsBytesSync(List<int> bytes); |
| 62 | |
| 63 /** | |
| 64 * Synchronously write a the given [content] to the file. The new content will | |
|
scheglov
2016/08/19 19:15:18
articles
Brian Wilkerson
2016/08/19 19:17:04
Done
| |
| 65 * replace any existing content. | |
| 66 * | |
| 67 * Throws a [FileSystemException] if the operation fails. | |
| 68 */ | |
| 69 void writeAsStringSync(String content); | |
| 62 } | 70 } |
| 63 | 71 |
| 64 /** | 72 /** |
| 65 * Base class for all file system exceptions. | 73 * Base class for all file system exceptions. |
| 66 */ | 74 */ |
| 67 class FileSystemException implements Exception { | 75 class FileSystemException implements Exception { |
| 68 final String path; | 76 final String path; |
| 69 final String message; | 77 final String message; |
| 70 | 78 |
| 71 FileSystemException(this.path, this.message); | 79 FileSystemException(this.path, this.message); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 | 263 |
| 256 @override | 264 @override |
| 257 Uri restoreAbsolute(Source source) => | 265 Uri restoreAbsolute(Source source) => |
| 258 _provider.pathContext.toUri(source.fullName); | 266 _provider.pathContext.toUri(source.fullName); |
| 259 | 267 |
| 260 /** | 268 /** |
| 261 * Return `true` if the given [uri] is a `file` URI. | 269 * Return `true` if the given [uri] is a `file` URI. |
| 262 */ | 270 */ |
| 263 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; | 271 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; |
| 264 } | 272 } |
| OLD | NEW |