41 lines
3.1 KiB
C#
41 lines
3.1 KiB
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Duplicati.Proprietary.DiskImage.Partition;
|
|
|
|
namespace Duplicati.Proprietary.DiskImage.Filesystem;
|
|
|
|
/// <summary>
|
|
/// Filesystem operations interface.
|
|
/// </summary>
|
|
public interface IFilesystem : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Gets the supported filesystem type(s).
|
|
/// </summary>
|
|
string SupportedType { get; }
|
|
|
|
/// <summary>
|
|
/// Mounts a partition for filesystem access.
|
|
/// </summary>
|
|
/// <param name="partition">The partition to mount.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Volume handle for operations.</returns>
|
|
Task<IVolumeHandle> MountAsync(IPartition partition, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Mounts a raw disk/partition without filesystem awareness.
|
|
/// </summary>
|
|
/// <param name="source">The source to mount as raw volume.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Volume handle for raw access.</returns>
|
|
Task<IVolumeHandle> MountRawAsync(IPartition source, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Detects the filesystem type of a partition.
|
|
/// </summary>
|
|
/// <param name="partition">The partition to check.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Detected filesystem type or null.</returns>
|
|
Task<string?> DetectFilesystemTypeAsync(IPartition partition, CancellationToken cancellationToken);
|
|
} |