4 using System.Collections.Generic;
8 namespace SiliconStudio.Core.IO
16 public static string DefaultRootPath =
"/drive";
31 filePath = Path.GetFullPath(filePath);
34 var resolveProviderResult = VirtualFileSystem.ResolveProvider(RootPath,
true);
38 throw new InvalidOperationException();
40 return provider.ConvertFullPathToUrl(filePath);
47 if (VolumeSeparatorChar ==
'/')
52 var result =
new StringBuilder(url.Length + 1);
53 int separatorIndex = 0;
55 foreach (var c
in url.ToCharArray())
59 if (separatorIndex == 1)
62 result.Append(VolumeSeparatorChar);
66 if (separatorIndex >= 1)
68 result.Append(DirectorySeparatorChar);
79 return result.ToString();
86 if (VolumeSeparatorChar ==
'/')
91 var result =
new StringBuilder(path.Length + 1);
93 result.Append(VirtualFileSystem.DirectorySeparatorChar);
95 foreach (var c
in path.ToCharArray())
97 if (c == VolumeSeparatorChar)
101 else if (c == DirectorySeparatorChar)
103 result.Append(VirtualFileSystem.DirectorySeparatorChar);
111 return result.ToString();
override string ConvertUrlToFullPath(string url)
Virtual abstraction over a file system. It handles access to files, http, packages, path rewrite, etc...
override string ConvertFullPathToUrl(string path)
A file system implementation for IVirtualFileProvider.
static readonly char DirectorySeparatorChar
Exposes the whole file system through folder similar to Cygwin. As an example, "/c/Program Files/Test...
static readonly char AltDirectorySeparatorChar
string GetLocalPath(string filePath)
Resolves the VFS URL from a given file path.
DriveFileProvider(string rootPath)