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

Unified Diff: sdk/lib/io/file_system_entity.dart

Issue 48613002: Add 'isDir' to FileSystemEvent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More cleanup. Created 7 years, 2 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 | « runtime/bin/file_system_watcher_macos.cc ('k') | tests/standalone/io/file_system_watcher_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_system_entity.dart
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index 60fe6658dd41fa3d30fc28528dfc7295dc8873dd..81d406dcd4e849f30cfdf471b0840dbb7c7adfbc 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -658,6 +658,7 @@ class FileSystemEvent {
static const int _MODIFY_ATTRIBUTES = 1 << 4;
static const int _DELETE_SELF = 1 << 5;
+ static const int _IS_DIR = 1 << 6;
/**
* The type of event. See [FileSystemEvent] for a list of events.
@@ -670,7 +671,12 @@ class FileSystemEvent {
*/
final String path;
- FileSystemEvent._(this.type, this.path);
+ /**
+ * Is `true` if the event target was a directory.
+ */
+ final bool isDirectory;
+
+ FileSystemEvent._(this.type, this.path, this.isDirectory);
}
@@ -678,8 +684,8 @@ class FileSystemEvent {
* File system event for newly created file system objects.
*/
class FileSystemCreateEvent extends FileSystemEvent {
- FileSystemCreateEvent._(path)
- : super._(FileSystemEvent.CREATE, path);
+ FileSystemCreateEvent._(path, isDirectory)
+ : super._(FileSystemEvent.CREATE, path, isDirectory);
String toString() => "FileSystemCreateEvent('$path')";
}
@@ -695,8 +701,8 @@ class FileSystemModifyEvent extends FileSystemEvent {
*/
final bool contentChanged;
- FileSystemModifyEvent._(path, this.contentChanged)
- : super._(FileSystemEvent.MODIFY, path);
+ FileSystemModifyEvent._(path, isDirectory, this.contentChanged)
+ : super._(FileSystemEvent.MODIFY, path, isDirectory);
String toString() =>
"FileSystemModifyEvent('$path', contentChanged=$contentChanged)";
@@ -707,8 +713,8 @@ class FileSystemModifyEvent extends FileSystemEvent {
* File system event for deletion of file system objects.
*/
class FileSystemDeleteEvent extends FileSystemEvent {
- FileSystemDeleteEvent._(path)
- : super._(FileSystemEvent.DELETE, path);
+ FileSystemDeleteEvent._(path, isDirectory)
+ : super._(FileSystemEvent.DELETE, path, isDirectory);
String toString() => "FileSystemDeleteEvent('$path')";
}
@@ -724,8 +730,8 @@ class FileSystemMoveEvent extends FileSystemEvent {
*/
final String destination;
- FileSystemMoveEvent._(path, this.destination)
- : super._(FileSystemEvent.MOVE, path);
+ FileSystemMoveEvent._(path, isDirectory, this.destination)
+ : super._(FileSystemEvent.MOVE, path, isDirectory);
String toString() {
var buffer = new StringBuffer();
« no previous file with comments | « runtime/bin/file_system_watcher_macos.cc ('k') | tests/standalone/io/file_system_watcher_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698