OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * The type of an entity on the file system, such as a file, directory, or link. | 8 * The type of an entity on the file system, such as a file, directory, or link. |
9 * | 9 * |
10 * These constants are used by the [FileSystemEntity] class | 10 * These constants are used by the [FileSystemEntity] class |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 * * The [FileSystemEntity] being watches, is deleted. | 432 * * The [FileSystemEntity] being watches, is deleted. |
433 * | 433 * |
434 * Use `events` to specify what events to listen for. The constants in | 434 * Use `events` to specify what events to listen for. The constants in |
435 * [FileSystemEvent] can be or'ed together to mix events. Default is | 435 * [FileSystemEvent] can be or'ed together to mix events. Default is |
436 * [FileSystemEvent.ALL]. | 436 * [FileSystemEvent.ALL]. |
437 * | 437 * |
438 * A move event may be reported as seperate delete and create events. | 438 * A move event may be reported as seperate delete and create events. |
439 */ | 439 */ |
440 Stream<FileSystemEvent> watch({int events: FileSystemEvent.ALL, | 440 Stream<FileSystemEvent> watch({int events: FileSystemEvent.ALL, |
441 bool recursive: false}) | 441 bool recursive: false}) |
442 => _FileSystemWatcher.watch(_trimTrailingPathSeparators(path), | 442 => _FileSystemWatcher._watch(_trimTrailingPathSeparators(path), |
443 events, | 443 events, |
444 recursive); | 444 recursive); |
445 | 445 |
446 Future<FileSystemEntity> _delete({bool recursive: false}); | 446 Future<FileSystemEntity> _delete({bool recursive: false}); |
447 void _deleteSync({bool recursive: false}); | 447 void _deleteSync({bool recursive: false}); |
448 | 448 |
449 /** | 449 /** |
450 * Checks whether two paths refer to the same object in the | 450 * Checks whether two paths refer to the same object in the |
451 * file system. Returns a [:Future<bool>:] that completes with the result. | 451 * file system. Returns a [:Future<bool>:] that completes with the result. |
452 * | 452 * |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 var buffer = new StringBuffer(); | 820 var buffer = new StringBuffer(); |
821 buffer.write("FileSystemMoveEvent('$path'"); | 821 buffer.write("FileSystemMoveEvent('$path'"); |
822 if (destination != null) buffer.write(", '$destination'"); | 822 if (destination != null) buffer.write(", '$destination'"); |
823 buffer.write(')'); | 823 buffer.write(')'); |
824 return buffer.toString(); | 824 return buffer.toString(); |
825 } | 825 } |
826 } | 826 } |
827 | 827 |
828 | 828 |
829 class _FileSystemWatcher { | 829 class _FileSystemWatcher { |
830 external static Stream<FileSystemEvent> watch( | 830 external static Stream<FileSystemEvent> _watch( |
831 String path, int events, bool recursive); | 831 String path, int events, bool recursive); |
832 external static bool get isSupported; | 832 external static bool get isSupported; |
833 } | 833 } |
OLD | NEW |