43 lines
2.7 KiB
C#
43 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Duplicati.Proprietary.DiskImage.Raw;
|
|
|
|
namespace Duplicati.Proprietary.DiskImage.Partition;
|
|
|
|
/// <summary>
|
|
/// Partition table parsing interface.
|
|
/// </summary>
|
|
public interface IPartitionTable : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Gets the raw disk this table was parsed from.
|
|
/// </summary>
|
|
IRawDisk RawDisk { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the partition table type.
|
|
/// </summary>
|
|
PartitionTableType TableType { get; }
|
|
|
|
/// <summary>
|
|
/// Enumerates all partitions on the disk.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Async enumerable of partitions.</returns>
|
|
IAsyncEnumerable<IPartition> EnumeratePartitions(CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets a specific partition by number.
|
|
/// </summary>
|
|
/// <param name="partitionNumber">The partition number.</param>
|
|
/// <returns>The partition, or null if not found.</returns>
|
|
Task<IPartition?> GetPartitionAsync(int partitionNumber, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets the protective MBR (for GPT disks).
|
|
/// </summary>
|
|
Task<Stream> GetProtectiveMbrAsync(CancellationToken cancellationToken);
|
|
} |