ConsoleUI container size text

This commit is contained in:
2023-08-16 12:00:07 +02:00
parent e35702c8e6
commit cbbf7b3704
27 changed files with 191 additions and 46 deletions

View File

@@ -28,4 +28,5 @@ public interface IContentProvider : IContainer, IOnContainerEnter
Task<byte[]?> GetContentAsync(IElement element, int? maxLength = null, CancellationToken cancellationToken = default);
bool CanHandlePath(NativePath path);
bool CanHandlePath(FullName path);
VolumeSizeInfo? GetVolumeSizeInfo(FullName path);
}

View File

@@ -0,0 +1,13 @@
namespace FileTime.Core.Models;
public readonly struct VolumeSizeInfo
{
public readonly long TotalSize;
public readonly long FreeSize;
public VolumeSizeInfo(long totalSize, long freeSize)
{
TotalSize = totalSize;
FreeSize = freeSize;
}
}

View File

@@ -90,5 +90,7 @@ public abstract class ContentProviderBase : IContentProvider
public abstract bool CanHandlePath(NativePath path);
public bool CanHandlePath(FullName path) => CanHandlePath(GetNativePath(path));
public abstract VolumeSizeInfo? GetVolumeSizeInfo(FullName path);
public IItem WithParent(AbsolutePath parent) => this;
}

View File

@@ -85,5 +85,7 @@ public class RootContentProvider : IRootContentProvider
public bool CanHandlePath(NativePath path) => throw new NotImplementedException();
public bool CanHandlePath(FullName path) => throw new NotImplementedException();
public IItem WithParent(AbsolutePath parent) => this;
public VolumeSizeInfo? GetVolumeSizeInfo(FullName path) => null;
public IItem WithParent(AbsolutePath parent) => this;
}