Copy from ISO

This commit is contained in:
2023-09-04 18:05:01 +02:00
parent a323edafd3
commit 3a29991948
20 changed files with 241 additions and 48 deletions

View File

@@ -164,6 +164,22 @@ public sealed partial class LocalContentProvider : ContentProviderBase, ILocalCo
};
}
public override ValueTask<NativePath?> GetSupportedPathPart(NativePath nativePath)
{
var path = nativePath.Path;
var pathParts = path.Split(Path.DirectorySeparatorChar).SelectMany(p => p.Split(Constants.SeparatorChar)).ToArray();
for (var i = pathParts.Length - 1; i > 0; i--)
{
var possiblePath = string.Join(Path.DirectorySeparatorChar, pathParts.Take(i));
if (!File.Exists(possiblePath) && !Directory.Exists(possiblePath)) continue;
return ValueTask.FromResult<NativePath?>(new NativePath(possiblePath));
}
return ValueTask.FromResult<NativePath?>(null);
}
private Container CreateEmptyContainer(NativePath nativePath,
PointInTime pointInTime,
IEnumerable<Exception>? initialExceptions = null)

View File

@@ -40,10 +40,7 @@ public class LocalContentReader : IContentReader
}
}
public void SetPosition(long position)
{
Position = position;
}
public void SetPosition(long position) => Position = position;
public Stream AsStream() => _binaryReader.BaseStream;