Chromium Code Reviews| 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"; |
| + } |
| + } |
| +} |