internal string MakeRelativePath(FileLocator fileLocator, string path) { if (!HasCommonRoot(fileLocator)) { return null; } string ourFullPath = GetFullPath(string.Empty) + @"\"; string otherFullPath = fileLocator.GetFullPath(path); return Utilities.MakeRelativePath(otherFullPath, ourFullPath); }
public override bool HasCommonRoot(FileLocator other) { DiscFileLocator otherDiscLocator = other as DiscFileLocator; if (otherDiscLocator == null) { return false; } // Common root if the same file system instance. return Object.ReferenceEquals(otherDiscLocator._fileSystem, _fileSystem); }
internal static VirtualDiskLayer OpenDiskLayer(FileLocator locator, string path, FileAccess access) { string extension = Path.GetExtension(path).ToUpperInvariant(); if (extension.StartsWith(".", StringComparison.Ordinal)) { extension = extension.Substring(1); } VirtualDiskFactory factory; if (ExtensionMap.TryGetValue(extension, out factory)) { return(factory.OpenDiskLayer(locator, path, access)); } return(null); }
public override bool HasCommonRoot(FileLocator other) { LocalFileLocator otherLocal = other as LocalFileLocator; if (otherLocal == null) { return false; } // If the paths have drive specifiers, then common root depends on them having a common // drive letter. string otherDir = otherLocal._dir; if (otherDir.Length >= 2 && _dir.Length >= 2) { if (otherDir[1] == ':' && _dir[1] == ':') { return Char.ToUpperInvariant(otherDir[0]) == Char.ToUpperInvariant(_dir[0]); } } return true; }
public override bool HasCommonRoot(FileLocator other) { LocalFileLocator otherLocal = other as LocalFileLocator; if (otherLocal == null) { return(false); } // If the paths have drive specifiers, then common root depends on them having a common // drive letter. string otherDir = otherLocal._dir; if (otherDir.Length >= 2 && _dir.Length >= 2) { if (otherDir[1] == ':' && _dir[1] == ':') { return(Char.ToUpperInvariant(otherDir[0]) == Char.ToUpperInvariant(_dir[0])); } } return(true); }
internal static VirtualDiskLayer OpenDiskLayer(FileLocator locator, string path, FileAccess access) { string extension = Path.GetExtension(path).ToUpperInvariant(); if (extension.StartsWith(".", StringComparison.Ordinal)) { extension = extension.Substring(1); } VirtualDiskFactory factory; if (ExtensionMap.TryGetValue(extension, out factory)) { return factory.OpenDiskLayer(locator, path, access); } return null; }
public abstract bool HasCommonRoot(FileLocator other);
public abstract VirtualDiskLayer OpenDiskLayer(FileLocator locator, string path, FileAccess access);
public virtual VirtualDisk OpenDisk(FileLocator locator, string path, string extraInfo, Dictionary<string, string> parameters, FileAccess access) { return OpenDisk(locator, path, access); }
public abstract VirtualDisk CreateDisk(FileLocator locator, string variant, string path, VirtualDiskParameters diskParameters);
public virtual VirtualDisk OpenDisk(FileLocator locator, string path, string extraInfo, Dictionary <string, string> parameters, FileAccess access) { return(OpenDisk(locator, path, access)); }