|
| 1 | +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 | + |
| 5 | +part of file.src.forwarding; |
| 6 | + |
| 7 | +/// A file system that forwards all methods and properties to a delegate. |
| 8 | +abstract class ForwardingFileSystem extends FileSystem { |
| 9 | + /// The file system to which this file system will forward all activity. |
| 10 | + @protected |
| 11 | + final FileSystem delegate; |
| 12 | + |
| 13 | + /// Creates a new [ForwardingFileSystem] that forwards all methods and |
| 14 | + /// properties to the specified [delegate]. |
| 15 | + ForwardingFileSystem(this.delegate); |
| 16 | + |
| 17 | + @override |
| 18 | + Directory directory(path) => delegate.directory(path); |
| 19 | + |
| 20 | + @override |
| 21 | + File file(path) => delegate.file(path); |
| 22 | + |
| 23 | + @override |
| 24 | + Link link(path) => delegate.link(path); |
| 25 | + |
| 26 | + @override |
| 27 | + String get pathSeparator => delegate.pathSeparator; |
| 28 | + |
| 29 | + @override |
| 30 | + Directory get systemTempDirectory => delegate.systemTempDirectory; |
| 31 | + |
| 32 | + @override |
| 33 | + Directory get currentDirectory => delegate.currentDirectory; |
| 34 | + |
| 35 | + @override |
| 36 | + set currentDirectory(dynamic path) => delegate.currentDirectory = path; |
| 37 | + |
| 38 | + @override |
| 39 | + Future<io.FileStat> stat(String path) => delegate.stat(path); |
| 40 | + |
| 41 | + @override |
| 42 | + io.FileStat statSync(String path) => delegate.statSync(path); |
| 43 | + |
| 44 | + @override |
| 45 | + Future<bool> identical(String path1, String path2) => |
| 46 | + delegate.identical(path1, path2); |
| 47 | + |
| 48 | + @override |
| 49 | + bool identicalSync(String path1, String path2) => |
| 50 | + delegate.identicalSync(path1, path2); |
| 51 | + |
| 52 | + @override |
| 53 | + bool get isWatchSupported => delegate.isWatchSupported; |
| 54 | + |
| 55 | + @override |
| 56 | + Future<io.FileSystemEntityType> type(String path, {bool followLinks: true}) => |
| 57 | + delegate.type(path, followLinks: followLinks); |
| 58 | + |
| 59 | + @override |
| 60 | + io.FileSystemEntityType typeSync(String path, {bool followLinks: true}) => |
| 61 | + delegate.typeSync(path, followLinks: followLinks); |
| 62 | +} |
0 commit comments