mirror of
https://github.com/aaru-dps/Aaru.CommonTypes.git
synced 2025-12-16 19:24:30 +00:00
Add interface for byte addressable images.
This commit is contained in:
@@ -37,88 +37,57 @@
|
||||
// Copyright © 2011-2021 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Abstract class to implement disk image reading plugins.</summary>
|
||||
public interface IMediaImage : IBaseImage
|
||||
{
|
||||
/// <summary>Abstract class to implement disk image reading plugins.</summary>
|
||||
public interface IMediaImage
|
||||
{
|
||||
/// <summary>Image information</summary>
|
||||
ImageInfo Info { get; }
|
||||
/// <summary>Plugin name.</summary>
|
||||
string Name { get; }
|
||||
/// <summary>Plugin UUID.</summary>
|
||||
Guid Id { get; }
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
/// <summary>Gets the image format.</summary>
|
||||
/// <value>The image format.</value>
|
||||
string Format { get; }
|
||||
/// <summary>List of dump hardware used to create the image from real media</summary>
|
||||
List<DumpHardwareType> DumpHardware { get; }
|
||||
/// <summary>Gets the CICM XML metadata for the image</summary>
|
||||
CICMMetadataType CicmMetadata { get; }
|
||||
/// <summary>Reads a disk tag.</summary>
|
||||
/// <returns></returns>
|
||||
/// <param name="tag">Tag type to read.</param>
|
||||
/// <param name="buffer">Disk tag</param>
|
||||
ErrorNumber ReadMediaTag(MediaTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Identifies the image.</summary>
|
||||
/// <returns><c>true</c>, if image was identified, <c>false</c> otherwise.</returns>
|
||||
/// <param name="imageFilter">Image filter.</param>
|
||||
bool Identify(IFilter imageFilter);
|
||||
/// <summary>Reads a sector's user data.</summary>
|
||||
/// <returns>The sector's user data.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer);
|
||||
|
||||
/// <summary>Opens the image.</summary>
|
||||
/// <returns><c>true</c>, if image was opened, <c>false</c> otherwise.</returns>
|
||||
/// <param name="imageFilter">Image filter.</param>
|
||||
ErrorNumber Open(IFilter imageFilter);
|
||||
/// <summary>Reads a complete sector (user data + all tags).</summary>
|
||||
/// <returns>The complete sector. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a disk tag.</summary>
|
||||
/// <returns></returns>
|
||||
/// <param name="tag">Tag type to read.</param>
|
||||
/// <param name="buffer">Disk tag</param>
|
||||
ErrorNumber ReadMediaTag(MediaTagType tag, out byte[] buffer);
|
||||
/// <summary>Reads user data from several sectors.</summary>
|
||||
/// <returns>The sectors user data.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's user data.</summary>
|
||||
/// <returns>The sector's user data.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer);
|
||||
/// <summary>Reads several complete sector (user data + all tags).</summary>
|
||||
/// <returns>The complete sectors. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's tag.</summary>
|
||||
/// <returns>The sector's tag.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorTag(ulong sectorAddress, SectorTagType tag, out byte[] buffer);
|
||||
/// <summary>Reads tag from several sectors.</summary>
|
||||
/// <returns>The sectors tag.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads user data from several sectors.</summary>
|
||||
/// <returns>The sectors user data.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads tag from several sectors.</summary>
|
||||
/// <returns>The sectors tag.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a complete sector (user data + all tags).</summary>
|
||||
/// <returns>The complete sector. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads several complete sector (user data + all tags).</summary>
|
||||
/// <returns>The complete sectors. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, out byte[] buffer);
|
||||
}
|
||||
/// <summary>Reads a sector's tag.</summary>
|
||||
/// <returns>The sector's tag.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorTag(ulong sectorAddress, SectorTagType tag, out byte[] buffer);
|
||||
}
|
||||
Reference in New Issue
Block a user