mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General code refactor.
This commit is contained in:
@@ -38,38 +38,22 @@
|
||||
|
||||
namespace Aaru.CommonTypes.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Device types
|
||||
/// </summary>
|
||||
/// <summary>Device types</summary>
|
||||
public enum DeviceType
|
||||
{
|
||||
/// <summary>
|
||||
/// Unknown device type
|
||||
/// </summary>
|
||||
/// <summary>Unknown device type</summary>
|
||||
Unknown = -1,
|
||||
/// <summary>
|
||||
/// ATA device
|
||||
/// </summary>
|
||||
/// <summary>ATA device</summary>
|
||||
ATA = 1,
|
||||
/// <summary>
|
||||
/// ATA Packet device (aka SCSI over ATA)
|
||||
/// </summary>
|
||||
/// <summary>ATA Packet device (aka SCSI over ATA)</summary>
|
||||
ATAPI = 2,
|
||||
/// <summary>
|
||||
/// SCSI device (or USB-MSC, SBP2, FC, UAS, etc)
|
||||
/// </summary>
|
||||
/// <summary>SCSI device (or USB-MSC, SBP2, FC, UAS, etc)</summary>
|
||||
SCSI = 3,
|
||||
/// <summary>
|
||||
/// SecureDigital memory card
|
||||
/// </summary>
|
||||
/// <summary>SecureDigital memory card</summary>
|
||||
SecureDigital = 4,
|
||||
/// <summary>
|
||||
/// MultiMediaCard memory card
|
||||
/// </summary>
|
||||
/// <summary>MultiMediaCard memory card</summary>
|
||||
MMC = 5,
|
||||
/// <summary>
|
||||
/// NVMe device
|
||||
/// </summary>
|
||||
/// <summary>NVMe device</summary>
|
||||
NVMe = 6
|
||||
}
|
||||
}
|
||||
@@ -321,9 +321,7 @@ namespace Aaru.CommonTypes.Enums
|
||||
NotFound = 0x40
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Types of floppy disks
|
||||
/// </summary>
|
||||
/// <summary>Types of floppy disks</summary>
|
||||
public enum FloppyTypes : byte
|
||||
{
|
||||
/// <summary>8" floppy</summary>
|
||||
@@ -340,9 +338,7 @@ namespace Aaru.CommonTypes.Enums
|
||||
QuickDisk
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration of floppy densities
|
||||
/// </summary>
|
||||
/// <summary>Enumeration of floppy densities</summary>
|
||||
public enum FloppyDensities : byte
|
||||
{
|
||||
/// <summary>Standard coercivity (about 300Oe as found in 8" and 5.25"-double-density disks).</summary>
|
||||
@@ -355,76 +351,43 @@ namespace Aaru.CommonTypes.Enums
|
||||
Extended
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Capabilities for optical media image formats
|
||||
/// </summary>
|
||||
/// <summary>Capabilities for optical media image formats</summary>
|
||||
[Flags]
|
||||
public enum OpticalImageCapabilities : ulong
|
||||
{
|
||||
/// <summary>
|
||||
/// Can store Red Book audio tracks?
|
||||
/// </summary>
|
||||
/// <summary>Can store Red Book audio tracks?</summary>
|
||||
CanStoreAudioTracks = 0x01,
|
||||
/// <summary>
|
||||
/// Can store CD-V analogue video tracks?
|
||||
/// </summary>
|
||||
/// <summary>Can store CD-V analogue video tracks?</summary>
|
||||
CanStoreVideoTracks = 0x02,
|
||||
/// <summary>
|
||||
/// Can store Yellow Book data tracks?
|
||||
/// </summary>
|
||||
/// <summary>Can store Yellow Book data tracks?</summary>
|
||||
CanStoreDataTracks = 0x03,
|
||||
/// <summary>
|
||||
/// Can store pregaps without needing to interpret the subchannel?
|
||||
/// </summary>
|
||||
/// <summary>Can store pregaps without needing to interpret the subchannel?</summary>
|
||||
CanStorePregaps = 0x04,
|
||||
/// <summary>
|
||||
/// Can store indexes without needing to interpret the subchannel?
|
||||
/// </summary>
|
||||
/// <summary>Can store indexes without needing to interpret the subchannel?</summary>
|
||||
CanStoreIndexes = 0x08,
|
||||
/// <summary>
|
||||
/// Can store raw P to W subchannel data?
|
||||
/// </summary>
|
||||
/// <summary>Can store raw P to W subchannel data?</summary>
|
||||
CanStoreSubchannelRw = 0x10,
|
||||
/// <summary>
|
||||
/// Can store more than one session?
|
||||
/// </summary>
|
||||
/// <summary>Can store more than one session?</summary>
|
||||
CanStoreSessions = 0x20,
|
||||
/// <summary>
|
||||
/// Can store track ISRCs without needing to interpret the subchannel?
|
||||
/// </summary>
|
||||
/// <summary>Can store track ISRCs without needing to interpret the subchannel?</summary>
|
||||
CanStoreIsrc = 0x40,
|
||||
/// <summary>
|
||||
/// Can store Lead-In's CD-TEXT?
|
||||
/// </summary>
|
||||
/// <summary>Can store Lead-In's CD-TEXT?</summary>
|
||||
CanStoreCdText = 0x80,
|
||||
/// <summary>
|
||||
/// Can store the MCN without needing to interpret the subchannel?
|
||||
/// </summary>
|
||||
/// <summary>Can store the MCN without needing to interpret the subchannel?</summary>
|
||||
CanStoreMcn = 0x100,
|
||||
/// <summary>
|
||||
/// Can store the whole 2352 bytes of a sector?
|
||||
/// </summary>
|
||||
/// <summary>Can store the whole 2352 bytes of a sector?</summary>
|
||||
CanStoreRawData = 0x200,
|
||||
/// <summary>
|
||||
/// Can store more than 1 session in media that is not CD based (DVD et al)?
|
||||
/// </summary>
|
||||
/// <summary>Can store more than 1 session in media that is not CD based (DVD et al)?</summary>
|
||||
CanStoreNotCdSessions = 0x2000,
|
||||
/// <summary>
|
||||
/// Can store more than 1 track in media that is not CD based (DVD et al)?
|
||||
/// </summary>
|
||||
/// <summary>Can store more than 1 track in media that is not CD based (DVD et al)?</summary>
|
||||
CanStoreNotCdTracks = 0x4000,
|
||||
|
||||
// TODO: Implement
|
||||
/// <summary>
|
||||
/// Can store scrambled data?
|
||||
/// </summary>
|
||||
/// <summary>Can store scrambled data?</summary>
|
||||
CanStoreScrambledData = 0x400,
|
||||
/// <summary>
|
||||
/// Can store only the user area of a sector (2048, 2324, etc)?
|
||||
/// </summary>
|
||||
/// <summary>Can store only the user area of a sector (2048, 2324, etc)?</summary>
|
||||
CanStoreCookedData = 0x800,
|
||||
/// <summary>
|
||||
/// Can store more than 1 track?
|
||||
/// </summary>
|
||||
/// <summary>Can store more than 1 track?</summary>
|
||||
CanStoreMultipleTracks = 0x1000
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(byte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -43,14 +43,10 @@ using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts extents
|
||||
/// </summary>
|
||||
/// <summary>Converts extents</summary>
|
||||
public static class ExtentsConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts unsigned long integer extents into XML based extents
|
||||
/// </summary>
|
||||
/// <summary>Converts unsigned long integer extents into XML based extents</summary>
|
||||
/// <param name="extents">Extents</param>
|
||||
/// <returns>XML based extents</returns>
|
||||
public static ExtentType[] ToMetadata(ExtentsULong extents)
|
||||
@@ -71,9 +67,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts XML based extents into unsigned long integer extents
|
||||
/// </summary>
|
||||
/// <summary>Converts XML based extents into unsigned long integer extents</summary>
|
||||
/// <param name="extents">XML based extents</param>
|
||||
/// <returns>Extents</returns>
|
||||
public static ExtentsULong FromMetadata(ExtentType[] extents)
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(int item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(long item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(sbyte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(short item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(uint item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(ulong item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to seach for</param>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(ushort item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
|
||||
@@ -46,14 +46,10 @@ using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages the known filters
|
||||
/// </summary>
|
||||
/// <summary>Manages the known filters</summary>
|
||||
public sealed class FiltersList
|
||||
{
|
||||
/// <summary>
|
||||
/// List of known filters
|
||||
/// </summary>
|
||||
/// <summary>List of known filters</summary>
|
||||
public readonly SortedDictionary<string, IFilter> Filters;
|
||||
|
||||
/// <summary>Fills the list of all known filters</summary>
|
||||
|
||||
16
Geometry.cs
16
Geometry.cs
@@ -40,14 +40,10 @@ using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles CHS geometries
|
||||
/// </summary>
|
||||
/// <summary>Handles CHS geometries</summary>
|
||||
public static class Geometry
|
||||
{
|
||||
/// <summary>
|
||||
/// List of known disk geometries
|
||||
/// </summary>
|
||||
/// <summary>List of known disk geometries</summary>
|
||||
public static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
|
||||
encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries =
|
||||
{
|
||||
@@ -122,9 +118,7 @@ namespace Aaru.CommonTypes
|
||||
(1024, 2, 32, 512, MediaEncoding.MFM, false, MediaType.FD32MB)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets the media type for a given geometry
|
||||
/// </summary>
|
||||
/// <summary>Gets the media type for a given geometry</summary>
|
||||
/// <param name="geometry">Geometry</param>
|
||||
/// <returns>Media type</returns>
|
||||
public static MediaType GetMediaType(
|
||||
@@ -139,9 +133,7 @@ namespace Aaru.CommonTypes
|
||||
geometry.variableSectorsPerTrack select geom.type).
|
||||
FirstOrDefault();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the geometry for a given media type
|
||||
/// </summary>
|
||||
/// <summary>Gets the geometry for a given media type</summary>
|
||||
/// <param name="mediaType">Media type</param>
|
||||
/// <returns>Geometry</returns>
|
||||
public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding
|
||||
|
||||
@@ -39,9 +39,7 @@ using System.IO;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Supported archive features
|
||||
/// </summary>
|
||||
/// <summary>Supported archive features</summary>
|
||||
[Flags]
|
||||
public enum ArchiveSupportedFeature : uint
|
||||
{
|
||||
@@ -71,9 +69,7 @@ namespace Aaru.CommonTypes.Interfaces
|
||||
SupportsXAttrs = 1 << 6
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the interface to handle an archive (e.g. ZIP, WAD, etc)
|
||||
/// </summary>
|
||||
/// <summary>Defines the interface to handle an archive (e.g. ZIP, WAD, etc)</summary>
|
||||
public interface IArchive
|
||||
{
|
||||
/// <summary>Descriptive name of the plugin</summary>
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the interface to implement a checksum or hashing algorithm
|
||||
/// </summary>
|
||||
/// <summary>Defines the interface to implement a checksum or hashing algorithm</summary>
|
||||
public interface IChecksum
|
||||
{
|
||||
/// <summary>Updates the hash with data.</summary>
|
||||
|
||||
@@ -45,9 +45,7 @@ namespace Aaru.CommonTypes.Interfaces
|
||||
/// <summary>Interface to implement filesystem plugins.</summary>
|
||||
public interface IFilesystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the encoding used to interpret strings in the filesystem
|
||||
/// </summary>
|
||||
/// <summary>Defines the encoding used to interpret strings in the filesystem</summary>
|
||||
Encoding Encoding { get; }
|
||||
/// <summary>Plugin name.</summary>
|
||||
string Name { get; }
|
||||
|
||||
@@ -42,8 +42,8 @@ using System.IO;
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g. GZIP),
|
||||
/// or a container (e.g. AppleDouble)
|
||||
/// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g.
|
||||
/// GZIP), or a container (e.g. AppleDouble)
|
||||
/// </summary>
|
||||
public interface IFilter
|
||||
{
|
||||
|
||||
@@ -41,9 +41,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an image that can contain partitions
|
||||
/// </summary>
|
||||
/// <summary>Defines an image that can contain partitions</summary>
|
||||
public interface IPartitionableMediaImage
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -41,9 +41,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a register of all known plugins
|
||||
/// </summary>
|
||||
/// <summary>Defines a register of all known plugins</summary>
|
||||
public interface IPluginRegister
|
||||
{
|
||||
/// <summary>Gets all checksum plugins</summary>
|
||||
|
||||
@@ -45,17 +45,13 @@ using Aaru.CommonTypes.Structs;
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Defines the interface to implement reading the contents of a filesystem
|
||||
/// </summary>
|
||||
/// <summary>Defines the interface to implement reading the contents of a filesystem</summary>
|
||||
public interface IReadOnlyFilesystem : IFilesystem
|
||||
{
|
||||
/// <summary>Retrieves a list of options supported by the filesystem, with name, type and description</summary>
|
||||
IEnumerable<(string name, Type type, string description)> SupportedOptions { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Supported namespaces
|
||||
/// </summary>
|
||||
/// <summary>Supported namespaces</summary>
|
||||
Dictionary<string, string> Namespaces { get; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -43,9 +43,7 @@ using Aaru.CommonTypes.Structs;
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Defines an image that can store the information from streaming, digital, tapes
|
||||
/// </summary>
|
||||
/// <summary>Defines an image that can store the information from streaming, digital, tapes</summary>
|
||||
public interface ITapeImage : IMediaImage
|
||||
{
|
||||
/// <summary>Gets a list of all the files registered in the image</summary>
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an image that can verify the integrity of the image itself, but not its contents
|
||||
/// </summary>
|
||||
/// <summary>Defines an image that can verify the integrity of the image itself, but not its contents</summary>
|
||||
public interface IVerifiableImage
|
||||
{
|
||||
/// <summary>Verifies media image internal checksum.</summary>
|
||||
|
||||
@@ -41,9 +41,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an image that can verify the integrity of the sectors it contains
|
||||
/// </summary>
|
||||
/// <summary>Defines an image that can verify the integrity of the sectors it contains</summary>
|
||||
public interface IVerifiableSectorsImage
|
||||
{
|
||||
/// <summary>Verifies a sector.</summary>
|
||||
|
||||
@@ -62,13 +62,9 @@ namespace Aaru.CommonTypes.Interfaces
|
||||
/// <summary>Gets a list of known extensions for format auto-choosing</summary>
|
||||
IEnumerable<string> KnownExtensions { get; }
|
||||
|
||||
/// <summary>
|
||||
/// If set to <c>true</c> means the image is opened for writing
|
||||
/// </summary>
|
||||
/// <summary>If set to <c>true</c> means the image is opened for writing</summary>
|
||||
bool IsWriting { get; }
|
||||
/// <summary>
|
||||
/// Contains a description of the last error
|
||||
/// </summary>
|
||||
/// <summary>Contains a description of the last error</summary>
|
||||
string ErrorMessage { get; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -42,14 +42,10 @@ using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an image that is writable and can store an optical disc (CD, DVD, etc)
|
||||
/// </summary>
|
||||
/// <summary>Defines an image that is writable and can store an optical disc (CD, DVD, etc)</summary>
|
||||
public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage
|
||||
{
|
||||
/// <summary>
|
||||
/// Image format capabilities
|
||||
/// </summary>
|
||||
/// <summary>Image format capabilities</summary>
|
||||
OpticalImageCapabilities OpticalCapabilities { get; }
|
||||
|
||||
/// <summary>Sets tracks for optical media</summary>
|
||||
|
||||
@@ -41,9 +41,7 @@ using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an image that is writable and can store information about a streaming, digital, tape
|
||||
/// </summary>
|
||||
/// <summary>Defines an image that is writable and can store information about a streaming, digital, tape</summary>
|
||||
public interface IWritableTapeImage : ITapeImage, IWritableImage
|
||||
{
|
||||
/// <summary>Registers a new file in the image</summary>
|
||||
|
||||
@@ -44,29 +44,19 @@ using System.Security.Principal;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop
|
||||
{
|
||||
/// <summary>
|
||||
/// Detects the underlying execution framework and operating system
|
||||
/// </summary>
|
||||
/// <summary>Detects the underlying execution framework and operating system</summary>
|
||||
public static class DetectOS
|
||||
{
|
||||
/// <summary>
|
||||
/// Are we running under Mono?
|
||||
/// </summary>
|
||||
/// <summary>Are we running under Mono?</summary>
|
||||
public static readonly bool IsMono =
|
||||
RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal);
|
||||
/// <summary>
|
||||
/// Are we running under .NET Framework?
|
||||
/// </summary>
|
||||
/// <summary>Are we running under .NET Framework?</summary>
|
||||
public static readonly bool IsNetFramework =
|
||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal);
|
||||
/// <summary>
|
||||
/// Are we running under .NET Core?
|
||||
/// </summary>
|
||||
/// <summary>Are we running under .NET Core?</summary>
|
||||
public static readonly bool IsNetCore =
|
||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal);
|
||||
/// <summary>
|
||||
/// Are we running under .NET Native?
|
||||
/// </summary>
|
||||
/// <summary>Are we running under .NET Native?</summary>
|
||||
public static readonly bool IsNetNative =
|
||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal);
|
||||
|
||||
@@ -76,9 +66,7 @@ namespace Aaru.CommonTypes.Interop
|
||||
/// <summary>Checks if the underlying runtime runs in 32-bit mode</summary>
|
||||
public static readonly bool Is32Bit = IntPtr.Size == 4;
|
||||
|
||||
/// <summary>
|
||||
/// Are we running under Windows?
|
||||
/// </summary>
|
||||
/// <summary>Are we running under Windows?</summary>
|
||||
public static bool IsWindows => GetRealPlatformID() == PlatformID.Win32NT ||
|
||||
GetRealPlatformID() == PlatformID.Win32S ||
|
||||
GetRealPlatformID() == PlatformID.Win32Windows ||
|
||||
@@ -86,9 +74,7 @@ namespace Aaru.CommonTypes.Interop
|
||||
GetRealPlatformID() == PlatformID.WindowsPhone ||
|
||||
GetRealPlatformID() == PlatformID.Xbox;
|
||||
|
||||
/// <summary>
|
||||
/// Are we running with administrative (root) privileges?
|
||||
/// </summary>
|
||||
/// <summary>Are we running with administrative (root) privileges?</summary>
|
||||
public static bool IsAdmin
|
||||
{
|
||||
get
|
||||
|
||||
@@ -42,18 +42,14 @@ using System.Runtime;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets our own, or the runtime's version
|
||||
/// </summary>
|
||||
/// <summary>Gets our own, or the runtime's version</summary>
|
||||
public static class Version
|
||||
{
|
||||
/// <summary>Gets version string</summary>
|
||||
/// <returns>Version</returns>
|
||||
public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString();
|
||||
|
||||
/// <summary>
|
||||
/// Gets .NET Core version
|
||||
/// </summary>
|
||||
/// <summary>Gets .NET Core version</summary>
|
||||
/// <returns>Version</returns>
|
||||
public static string GetNetCoreVersion()
|
||||
{
|
||||
@@ -76,9 +72,7 @@ namespace Aaru.CommonTypes.Interop
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Mono version
|
||||
/// </summary>
|
||||
/// <summary>Gets Mono version</summary>
|
||||
/// <returns>Version</returns>
|
||||
public static string GetMonoVersion()
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
// TODO: Rename contents
|
||||
|
||||
using System;
|
||||
|
||||
#pragma warning disable 1591
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
@@ -38,9 +38,7 @@ namespace Aaru.CommonTypes
|
||||
{
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the media type from an ATA (not ATAPI) device
|
||||
/// </summary>
|
||||
/// <summary>Gets the media type from an ATA (not ATAPI) device</summary>
|
||||
/// <param name="manufacturer">Manufacturer string</param>
|
||||
/// <param name="model">Model string</param>
|
||||
/// <param name="removable">Is the device removable?</param>
|
||||
|
||||
@@ -37,14 +37,10 @@ using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the media type from a real device
|
||||
/// </summary>
|
||||
/// <summary>Gets the media type from a real device</summary>
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the media type from an SCSI MultiMedia Commands compliant device
|
||||
/// </summary>
|
||||
/// <summary>Gets the media type from an SCSI MultiMedia Commands compliant device</summary>
|
||||
/// <param name="model">Model string</param>
|
||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||
/// <param name="densityCode">Density code from MODE SENSE</param>
|
||||
|
||||
@@ -38,9 +38,7 @@ namespace Aaru.CommonTypes
|
||||
{
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the device type from a SCSI Optical Device
|
||||
/// </summary>
|
||||
/// <summary>Gets the device type from a SCSI Optical Device</summary>
|
||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||
/// <param name="blocks">Number of blocks in device</param>
|
||||
/// <param name="blockSize">Size in bytes of a block</param>
|
||||
|
||||
@@ -39,9 +39,7 @@ namespace Aaru.CommonTypes
|
||||
{
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the media type from a SCSI Block Commands compliant device
|
||||
/// </summary>
|
||||
/// <summary>Gets the media type from a SCSI Block Commands compliant device</summary>
|
||||
/// <param name="vendor">Vendor string</param>
|
||||
/// <param name="model">Model string</param>
|
||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||
|
||||
@@ -39,9 +39,7 @@ namespace Aaru.CommonTypes
|
||||
{
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the media type from an SCSI Streaming Commands compliant device
|
||||
/// </summary>
|
||||
/// <summary>Gets the media type from an SCSI Streaming Commands compliant device</summary>
|
||||
/// <param name="scsiPeripheralType">Peripheral type</param>
|
||||
/// <param name="vendor">Vendor string</param>
|
||||
/// <param name="model">Model string</param>
|
||||
|
||||
@@ -40,30 +40,18 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes CD reading offset
|
||||
/// </summary>
|
||||
/// <summary>Describes CD reading offset</summary>
|
||||
public class CdOffset
|
||||
{
|
||||
/// <summary>
|
||||
/// Drive manufacturer
|
||||
/// </summary>
|
||||
/// <summary>Drive manufacturer</summary>
|
||||
public string Manufacturer { get; set; }
|
||||
/// <summary>
|
||||
/// Drive model
|
||||
/// </summary>
|
||||
/// <summary>Drive model</summary>
|
||||
public string Model { get; set; }
|
||||
/// <summary>
|
||||
/// Reading offset
|
||||
/// </summary>
|
||||
/// <summary>Reading offset</summary>
|
||||
public short Offset { get; set; }
|
||||
/// <summary>
|
||||
/// Number of times this offset has been submitted
|
||||
/// </summary>
|
||||
/// <summary>Number of times this offset has been submitted</summary>
|
||||
public int Submissions { get; set; }
|
||||
/// <summary>
|
||||
/// Percentage of submissions in agreement with this offset
|
||||
/// </summary>
|
||||
/// <summary>Percentage of submissions in agreement with this offset</summary>
|
||||
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:P0}")]
|
||||
public float Agreement { get; set; }
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// This is obsolete
|
||||
#pragma warning disable 1591
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// TODO: Re-enable CS1591 in this file
|
||||
#pragma warning disable 1591
|
||||
|
||||
|
||||
@@ -42,14 +42,10 @@ using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Physical dimensions for media types
|
||||
/// </summary>
|
||||
/// <summary>Physical dimensions for media types</summary>
|
||||
public static class Dimensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the physical dimensions, in metadata expected format, for a given media type
|
||||
/// </summary>
|
||||
/// <summary>Gets the physical dimensions, in metadata expected format, for a given media type</summary>
|
||||
/// <param name="dskType">Media type</param>
|
||||
/// <returns>Dimensions metadata</returns>
|
||||
public static DimensionsType DimensionsFromMediaType(CommonTypes.MediaType dskType)
|
||||
|
||||
@@ -39,14 +39,10 @@
|
||||
#pragma warning disable 612
|
||||
namespace Aaru.CommonTypes.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles media type for metadata
|
||||
/// </summary>
|
||||
/// <summary>Handles media type for metadata</summary>
|
||||
public static class MediaType
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a media type of a pair of type and subtype strings to use in metadata
|
||||
/// </summary>
|
||||
/// <summary>Converts a media type of a pair of type and subtype strings to use in metadata</summary>
|
||||
/// <param name="dskType">Media type</param>
|
||||
/// <returns>Media type and subtype for metadata</returns>
|
||||
public static (string type, string subType) MediaTypeToString(CommonTypes.MediaType dskType)
|
||||
|
||||
@@ -43,61 +43,37 @@ using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Information that allows to resume a dump
|
||||
/// </summary>
|
||||
/// <summary>Information that allows to resume a dump</summary>
|
||||
[Serializable, XmlRoot("DicResume", Namespace = "", IsNullable = false)]
|
||||
public class Resume
|
||||
{
|
||||
/// <summary>
|
||||
/// List of blocks that returned an error on reading
|
||||
/// </summary>
|
||||
/// <summary>List of blocks that returned an error on reading</summary>
|
||||
[XmlArrayItem("Block")]
|
||||
public List<ulong> BadBlocks;
|
||||
/// <summary>
|
||||
/// Date/time this resume file was created
|
||||
/// </summary>
|
||||
/// <summary>Date/time this resume file was created</summary>
|
||||
[XmlElement(DataType = "dateTime")]
|
||||
public DateTime CreationDate;
|
||||
/// <summary>
|
||||
/// Last block on media
|
||||
/// </summary>
|
||||
/// <summary>Last block on media</summary>
|
||||
public ulong LastBlock;
|
||||
/// <summary>
|
||||
/// Date/time this resume file was last written to
|
||||
/// </summary>
|
||||
/// <summary>Date/time this resume file was last written to</summary>
|
||||
[XmlElement(DataType = "dateTime")]
|
||||
public DateTime LastWriteDate;
|
||||
/// <summary>
|
||||
/// Next block to read
|
||||
/// </summary>
|
||||
/// <summary>Next block to read</summary>
|
||||
public ulong NextBlock;
|
||||
/// <summary>
|
||||
/// Is media removable?
|
||||
/// </summary>
|
||||
/// <summary>Is media removable?</summary>
|
||||
public bool Removable;
|
||||
/// <summary>
|
||||
/// Is media a tape?
|
||||
/// </summary>
|
||||
/// <summary>Is media a tape?</summary>
|
||||
public bool Tape;
|
||||
/// <summary>
|
||||
/// List of CD subchannels that did not read correctly
|
||||
/// </summary>
|
||||
/// <summary>List of CD subchannels that did not read correctly</summary>
|
||||
[XmlArrayItem("Block")]
|
||||
public List<int> BadSubchannels;
|
||||
/// <summary>
|
||||
/// Extents of BLANK sectors for magneto-opticals
|
||||
/// </summary>
|
||||
/// <summary>Extents of BLANK sectors for magneto-opticals</summary>
|
||||
[XmlArrayItem("Extent")]
|
||||
public ExtentType[] BlankExtents;
|
||||
/// <summary>
|
||||
/// Title keys that has not been read
|
||||
/// </summary>
|
||||
/// <summary>Title keys that has not been read</summary>
|
||||
[XmlArrayItem("Block")]
|
||||
public List<ulong> MissingTitleKeys;
|
||||
/// <summary>
|
||||
/// List of dump tries
|
||||
/// </summary>
|
||||
/// <summary>List of dump tries</summary>
|
||||
[XmlArrayItem("DumpTry")]
|
||||
public List<DumpHardwareType> Tries;
|
||||
}
|
||||
|
||||
@@ -39,14 +39,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Statistics
|
||||
/// </summary>
|
||||
/// <summary>Statistics</summary>
|
||||
[XmlRoot("DicStats", Namespace = "", IsNullable = false)]
|
||||
public class Stats
|
||||
{
|
||||
@@ -84,9 +83,7 @@ namespace Aaru.CommonTypes.Metadata
|
||||
public VerifyStats Verify { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO for statistics
|
||||
/// </summary>
|
||||
/// <summary>DTO for statistics</summary>
|
||||
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
||||
public class StatsDto
|
||||
{
|
||||
@@ -116,9 +113,7 @@ namespace Aaru.CommonTypes.Metadata
|
||||
public List<OsStats> RemoteOperatingSystems { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Command execution statistics
|
||||
/// </summary>
|
||||
/// <summary>Command execution statistics</summary>
|
||||
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
public class CommandsStats
|
||||
{
|
||||
@@ -175,47 +170,29 @@ namespace Aaru.CommonTypes.Metadata
|
||||
public long Failed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verification statistics
|
||||
/// </summary>
|
||||
/// <summary>Verification statistics</summary>
|
||||
public class VerifyStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Image verification statistics
|
||||
/// </summary>
|
||||
/// <summary>Image verification statistics</summary>
|
||||
public VerifiedItems MediaImages;
|
||||
/// <summary>
|
||||
/// Image contents verification statistics
|
||||
/// </summary>
|
||||
/// <summary>Image contents verification statistics</summary>
|
||||
public ScannedSectors Sectors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Image contents verification statistics
|
||||
/// </summary>
|
||||
/// <summary>Image contents verification statistics</summary>
|
||||
public class ScannedSectors
|
||||
{
|
||||
/// <summary>
|
||||
/// Sectors found to be correct
|
||||
/// </summary>
|
||||
/// <summary>Sectors found to be correct</summary>
|
||||
public long Correct;
|
||||
/// <summary>
|
||||
/// Sectors found to be incorrect
|
||||
/// </summary>
|
||||
/// <summary>Sectors found to be incorrect</summary>
|
||||
public long Error;
|
||||
/// <summary>
|
||||
/// Total number of verified sectors
|
||||
/// </summary>
|
||||
/// <summary>Total number of verified sectors</summary>
|
||||
public long Total;
|
||||
/// <summary>
|
||||
/// Total number of sectors that could not be verified
|
||||
/// </summary>
|
||||
/// <summary>Total number of sectors that could not be verified</summary>
|
||||
public long Unverifiable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Media scanning time statistics
|
||||
/// </summary>
|
||||
/// <summary>Media scanning time statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class TimeStats
|
||||
{
|
||||
@@ -233,159 +210,99 @@ namespace Aaru.CommonTypes.Metadata
|
||||
public long MoreThan500ms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Media scanning statistics
|
||||
/// </summary>
|
||||
/// <summary>Media scanning statistics</summary>
|
||||
public class MediaScanStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Statistics of scanned sectors
|
||||
/// </summary>
|
||||
/// <summary>Statistics of scanned sectors</summary>
|
||||
public ScannedSectors Sectors;
|
||||
/// <summary>
|
||||
/// Scan time statistics
|
||||
/// </summary>
|
||||
/// <summary>Scan time statistics</summary>
|
||||
public TimeStats Times;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checksum type statistics
|
||||
/// </summary>
|
||||
/// <summary>Checksum type statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ChecksumStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Checksum algorithm
|
||||
/// </summary>
|
||||
/// <summary>Checksum algorithm</summary>
|
||||
[XmlAttribute]
|
||||
public string algorithm;
|
||||
/// <summary>
|
||||
/// Time taken to execute algorithm
|
||||
/// </summary>
|
||||
/// <summary>Time taken to execute algorithm</summary>
|
||||
[XmlText]
|
||||
public double Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Benchmark statistics
|
||||
/// </summary>
|
||||
/// <summary>Benchmark statistics</summary>
|
||||
public class BenchmarkStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Total time taken to run the checksum algorithms in parallel
|
||||
/// </summary>
|
||||
/// <summary>Total time taken to run the checksum algorithms in parallel</summary>
|
||||
public double All;
|
||||
/// <summary>
|
||||
/// List of time taken by each checksum algorithm
|
||||
/// </summary>
|
||||
/// <summary>List of time taken by each checksum algorithm</summary>
|
||||
[XmlElement("Checksum")]
|
||||
public List<ChecksumStats> Checksum;
|
||||
/// <summary>
|
||||
/// Time taken to benchmark entropy calculation
|
||||
/// </summary>
|
||||
/// <summary>Time taken to benchmark entropy calculation</summary>
|
||||
public double Entropy;
|
||||
/// <summary>
|
||||
/// Maximum amount of memory used while running the benchmark
|
||||
/// </summary>
|
||||
/// <summary>Maximum amount of memory used while running the benchmark</summary>
|
||||
public long MaxMemory;
|
||||
/// <summary>
|
||||
/// Minimum amount of memory used while running the benchmark
|
||||
/// </summary>
|
||||
/// <summary>Minimum amount of memory used while running the benchmark</summary>
|
||||
public long MinMemory;
|
||||
/// <summary>
|
||||
/// Total time taken to run the checksum algorithms sequentially
|
||||
/// </summary>
|
||||
/// <summary>Total time taken to run the checksum algorithms sequentially</summary>
|
||||
public double Sequential;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Media statistics
|
||||
/// </summary>
|
||||
/// <summary>Media statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class MediaStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Found in a real device?
|
||||
/// </summary>
|
||||
/// <summary>Found in a real device?</summary>
|
||||
[XmlAttribute]
|
||||
public bool real;
|
||||
/// <summary>
|
||||
/// Media type
|
||||
/// </summary>
|
||||
/// <summary>Media type</summary>
|
||||
[XmlAttribute]
|
||||
public string type;
|
||||
/// <summary>
|
||||
/// Number of times it has been found
|
||||
/// </summary>
|
||||
/// <summary>Number of times it has been found</summary>
|
||||
[XmlText]
|
||||
public long Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Device statistics
|
||||
/// </summary>
|
||||
/// <summary>Device statistics</summary>
|
||||
public class DeviceStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Is manufacturer null?
|
||||
/// </summary>
|
||||
/// <summary>Is manufacturer null?</summary>
|
||||
[XmlIgnore]
|
||||
public bool ManufacturerSpecified;
|
||||
/// <summary>
|
||||
/// Manufacturer string
|
||||
/// </summary>
|
||||
/// <summary>Manufacturer string</summary>
|
||||
public string Manufacturer { get; set; }
|
||||
/// <summary>
|
||||
/// Model string
|
||||
/// </summary>
|
||||
/// <summary>Model string</summary>
|
||||
public string Model { get; set; }
|
||||
/// <summary>
|
||||
/// Revision or firmware version
|
||||
/// </summary>
|
||||
/// <summary>Revision or firmware version</summary>
|
||||
public string Revision { get; set; }
|
||||
/// <summary>
|
||||
/// Bus the device was attached to
|
||||
/// </summary>
|
||||
/// <summary>Bus the device was attached to</summary>
|
||||
public string Bus { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Name=value pair statistics
|
||||
/// </summary>
|
||||
/// <summary>Name=value pair statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class NameValueStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Name
|
||||
/// </summary>
|
||||
/// <summary>Name</summary>
|
||||
[XmlAttribute]
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
/// Number of times it has been used/found
|
||||
/// </summary>
|
||||
/// <summary>Number of times it has been used/found</summary>
|
||||
[XmlText]
|
||||
public long Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Operating system statistics
|
||||
/// </summary>
|
||||
/// <summary>Operating system statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class OsStats
|
||||
{
|
||||
/// <summary>
|
||||
/// Operating system name
|
||||
/// </summary>
|
||||
/// <summary>Operating system name</summary>
|
||||
[XmlAttribute]
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
/// Operating system version
|
||||
/// </summary>
|
||||
/// <summary>Operating system version</summary>
|
||||
[XmlAttribute]
|
||||
public string version { get; set; }
|
||||
/// <summary>
|
||||
/// Number of times Aaru run on it
|
||||
/// </summary>
|
||||
/// <summary>Number of times Aaru run on it</summary>
|
||||
[XmlText]
|
||||
public long Value { get; set; }
|
||||
}
|
||||
|
||||
@@ -41,9 +41,7 @@ using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages Aaru's version for metadata
|
||||
/// </summary>
|
||||
/// <summary>Manages Aaru's version for metadata</summary>
|
||||
public static class Version
|
||||
{
|
||||
/// <summary>Gets XML software type for the running version</summary>
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace Aaru.CommonTypes
|
||||
public override bool Equals(object obj) => obj is Partition partition && Equals(partition);
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
// ReSharper disable once NonReadonlyMemberInGetHashCode
|
||||
public override int GetHashCode() => Start.GetHashCode() + End.GetHashCode();
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace Aaru.CommonTypes
|
||||
/// <summary>Contain all plugins (filesystem, partition and image)</summary>
|
||||
public class PluginBase
|
||||
{
|
||||
/// <summary>List of all archive formats</summary>
|
||||
public readonly SortedDictionary<string, IArchive> Archives;
|
||||
/// <summary>List of checksum plugins</summary>
|
||||
public readonly List<IChecksum> Checksums;
|
||||
/// <summary>List of filter plugins</summary>
|
||||
@@ -64,8 +66,6 @@ namespace Aaru.CommonTypes
|
||||
public readonly SortedDictionary<string, IWritableFloppyImage> WritableFloppyImages;
|
||||
/// <summary>List of writable media image plugins</summary>
|
||||
public readonly SortedDictionary<string, IWritableImage> WritableImages;
|
||||
/// <summary>List of all archive formats</summary>
|
||||
public readonly SortedDictionary<string, IArchive> Archives;
|
||||
|
||||
/// <summary>Initializes the plugins lists</summary>
|
||||
public PluginBase()
|
||||
@@ -82,9 +82,7 @@ namespace Aaru.CommonTypes
|
||||
Archives = new SortedDictionary<string, IArchive>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds plugins to the central plugin register
|
||||
/// </summary>
|
||||
/// <summary>Adds plugins to the central plugin register</summary>
|
||||
/// <param name="pluginRegister">Plugin register</param>
|
||||
public void AddPlugins(IPluginRegister pluginRegister)
|
||||
{
|
||||
|
||||
@@ -327,9 +327,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
ZonedBit0 = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data set management flag bits.
|
||||
/// </summary>
|
||||
/// <summary>Data set management flag bits.</summary>
|
||||
[Flags]
|
||||
public enum DataSetMgmtBit : ushort
|
||||
{
|
||||
@@ -344,9 +342,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
Trim = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Device form factor
|
||||
/// </summary>
|
||||
/// <summary>Device form factor</summary>
|
||||
public enum DeviceFormFactorEnum : ushort
|
||||
{
|
||||
/// <summary>Size not reported</summary>
|
||||
@@ -460,9 +456,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
#pragma warning restore 1591
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SATA capabilities flags
|
||||
/// </summary>
|
||||
/// <summary>SATA capabilities flags</summary>
|
||||
[Flags]
|
||||
public enum SATACapabilitiesBit : ushort
|
||||
{
|
||||
@@ -496,9 +490,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
Clear = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// More SATA capabilities flags
|
||||
/// </summary>
|
||||
/// <summary>More SATA capabilities flags</summary>
|
||||
[Flags]
|
||||
public enum SATACapabilitiesBit2 : ushort
|
||||
{
|
||||
@@ -527,9 +519,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
Clear = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SATA features flags
|
||||
/// </summary>
|
||||
/// <summary>SATA features flags</summary>
|
||||
[Flags]
|
||||
public enum SATAFeaturesBit : ushort
|
||||
{
|
||||
@@ -560,9 +550,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
Clear = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SCT Command Transport flags
|
||||
/// </summary>
|
||||
/// <summary>SCT Command Transport flags</summary>
|
||||
[Flags]
|
||||
public enum SCTCommandTransportBit : ushort
|
||||
{
|
||||
@@ -614,9 +602,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
Supported = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specific configuration flags
|
||||
/// </summary>
|
||||
/// <summary>Specific configuration flags</summary>
|
||||
public enum SpecificConfigurationEnum : ushort
|
||||
{
|
||||
/// <summary>Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete</summary>
|
||||
@@ -629,9 +615,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
NotRequiresSetCompleteResponse = 0xC837
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transfer mode flags
|
||||
/// </summary>
|
||||
/// <summary>Transfer mode flags</summary>
|
||||
[Flags]
|
||||
public enum TransferMode : byte
|
||||
{
|
||||
@@ -642,9 +626,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
#pragma warning restore 1591
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trusted Computing flags
|
||||
/// </summary>
|
||||
/// <summary>Trusted Computing flags</summary>
|
||||
[Flags]
|
||||
public enum TrustedComputingBit : ushort
|
||||
{
|
||||
@@ -663,9 +645,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
TrustedComputing = 0x0001
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IDENTIFY DEVICE decoded response
|
||||
/// </summary>
|
||||
/// <summary>IDENTIFY DEVICE decoded response</summary>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
|
||||
public struct IdentifyDevice
|
||||
{
|
||||
@@ -1017,9 +997,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
public byte Checksum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a raw IDENTIFY DEVICE response
|
||||
/// </summary>
|
||||
/// <summary>Decodes a raw IDENTIFY DEVICE response</summary>
|
||||
/// <param name="IdentifyDeviceResponse">Raw IDENTIFY DEVICE response</param>
|
||||
/// <returns>Decoded IDENTIFY DEVICE</returns>
|
||||
public static IdentifyDevice? Decode(byte[] IdentifyDeviceResponse)
|
||||
@@ -1050,9 +1028,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
||||
return ATAID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes a raw IDENTIFY DEVICE response
|
||||
/// </summary>
|
||||
/// <summary>Encodes a raw IDENTIFY DEVICE response</summary>
|
||||
/// <param name="identify">Decoded IDENTIFY DEVICE</param>
|
||||
/// <returns>Raw IDENTIFY DEVICE response</returns>
|
||||
public static byte[] Encode(IdentifyDevice? identify)
|
||||
|
||||
@@ -34,9 +34,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
{
|
||||
/// <summary>
|
||||
/// List of known SCSI peripheral qualifiers
|
||||
/// </summary>
|
||||
/// <summary>List of known SCSI peripheral qualifiers</summary>
|
||||
public enum PeripheralQualifiers : byte
|
||||
{
|
||||
/// <summary>Peripheral qualifier: Device is connected and supported</summary>
|
||||
@@ -51,9 +49,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
VendorMask = 0x04
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known peripheral device types
|
||||
/// </summary>
|
||||
/// <summary>List of known peripheral device types</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum PeripheralDeviceTypes : byte
|
||||
{
|
||||
@@ -105,9 +101,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
UnknownDevice = 0x1F
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known ANSI SCSI standards
|
||||
/// </summary>
|
||||
/// <summary>List of known ANSI SCSI standards</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ANSIVersions : byte
|
||||
{
|
||||
@@ -127,9 +121,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
ANSI2008Version = 0x06
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known ECMA SCSI standards
|
||||
/// </summary>
|
||||
/// <summary>List of known ECMA SCSI standards</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ECMAVersions : byte
|
||||
{
|
||||
@@ -139,9 +131,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
ECMA111 = 0x01
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known ISO SCSI standards
|
||||
/// </summary>
|
||||
/// <summary>List of known ISO SCSI standards</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ISOVersions : byte
|
||||
{
|
||||
@@ -151,9 +141,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
ISO1995Version = 0x02
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known SCSI Parallel Interface clocking types
|
||||
/// </summary>
|
||||
/// <summary>List of known SCSI Parallel Interface clocking types</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum SPIClocking : byte
|
||||
{
|
||||
@@ -167,9 +155,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
STandDT = 0x03
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known TGPS values
|
||||
/// </summary>
|
||||
/// <summary>List of known TGPS values</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum TGPSValues : byte
|
||||
{
|
||||
@@ -183,9 +169,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
Both = 0x03
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known SCSI protocols
|
||||
/// </summary>
|
||||
/// <summary>List of known SCSI protocols</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ProtocolIdentifiers : byte
|
||||
{
|
||||
@@ -217,37 +201,23 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
NoProtocol = 15
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known SCSI definitions
|
||||
/// </summary>
|
||||
/// <summary>List of known SCSI definitions</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ScsiDefinitions : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
/// <summary>Unknown</summary>
|
||||
Current = 0,
|
||||
/// <summary>
|
||||
/// SCSI-1
|
||||
/// </summary>
|
||||
/// <summary>SCSI-1</summary>
|
||||
SCSI1 = 1,
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
/// <summary>Unknown</summary>
|
||||
CCS = 2,
|
||||
/// <summary>
|
||||
/// SCSI-2
|
||||
/// </summary>
|
||||
/// <summary>SCSI-2</summary>
|
||||
SCSI2 = 3,
|
||||
/// <summary>
|
||||
/// SCSI-3
|
||||
/// </summary>
|
||||
/// <summary>SCSI-3</summary>
|
||||
SCSI3 = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of known SCSI physical interfaces
|
||||
/// </summary>
|
||||
/// <summary>List of known SCSI physical interfaces</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum PhysicalInterfaces : uint
|
||||
{
|
||||
|
||||
@@ -251,9 +251,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
0x48, 0x69, 0x2D, 0x4D, 0x44, 0x20, 0x20, 0x20
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a SCSI INQUIRY response
|
||||
/// </summary>
|
||||
/// <summary>Decodes a SCSI INQUIRY response</summary>
|
||||
/// <param name="SCSIInquiryResponse">INQUIRY raw response data</param>
|
||||
/// <returns>Decoded SCSI INQUIRY</returns>
|
||||
#region Public methods
|
||||
@@ -513,9 +511,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||
return decoded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes a SCSI INQUIRY response
|
||||
/// </summary>
|
||||
/// <summary>Encodes a SCSI INQUIRY response</summary>
|
||||
/// <param name="inq">Decoded SCSI INQUIRY</param>
|
||||
/// <returns>Raw SCSI INQUIRY response</returns>
|
||||
public static byte[] Encode(Inquiry? inq)
|
||||
|
||||
@@ -46,9 +46,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public class ModePage_2A
|
||||
{
|
||||
/// <summary>
|
||||
/// Write speed performance descriptors
|
||||
/// </summary>
|
||||
/// <summary>Write speed performance descriptors</summary>
|
||||
public ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors;
|
||||
/// <summary>Parameters can be saved</summary>
|
||||
public bool PS { get; set; }
|
||||
@@ -97,133 +95,74 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
||||
/// <summary>Current drive speed in Kbytes/second</summary>
|
||||
public ushort CurrentSpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Can read packet media
|
||||
/// </summary>
|
||||
/// <summary>Can read packet media</summary>
|
||||
public bool Method2 { get; set; }
|
||||
/// <summary>
|
||||
/// Can read CD-RW
|
||||
/// </summary>
|
||||
/// <summary>Can read CD-RW</summary>
|
||||
public bool ReadCDRW { get; set; }
|
||||
/// <summary>
|
||||
/// Can read CD-R
|
||||
/// </summary>
|
||||
/// <summary>Can read CD-R</summary>
|
||||
public bool ReadCDR { get; set; }
|
||||
/// <summary>
|
||||
/// Can write CD-RW
|
||||
/// </summary>
|
||||
/// <summary>Can write CD-RW</summary>
|
||||
public bool WriteCDRW { get; set; }
|
||||
/// <summary>
|
||||
/// Can write CD-R
|
||||
/// </summary>
|
||||
/// <summary>Can write CD-R</summary>
|
||||
public bool WriteCDR { get; set; }
|
||||
/// <summary>
|
||||
/// Supports IEC-958 digital output on port 2
|
||||
/// </summary>
|
||||
/// <summary>Supports IEC-958 digital output on port 2</summary>
|
||||
public bool DigitalPort2 { get; set; }
|
||||
/// <summary>
|
||||
/// Supports IEC-958 digital output on port 1
|
||||
/// </summary>
|
||||
/// <summary>Supports IEC-958 digital output on port 1</summary>
|
||||
public bool DigitalPort1 { get; set; }
|
||||
/// <summary>
|
||||
/// Can deliver a composite audio and video data stream
|
||||
/// </summary>
|
||||
/// <summary>Can deliver a composite audio and video data stream</summary>
|
||||
public bool Composite { get; set; }
|
||||
/// <summary>
|
||||
/// This bit controls the behavior of the LOAD/UNLOAD command when trying to load a Slot with no Disc present
|
||||
/// </summary>
|
||||
/// <summary>This bit controls the behavior of the LOAD/UNLOAD command when trying to load a Slot with no Disc present</summary>
|
||||
public bool SSS { get; set; }
|
||||
/// <summary>
|
||||
/// Contains a changer that can report the exact contents of the slots
|
||||
/// </summary>
|
||||
/// <summary>Contains a changer that can report the exact contents of the slots</summary>
|
||||
public bool SDP { get; set; }
|
||||
/// <summary>
|
||||
/// Page length
|
||||
/// </summary>
|
||||
/// <summary>Page length</summary>
|
||||
public byte Length { get; set; }
|
||||
/// <summary>
|
||||
/// Set if LSB comes first
|
||||
/// </summary>
|
||||
/// <summary>Set if LSB comes first</summary>
|
||||
public bool LSBF { get; set; }
|
||||
/// <summary>
|
||||
/// Set if HIGH on LRCK indicates left channel. Clear if HIGH on LRCK indicates right channel.
|
||||
/// </summary>
|
||||
/// <summary>Set if HIGH on LRCK indicates left channel. Clear if HIGH on LRCK indicates right channel.</summary>
|
||||
public bool RCK { get; set; }
|
||||
/// <summary>
|
||||
/// Set if data valid on the falling edge of the BCK signal. Clear if data valid on the rising edge of the BCK signal
|
||||
/// Set if data valid on the falling edge of the BCK signal. Clear if data valid on the rising edge of the BCK
|
||||
/// signal
|
||||
/// </summary>
|
||||
public bool BCK { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Can do a test write
|
||||
/// </summary>
|
||||
/// <summary>Can do a test write</summary>
|
||||
public bool TestWrite { get; set; }
|
||||
/// <summary>
|
||||
/// Maximum write speed
|
||||
/// </summary>
|
||||
/// <summary>Maximum write speed</summary>
|
||||
public ushort MaxWriteSpeed { get; set; }
|
||||
/// <summary>
|
||||
/// Current write speed
|
||||
/// </summary>
|
||||
/// <summary>Current write speed</summary>
|
||||
public ushort CurrentWriteSpeed { get; set; }
|
||||
/// <summary>
|
||||
/// Can read disc's barcode
|
||||
/// </summary>
|
||||
/// <summary>Can read disc's barcode</summary>
|
||||
public bool ReadBarcode { get; set; }
|
||||
/// <summary>
|
||||
/// Can read DVD-RAM
|
||||
/// </summary>
|
||||
/// <summary>Can read DVD-RAM</summary>
|
||||
public bool ReadDVDRAM { get; set; }
|
||||
/// <summary>
|
||||
/// Can read DVD-R
|
||||
/// </summary>
|
||||
/// <summary>Can read DVD-R</summary>
|
||||
public bool ReadDVDR { get; set; }
|
||||
/// <summary>
|
||||
/// Can read DVD-ROM
|
||||
/// </summary>
|
||||
/// <summary>Can read DVD-ROM</summary>
|
||||
public bool ReadDVDROM { get; set; }
|
||||
/// <summary>
|
||||
/// Can write DVD-RAM
|
||||
/// </summary>
|
||||
/// <summary>Can write DVD-RAM</summary>
|
||||
public bool WriteDVDRAM { get; set; }
|
||||
/// <summary>
|
||||
/// Can write DVD-R
|
||||
/// </summary>
|
||||
/// <summary>Can write DVD-R</summary>
|
||||
public bool WriteDVDR { get; set; }
|
||||
/// <summary>
|
||||
/// Can read raw R-W subchannel from the Lead-In
|
||||
/// </summary>
|
||||
/// <summary>Can read raw R-W subchannel from the Lead-In</summary>
|
||||
public bool LeadInPW { get; set; }
|
||||
/// <summary>
|
||||
/// Can read both sides of a disc
|
||||
/// </summary>
|
||||
/// <summary>Can read both sides of a disc</summary>
|
||||
public bool SCC { get; set; }
|
||||
/// <summary>
|
||||
/// Support copyright management
|
||||
/// </summary>
|
||||
/// <summary>Support copyright management</summary>
|
||||
public ushort CMRSupported { get; set; }
|
||||
/// <summary>
|
||||
/// Supports buffer under-run free recording
|
||||
/// </summary>
|
||||
/// <summary>Supports buffer under-run free recording</summary>
|
||||
public bool BUF { get; set; }
|
||||
/// <summary>
|
||||
/// Selected rotational control
|
||||
/// </summary>
|
||||
/// <summary>Selected rotational control</summary>
|
||||
public byte RotationControlSelected { get; set; }
|
||||
/// <summary>
|
||||
/// Current write speed selected
|
||||
/// </summary>
|
||||
/// <summary>Current write speed selected</summary>
|
||||
public ushort CurrentWriteSpeedSelected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Database ID
|
||||
/// </summary>
|
||||
/// <summary>Database ID</summary>
|
||||
[JsonIgnore, Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Decodes the page 2Ah of a MODE SENSE response
|
||||
/// </summary>
|
||||
/// <summary>Decodes the page 2Ah of a MODE SENSE response</summary>
|
||||
/// <param name="pageResponse">Raw page 2Ah</param>
|
||||
/// <returns>Decoded page 2Ah</returns>
|
||||
public static ModePage_2A Decode(byte[] pageResponse)
|
||||
@@ -337,9 +276,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
||||
return decoded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes a page 2Ah of a MODE SENSE response
|
||||
/// </summary>
|
||||
/// <summary>Encodes a page 2Ah of a MODE SENSE response</summary>
|
||||
/// <param name="decoded">Decoded page 2Ah</param>
|
||||
/// <returns>Raw page 2Ah</returns>
|
||||
public static byte[] Encode(ModePage_2A decoded)
|
||||
@@ -564,19 +501,13 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Page 2Ah write descriptor
|
||||
/// </summary>
|
||||
/// <summary>Page 2Ah write descriptor</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public struct ModePage_2A_WriteDescriptor
|
||||
{
|
||||
/// <summary>
|
||||
/// Rotational control
|
||||
/// </summary>
|
||||
/// <summary>Rotational control</summary>
|
||||
public byte RotationControl;
|
||||
/// <summary>
|
||||
/// Write speed
|
||||
/// </summary>
|
||||
/// <summary>Write speed</summary>
|
||||
public ushort WriteSpeed;
|
||||
}
|
||||
#endregion Mode Page 0x2A: CD-ROM capabilities page
|
||||
|
||||
@@ -227,9 +227,7 @@ namespace Aaru.CommonTypes.Structs
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Information about a volume
|
||||
/// </summary>
|
||||
/// <summary>Information about a volume</summary>
|
||||
public class FileSystemInfo
|
||||
{
|
||||
/// <summary>Blocks for this filesystem</summary>
|
||||
@@ -249,53 +247,35 @@ namespace Aaru.CommonTypes.Structs
|
||||
/// <summary>Filesystem type</summary>
|
||||
public string Type;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes an empty instance of this structure
|
||||
/// </summary>
|
||||
/// <summary>Initializes an empty instance of this structure</summary>
|
||||
public FileSystemInfo() => Id = new FileSystemId();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a clone of this structure
|
||||
/// </summary>
|
||||
/// <summary>Gets a clone of this structure</summary>
|
||||
/// <returns>Clone of this structure</returns>
|
||||
public FileSystemInfo ShallowCopy() => (FileSystemInfo)MemberwiseClone();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores a filesystem volume unique identifier or serial number
|
||||
/// </summary>
|
||||
/// <summary>Stores a filesystem volume unique identifier or serial number</summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct FileSystemId
|
||||
{
|
||||
/// <summary>
|
||||
/// Set to <c>true</c> if the identifier is a 32-bit integer
|
||||
/// </summary>
|
||||
/// <summary>Set to <c>true</c> if the identifier is a 32-bit integer</summary>
|
||||
[FieldOffset(0)]
|
||||
public bool IsInt;
|
||||
/// <summary>
|
||||
/// Set to <c>true</c> if the identifier is a 64-bit integer
|
||||
/// </summary>
|
||||
/// <summary>Set to <c>true</c> if the identifier is a 64-bit integer</summary>
|
||||
[FieldOffset(1)]
|
||||
public bool IsLong;
|
||||
/// <summary>
|
||||
/// Set to <c>true</c> if the identifier is a GUID
|
||||
/// </summary>
|
||||
/// <summary>Set to <c>true</c> if the identifier is a GUID</summary>
|
||||
[FieldOffset(2)]
|
||||
public bool IsGuid;
|
||||
|
||||
/// <summary>
|
||||
/// Identifier as a 32-bit integer
|
||||
/// </summary>
|
||||
/// <summary>Identifier as a 32-bit integer</summary>
|
||||
[FieldOffset(3)]
|
||||
public uint Serial32;
|
||||
/// <summary>
|
||||
/// Identifier as a 64-bit integer
|
||||
/// </summary>
|
||||
/// <summary>Identifier as a 64-bit integer</summary>
|
||||
[FieldOffset(3)]
|
||||
public ulong Serial64;
|
||||
/// <summary>
|
||||
/// Identifier as a GUID
|
||||
/// </summary>
|
||||
/// <summary>Identifier as a GUID</summary>
|
||||
[FieldOffset(3)]
|
||||
public Guid uuid;
|
||||
}
|
||||
|
||||
@@ -167,9 +167,7 @@ namespace Aaru.CommonTypes.Structs
|
||||
/// <summary>Partition type</summary>
|
||||
public TrackType TrackType;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes an empty instance of this structure
|
||||
/// </summary>
|
||||
/// <summary>Initializes an empty instance of this structure</summary>
|
||||
public Track() => Indexes = new Dictionary<ushort, int>();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
|
||||
namespace Aaru.CommonTypes.Structs
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a tape file
|
||||
/// </summary>
|
||||
/// <summary>Describes a tape file</summary>
|
||||
public struct TapeFile
|
||||
{
|
||||
/// <summary>File number</summary>
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
|
||||
namespace Aaru.CommonTypes.Structs
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a tape partition
|
||||
/// </summary>
|
||||
/// <summary>Describes a tape partition</summary>
|
||||
public struct TapePartition
|
||||
{
|
||||
/// <summary>Partition number</summary>
|
||||
|
||||
Reference in New Issue
Block a user