blob: 6d027cfc9a36957d747bc69dee9dba5737b00c13 [file] [log] [blame]
// Copyright (c) 2017, 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.
import 'dart:async';
import 'package:file/src/io.dart' as io;
import 'package:file/file.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;
/// A file system that forwards all methods and properties to a delegate.
abstract class ForwardingFileSystem extends FileSystem {
/// Creates a new [ForwardingFileSystem] that forwards all methods and
/// properties to the specified [delegate].
/// The file system to which this file system will forward all activity.
final FileSystem delegate;
Directory directory(dynamic path) =>;
File file(dynamic path) => delegate.file(path);
Link link(dynamic path) =>;
p.Context get path => delegate.path;
Directory get systemTempDirectory => delegate.systemTempDirectory;
Directory get currentDirectory => delegate.currentDirectory;
set currentDirectory(dynamic path) => delegate.currentDirectory = path;
Future<io.FileStat> stat(String path) => delegate.stat(path);
io.FileStat statSync(String path) => delegate.statSync(path);
Future<bool> identical(String path1, String path2) =>
delegate.identical(path1, path2);
bool identicalSync(String path1, String path2) =>
delegate.identicalSync(path1, path2);
bool get isWatchSupported => delegate.isWatchSupported;
Future<io.FileSystemEntityType> type(String path,
{bool followLinks = true}) =>
delegate.type(path, followLinks: followLinks);
io.FileSystemEntityType typeSync(String path, {bool followLinks = true}) =>
delegate.typeSync(path, followLinks: followLinks);