Merge branch 'master' into migration-backend

This commit is contained in:
Dean Herbert
2020-05-11 18:52:27 +09:00
27 changed files with 415 additions and 33 deletions

View File

@ -48,10 +48,18 @@ namespace osu.Game.IO
UnderlyingStorage.Delete(MutatePath(path));
public override IEnumerable<string> GetDirectories(string path) =>
UnderlyingStorage.GetDirectories(MutatePath(path));
ToLocalRelative(UnderlyingStorage.GetDirectories(MutatePath(path)));
public IEnumerable<string> ToLocalRelative(IEnumerable<string> paths)
{
string localRoot = GetFullPath(string.Empty);
foreach (var path in paths)
yield return Path.GetRelativePath(localRoot, UnderlyingStorage.GetFullPath(path));
}
public override IEnumerable<string> GetFiles(string path, string pattern = "*") =>
UnderlyingStorage.GetFiles(MutatePath(path), pattern);
ToLocalRelative(UnderlyingStorage.GetFiles(MutatePath(path), pattern));
public override Stream GetStream(string path, FileAccess access = FileAccess.Read, FileMode mode = FileMode.OpenOrCreate) =>
UnderlyingStorage.GetStream(MutatePath(path), access, mode);