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

Unified Diff: pkg/front_end/lib/file_system.dart

Issue 2844903002: Extend file-system abstraction with a couple methods, remove context (Closed)
Patch Set: v3 Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/kernel_generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/file_system.dart
diff --git a/pkg/front_end/lib/file_system.dart b/pkg/front_end/lib/file_system.dart
index 6e57c266c067bdd9b731335abc37ece3bfa672ec..0afb39e7a7b72fd7fc812b50da4879f82ffb4364 100644
--- a/pkg/front_end/lib/file_system.dart
+++ b/pkg/front_end/lib/file_system.dart
@@ -6,8 +6,6 @@ library front_end.file_system;
import 'dart:async';
-import 'package:path/path.dart' as path;
-
/// Abstract interface to file system operations.
///
/// All front end interaction with the file system goes through this interface;
@@ -17,12 +15,6 @@ import 'package:path/path.dart' as path;
///
/// Not intended to be implemented or extended by clients.
abstract class FileSystem {
- /// Returns a path context suitable for use with this [FileSystem].
- ///
- /// TODO(paulberry): try to eliminate all usages of this. Since the
- /// FileSystem API now uses URIs rather than paths, it should not be needed.
- path.Context get context;
Siggi Cherem (dart-lang) 2017/04/27 00:08:50 I can split this change if you prefer, but very so
-
/// Returns a [FileSystemEntity] corresponding to the given [uri].
///
/// Uses of `..` and `.` in the URI are normalized before returning.
@@ -41,8 +33,7 @@ abstract class FileSystem {
///
/// Not intended to be implemented or extended by clients.
abstract class FileSystemEntity {
- /// Returns the absolute normalized URI represented by this file system
- /// entity.
+ /// The absolute normalized URI represented by this file system entity.
///
/// Note: this is not necessarily the same as the URI that was passed to
/// [FileSystem.entityForUri], since the URI might have been normalized.
@@ -65,4 +56,12 @@ abstract class FileSystemEntity {
/// file exists, the entity is a directory, or the file is not valid UTF-8),
/// the future is completed with an [Exception].
Future<String> readAsString();
+
+ /// Whether this file system entity exists.
+ Future<bool> exists();
+
+ /// Extracts the last-modification time of the file system entity, if it
+ /// exists and it is a file, otherwise the future is completed with an
+ /// [Exception].
+ Future<DateTime> lastModified();
}
« no previous file with comments | « no previous file | pkg/front_end/lib/kernel_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698