Inheritance: IDisposable
示例#1
0
		protected override void Access(String Path, out FileSystem NewFileSystem, out String NewPath)
		{
			if (!AllowAccessingParent)
			{
				Path = AbsoluteNormalizePath(Path);
			}
			base.Access(CombinePath(AccessPath, Path), out NewFileSystem, out NewPath);
		}
示例#2
0
 public void Mount(String Path, FileSystem FileSystemToMount, String FileSystemToMountPath = "/")
 {
     String FinalPath = AbsoluteNormalizePath(Path, CurrentWorkingPath);
     MountedFileSystems[FinalPath] = new MountStruct()
     {
         FileSystem = FileSystemToMount,
         Path = FileSystemToMountPath,
     };
 }
示例#3
0
        protected virtual void Access(String Path, out FileSystem NewFileSystem, out String NewPath)
        {
            // Normalize Components
            Path = AbsoluteNormalizePath(Path, CurrentWorkingPath);
            var ComparePath = ComparablePath(Path);

            // Check MountedFileSystems.
            foreach (var Item in MountedFileSystems)
            {
                var CheckMountedPath = ComparablePath(Item.Key);
                var MountInfo = Item.Value;

                if (
                    ComparePath.StartsWith(CheckMountedPath) &&
                    (
                        (CheckMountedPath.Length == ComparePath.Length) ||
                        (ComparePath.Substring(CheckMountedPath.Length, 1) == "/")
                    )
                ) {
                    var NewAccessPath = ComparePath.Substring(CheckMountedPath.Length);
                    if (MountInfo.Path != "/")
                    {
                        NewAccessPath = MountInfo.Path + "/" + NewAccessPath;
                    }
                    // Use Mounted File System.
                    MountInfo.FileSystem.Access(NewAccessPath, out NewFileSystem, out NewPath);
                    return;
                }
            }
            NewFileSystem = this;
            NewPath = Path;
        }
示例#4
0
 public ProxyFileSystem(FileSystem ParentFileSystem)
 {
     this.ParentFileSystem = ParentFileSystem;
 }
示例#5
0
		public FileSystemFromPath(FileSystem ParentFileSystem, String AccessPath, bool AllowAccessingParent = false)
			: base(ParentFileSystem)
		{
			this.AccessPath = AccessPath;
			this.AllowAccessingParent = AllowAccessingParent;
		}