54 lines
2.7 KiB
C#
54 lines
2.7 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Duplicati.Proprietary.DiskImage.Partition;
|
|
|
|
/// <summary>
|
|
/// Represents a single partition on a disk.
|
|
/// </summary>
|
|
public interface IPartition
|
|
{
|
|
/// <summary>
|
|
/// Gets the partition number (1-based).
|
|
/// </summary>
|
|
int PartitionNumber { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the partition type identifier.
|
|
/// </summary>
|
|
PartitionType Type { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the starting offset in bytes.
|
|
/// </summary>
|
|
long StartOffset { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the size in bytes.
|
|
/// </summary>
|
|
long Size { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the partition name (if available).
|
|
/// </summary>
|
|
string? Name { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the filesystem type (if detectable).
|
|
/// </summary
|
|
FilesystemType FilesystemType { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the volume GUID (for GPT).
|
|
/// </summary>
|
|
Guid? VolumeGuid { get; }
|
|
|
|
/// <summary>
|
|
/// Creates a stream to read the raw partition data.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>Stream for reading partition data.</returns>
|
|
Task<Stream> OpenReadAsync(CancellationToken cancellationToken);
|
|
} |