mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
DOCUMENTATION: Added XML documentation to DiscImageChef.Core.
This commit is contained in:
@@ -34,7 +34,9 @@
|
||||
// TODO: Rename contents
|
||||
namespace DiscImageChef.CommonTypes
|
||||
{
|
||||
// Media (disk, cartridge, tape, cassette, etc) types
|
||||
/// <summary>
|
||||
/// Contains an enumeration of all known types of media.
|
||||
/// </summary>
|
||||
public enum MediaType
|
||||
{
|
||||
/// <summary>Unknown disk type</summary>
|
||||
|
||||
@@ -37,6 +37,17 @@ namespace DiscImageChef.CommonTypes
|
||||
#pragma warning disable RECS0063 // Warns when a culture-aware 'StartsWith' call is used by default.
|
||||
public static class MediaTypeFromScsi
|
||||
{
|
||||
/// <summary>
|
||||
/// Tries to guess, from SCSI information, the media type of a device and/or its inserted media
|
||||
/// </summary>
|
||||
/// <param name="scsiPeripheralType">The SCSI Peripheral Type as indicated in the INQUIRY response</param>
|
||||
/// <param name="vendor">The vendor string of the device</param>
|
||||
/// <param name="model">The model string of the device</param>
|
||||
/// <param name="mediumType">The medium type byte from MODE SENSE</param>
|
||||
/// <param name="densityCode">The density type byte from MODE SENSE</param>
|
||||
/// <param name="blocks">How many blocks are on the media</param>
|
||||
/// <param name="blockSize">Size in bytes of each block</param>
|
||||
/// <returns></returns>
|
||||
public static MediaType Get(byte scsiPeripheralType, string vendor, string model, byte mediumType,
|
||||
byte densityCode, ulong blocks, uint blockSize)
|
||||
{
|
||||
|
||||
@@ -56,13 +56,15 @@ namespace DiscImageChef.CommonTypes
|
||||
/// <summary>Information that does not find space in this struct</summary>
|
||||
public string Description;
|
||||
/// <summary>LBA of last partition sector</summary>
|
||||
public ulong End
|
||||
{
|
||||
get => Start + Length - 1;
|
||||
}
|
||||
public ulong End => Start + Length - 1;
|
||||
/// <summary>Name of partition scheme that contains this partition</summary>
|
||||
public string Scheme;
|
||||
|
||||
/// <summary>
|
||||
/// Compares two partitions
|
||||
/// </summary>
|
||||
/// <param name="other">Partition to compare with</param>
|
||||
/// <returns>0 if both partitions start and end at the same sector</returns>
|
||||
public bool Equals(Partition other)
|
||||
{
|
||||
return Start == other.Start && Length == other.Length;
|
||||
@@ -80,6 +82,11 @@ namespace DiscImageChef.CommonTypes
|
||||
return Start.GetHashCode() + End.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares this partition with another and returns an integer that indicates whether the current partition precedes, follows, or is in the same place as the other partition.
|
||||
/// </summary>
|
||||
/// <param name="other">Partition to compare with</param>
|
||||
/// <returns>A value that indicates the relative equality of the partitions being compared.</returns>
|
||||
public int CompareTo(Partition other)
|
||||
{
|
||||
if(Start == other.Start && End == other.End) return 0;
|
||||
|
||||
Reference in New Issue
Block a user