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

Unified Diff: pkg/watcher/lib/src/change_type.dart

Issue 18612013: File watching package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
Index: pkg/watcher/lib/src/change_type.dart
diff --git a/pkg/watcher/lib/src/change_type.dart b/pkg/watcher/lib/src/change_type.dart
new file mode 100644
index 0000000000000000000000000000000000000000..55358e1b527dea2f136a9024632ac55fe64d18a5
--- /dev/null
+++ b/pkg/watcher/lib/src/change_type.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2013, 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.
+
+library watcher.change_type;
+
+/// Enum for what kind of change has happened to a file.
+class ChangeType {
+ /// A new file has been added.
+ static const ADD = const ChangeType(0);
nweiz 2013/07/11 00:25:01 I think it's a little cleaner to use the name of t
Bob Nystrom 2013/07/11 18:33:20 I think I heard one of the VM guys say numbers are
+
+ /// A file has been removed.
+ static const REMOVE = const ChangeType(1);
+
+ /// The contents of a file have changed.
+ static const MODIFY = const ChangeType(2);
+
+ final int _value;
+ const ChangeType(this._value);
+
+ String toString() {
+ switch (this) {
+ case ChangeType.ADD: return "add";
+ case ChangeType.REMOVE: return "remove";
+ case ChangeType.MODIFY: return "modify";
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698