General code cleanup and style refactor.

This commit is contained in:
2022-11-15 15:58:40 +00:00
parent 2c62b0cc70
commit c4fa4e8674
60 changed files with 453 additions and 716 deletions

View File

@@ -1,131 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F2B84194-26EB-4227-B1C5-6602517E85AE}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Aaru.CommonTypes</RootNamespace>
<AssemblyName>Aaru.CommonTypes</AssemblyName>
<ReleaseVersion>$(Version)</ReleaseVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>6.0.0-alpha8</Version>
<Company>Claunia.com</Company>
<Copyright>Copyright © 2011-2022 Natalia Portillo</Copyright>
<Product>Aaru Data Preservation Suite</Product>
<Title>Aaru.CommonTypes</Title>
<ApplicationVersion>$(Version)</ApplicationVersion>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11</LangVersion>
<Description>Contains common types defined by the Aaru Data Preservation Suite.</Description>
<PackageProjectUrl>https://github.com/aaru-dps/</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/aaru-dps/Aaru.CommonTypes</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NeutralLanguage>en-US</NeutralLanguage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Authors>Natalia Portillo &lt;claunia@claunia.com&gt;</Authors>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>CS1591;CS1574</NoWarn>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<InternalsVisibleTo Include="Aaru.Tests"/>
<InternalsVisibleTo Include="Aaru.Tests.Devices"/>
</ItemGroup>
<PropertyGroup>
<NrtRevisionFormat>$(Version)+{chash:8}</NrtRevisionFormat>
<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
<NrtShowRevision>true</NrtShowRevision>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\CICMMetadata\dotnet\cicm.cs">
<Link>Metadata/cicm.cs</Link>
</Compile>
<Compile Include="Delegates.cs" />
<Compile Include="Enums\DeviceType.cs" />
<Compile Include="Enums\ErrorNumber.cs" />
<Compile Include="Enums\Images.cs" />
<Compile Include="Enums\Nes.cs" />
<Compile Include="Extents\ExtentsByte.cs" />
<Compile Include="Extents\ExtentsConverter.cs" />
<Compile Include="Extents\ExtentsInt.cs" />
<Compile Include="Extents\ExtentsLong.cs" />
<Compile Include="Extents\ExtentsSByte.cs" />
<Compile Include="Extents\ExtentsShort.cs" />
<Compile Include="Extents\ExtentsUInt.cs" />
<Compile Include="Extents\ExtentsULong.cs" />
<Compile Include="Extents\ExtentsUShort.cs" />
<Compile Include="Filters.cs" />
<Compile Include="Geometry.cs" />
<Compile Include="Interfaces\IBaseImage.cs" />
<Compile Include="Interfaces\IBaseWritableImage.cs" />
<Compile Include="Interfaces\IByteAddressableImage.cs" />
<Compile Include="Interfaces\IChecksum.cs" />
<Compile Include="Interfaces\IFilesystem.cs" />
<Compile Include="Interfaces\IArchive.cs" />
<Compile Include="Interfaces\IFilter.cs" />
<Compile Include="Interfaces\IFloppyImage.cs" />
<Compile Include="Interfaces\IMediaImage.cs" />
<Compile Include="Interfaces\IOpticalMediaImage.cs" />
<Compile Include="Interfaces\IPartition.cs" />
<Compile Include="Interfaces\IPartitionableMediaImage.cs" />
<Compile Include="Interfaces\IPluginRegister.cs" />
<Compile Include="Interfaces\IReadOnlyFilesystem.cs" />
<Compile Include="Interfaces\ITapeImage.cs" />
<Compile Include="Interfaces\IVerifiableImage.cs" />
<Compile Include="Interfaces\IVerifiableSectorsImage.cs" />
<Compile Include="Interfaces\IWritableFloppyImage.cs" />
<Compile Include="Interfaces\IWritableImage.cs" />
<Compile Include="Interfaces\IWritableOpticalImage.cs" />
<Compile Include="Interfaces\IWritableTapeImage.cs" />
<Compile Include="Interop\DetectOS.cs" />
<Compile Include="Interop\PlatformID.cs" />
<Compile Include="Interop\Version.cs" />
<Compile Include="MediaTypeFromDevice\FromAta.cs" />
<Compile Include="MediaTypeFromDevice\FromMmc.cs" />
<Compile Include="MediaTypeFromDevice\FromOdc.cs" />
<Compile Include="MediaTypeFromDevice\FromScsi.cs" />
<Compile Include="MediaTypeFromDevice\FromSbc.cs" />
<Compile Include="MediaTypeFromDevice\FromSsc.cs" />
<Compile Include="Metadata\CdOffset.cs" />
<Compile Include="Metadata\DeviceReport.cs" />
<Compile Include="Metadata\DeviceReportV2.cs" />
<Compile Include="Metadata\Dimensions.cs" />
<Compile Include="Metadata\MediaType.cs" />
<Compile Include="Metadata\Resume.cs" />
<Compile Include="Metadata\Statistics.cs" />
<Compile Include="Metadata\Version.cs" />
<Compile Include="Partition.cs" />
<Compile Include="MediaType.cs" />
<Compile Include="PluginBase.cs" />
<Compile Include="Structs\Devices\ATA\Identify.cs" />
<Compile Include="Structs\Devices\SCSI\Enums.cs" />
<Compile Include="Structs\Devices\SCSI\Inquiry.cs" />
<Compile Include="Structs\Devices\SCSI\Modes\2A.cs" />
<Compile Include="Structs\Filesystems.cs" />
<Compile Include="Structs\Images.cs" />
<Compile Include="Structs\TapeFile.cs" />
<Compile Include="Structs\TapePartition.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Security.Principal.Windows" Version="6.0.0-preview.5.21301.5" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Content Include="..\LICENSE.MIT">
<Link>LICENSE.MIT</Link>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj" />
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj" />
</ItemGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F2B84194-26EB-4227-B1C5-6602517E85AE}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Aaru.CommonTypes</RootNamespace>
<AssemblyName>Aaru.CommonTypes</AssemblyName>
<ReleaseVersion>$(Version)</ReleaseVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>6.0.0-alpha8</Version>
<Company>Claunia.com</Company>
<Copyright>Copyright © 2011-2022 Natalia Portillo</Copyright>
<Product>Aaru Data Preservation Suite</Product>
<Title>Aaru.CommonTypes</Title>
<ApplicationVersion>$(Version)</ApplicationVersion>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11</LangVersion>
<Description>Contains common types defined by the Aaru Data Preservation Suite.</Description>
<PackageProjectUrl>https://github.com/aaru-dps/</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/aaru-dps/Aaru.CommonTypes</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NeutralLanguage>en-US</NeutralLanguage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Authors>Natalia Portillo &lt;claunia@claunia.com&gt;</Authors>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>CS1591;CS1574</NoWarn>
</PropertyGroup>
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<InternalsVisibleTo Include="Aaru.Tests"/>
<InternalsVisibleTo Include="Aaru.Tests.Devices"/>
</ItemGroup>
<PropertyGroup>
<NrtRevisionFormat>$(Version)+{chash:8}</NrtRevisionFormat>
<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
<NrtShowRevision>true</NrtShowRevision>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\CICMMetadata\dotnet\cicm.cs">
<Link>Metadata/cicm.cs</Link>
</Compile>
<Compile Include="Delegates.cs"/>
<Compile Include="Enums\DeviceType.cs"/>
<Compile Include="Enums\ErrorNumber.cs"/>
<Compile Include="Enums\Images.cs"/>
<Compile Include="Enums\Nes.cs"/>
<Compile Include="Extents\ExtentsByte.cs"/>
<Compile Include="Extents\ExtentsConverter.cs"/>
<Compile Include="Extents\ExtentsInt.cs"/>
<Compile Include="Extents\ExtentsLong.cs"/>
<Compile Include="Extents\ExtentsSByte.cs"/>
<Compile Include="Extents\ExtentsShort.cs"/>
<Compile Include="Extents\ExtentsUInt.cs"/>
<Compile Include="Extents\ExtentsULong.cs"/>
<Compile Include="Extents\ExtentsUShort.cs"/>
<Compile Include="Filters.cs"/>
<Compile Include="Geometry.cs"/>
<Compile Include="Interfaces\IBaseImage.cs"/>
<Compile Include="Interfaces\IBaseWritableImage.cs"/>
<Compile Include="Interfaces\IByteAddressableImage.cs"/>
<Compile Include="Interfaces\IChecksum.cs"/>
<Compile Include="Interfaces\IFilesystem.cs"/>
<Compile Include="Interfaces\IArchive.cs"/>
<Compile Include="Interfaces\IFilter.cs"/>
<Compile Include="Interfaces\IFloppyImage.cs"/>
<Compile Include="Interfaces\IMediaImage.cs"/>
<Compile Include="Interfaces\IOpticalMediaImage.cs"/>
<Compile Include="Interfaces\IPartition.cs"/>
<Compile Include="Interfaces\IPartitionableMediaImage.cs"/>
<Compile Include="Interfaces\IPluginRegister.cs"/>
<Compile Include="Interfaces\IReadOnlyFilesystem.cs"/>
<Compile Include="Interfaces\ITapeImage.cs"/>
<Compile Include="Interfaces\IVerifiableImage.cs"/>
<Compile Include="Interfaces\IVerifiableSectorsImage.cs"/>
<Compile Include="Interfaces\IWritableFloppyImage.cs"/>
<Compile Include="Interfaces\IWritableImage.cs"/>
<Compile Include="Interfaces\IWritableOpticalImage.cs"/>
<Compile Include="Interfaces\IWritableTapeImage.cs"/>
<Compile Include="Interop\DetectOS.cs"/>
<Compile Include="Interop\PlatformID.cs"/>
<Compile Include="Interop\Version.cs"/>
<Compile Include="MediaTypeFromDevice\FromAta.cs"/>
<Compile Include="MediaTypeFromDevice\FromMmc.cs"/>
<Compile Include="MediaTypeFromDevice\FromOdc.cs"/>
<Compile Include="MediaTypeFromDevice\FromScsi.cs"/>
<Compile Include="MediaTypeFromDevice\FromSbc.cs"/>
<Compile Include="MediaTypeFromDevice\FromSsc.cs"/>
<Compile Include="Metadata\CdOffset.cs"/>
<Compile Include="Metadata\DeviceReport.cs"/>
<Compile Include="Metadata\DeviceReportV2.cs"/>
<Compile Include="Metadata\Dimensions.cs"/>
<Compile Include="Metadata\MediaType.cs"/>
<Compile Include="Metadata\Resume.cs"/>
<Compile Include="Metadata\Statistics.cs"/>
<Compile Include="Metadata\Version.cs"/>
<Compile Include="Partition.cs"/>
<Compile Include="MediaType.cs"/>
<Compile Include="PluginBase.cs"/>
<Compile Include="Structs\Devices\ATA\Identify.cs"/>
<Compile Include="Structs\Devices\SCSI\Enums.cs"/>
<Compile Include="Structs\Devices\SCSI\Inquiry.cs"/>
<Compile Include="Structs\Devices\SCSI\Modes\2A.cs"/>
<Compile Include="Structs\Filesystems.cs"/>
<Compile Include="Structs\Images.cs"/>
<Compile Include="Structs\TapeFile.cs"/>
<Compile Include="Structs\TapePartition.cs"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="System.ComponentModel.Annotations" Version="6.0.0-preview.4.21253.7"/>
<PackageReference Include="System.Security.Principal.Windows" Version="6.0.0-preview.5.21301.5"/>
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
</ItemGroup>
<ItemGroup>
<Content Include="..\LICENSE.MIT">
<Link>LICENSE.MIT</Link>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
</ItemGroup>
</Project>

View File

@@ -1,2 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mediatypefromdevice/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mediatypefromdevice/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -36,10 +36,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Enums;
using System.Diagnostics.CodeAnalysis;
namespace Aaru.CommonTypes.Enums;
/// <summary>Enumerates error codes. Negative for UNIX error number equivalents, positive for Aaru error numbers.</summary>
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "UnusedMember.Global"),
SuppressMessage("ReSharper", "IdentifierTypo")]

View File

@@ -39,11 +39,11 @@
// ReSharper disable UnusedMember.Global
namespace Aaru.CommonTypes.Enums;
using System;
using System.Diagnostics.CodeAnalysis;
namespace Aaru.CommonTypes.Enums;
/// <summary>Track (as partitioning element) types.</summary>
public enum TrackType : byte
{

View File

@@ -1,119 +1,61 @@
// ReSharper disable InconsistentNaming
namespace Aaru.CommonTypes.Enums;
public enum NesConsoleType : byte
{
Nes = 0,
Vs = 1,
Playchoice = 2,
Extended = 3
Nes = 0, Vs = 1, Playchoice = 2,
Extended = 3
}
public enum NesTimingMode : byte
{
RP2C02 = 0,
RP2C07 = 1,
Multiple = 2,
RP2C02 = 0, RP2C07 = 1, Multiple = 2,
UMC6527P = 3
}
public enum NesVsPpuType : byte
{
RP2C03B = 0,
RP2C03G = 1,
RP2C04_0001 = 2,
RP2C04_0002 = 3,
RP2C04_0003 = 4,
RP2C04_0004 = 5,
RC2C03B = 6,
RC2C03C = 7,
RC2C05_01 = 8,
RC2C05_02 = 9,
RC2C05_03 = 10,
RC2C05_04 = 11,
RP2C03B = 0, RP2C03G = 1, RP2C04_0001 = 2,
RP2C04_0002 = 3, RP2C04_0003 = 4, RP2C04_0004 = 5,
RC2C03B = 6, RC2C03C = 7, RC2C05_01 = 8,
RC2C05_02 = 9, RC2C05_03 = 10, RC2C05_04 = 11,
RC2C05_05 = 12
}
public enum NesVsHardwareType : byte
{
Normal = 0,
RBI = 1,
TKO = 2,
SuperXevious = 3,
IceClimber = 4,
Dual = 5,
Normal = 0, RBI = 1, TKO = 2,
SuperXevious = 3, IceClimber = 4, Dual = 5,
RaidOnBungeling = 6
}
public enum NesExtendedConsoleType : byte
{
Normal = 0,
Vs = 1,
Playchoice = 2,
DecimalMode = 3,
VT01_Monochrome = 4,
VT01 = 5,
VT02 = 6,
VT03 = 7,
VT09 = 8,
VT32 = 9,
VT369 = 10,
UM6578 = 11
Normal = 0, Vs = 1, Playchoice = 2,
DecimalMode = 3, VT01_Monochrome = 4, VT01 = 5,
VT02 = 6, VT03 = 7, VT09 = 8,
VT32 = 9, VT369 = 10, UM6578 = 11
}
public enum NesDefaultExpansionDevice : byte
{
Unspecified = 0,
Controller = 1,
FourScore = 2,
FourPlayersAdapter = 3,
Vs = 4,
VsSystem = 5,
VsPinball = 6,
VsZapper = 7,
Zapper = 8,
TwoZappers = 9,
HyperShotLightgun = 0xA,
PowerPadSideA = 0xB,
PowerPadSideB = 0xC,
FamilyTrainerSideA = 0xD,
FamilyTrainerSideB = 0xE,
ArkanoidVaus = 0xF,
ArkanoidVausFamicom = 0x10,
TwoVausDataRecorder = 0x11,
HyperShotController = 0x12,
CoconutsPachinko = 0x13,
ExcitingBoxing = 0x14,
JissenMahjong = 0x15,
PartyTap = 0x16,
OekaKidsTablet = 0x17,
SunsoftBarcodeBattler = 0x18,
PianoKeyboard = 0x19,
PokkunMoguraa = 0x1A,
TopRider = 0x1B,
DoubleFisted = 0x1C,
Famicom3DSystem = 0x1D,
DoremikkoKeyboard = 0x1E,
GyroSet = 0x1F,
DataRecorder = 0x20,
TurboFile = 0x21,
StorageBattleBox = 0x22,
FamilyBASICKeyboardDataRecorder = 0x23,
DongdaKeyboard = 0x24,
BitCorpKeyboard = 0x25,
SuborKeyboard = 0x26,
SuborKeyboardMouse = 0x27,
SuborKeyboardMouse24 = 0x28,
SNESMouse = 0x29,
Multicart = 0x2A,
SNESControllers = 0x2B,
RacerMateBicycle = 0x2C,
UForce = 0x2D,
StackUp = 0x2E,
PatrolmanLightgun = 0x2F,
C1CassetteInterface = 0x30,
SwappedController = 0x31,
SudokuPad = 0x32,
ABLPinball = 0x33,
GoldenNuggetCasino = 0x34
Unspecified = 0, Controller = 1, FourScore = 2,
FourPlayersAdapter = 3, Vs = 4, VsSystem = 5,
VsPinball = 6, VsZapper = 7, Zapper = 8,
TwoZappers = 9, HyperShotLightgun = 0xA, PowerPadSideA = 0xB,
PowerPadSideB = 0xC, FamilyTrainerSideA = 0xD, FamilyTrainerSideB = 0xE,
ArkanoidVaus = 0xF, ArkanoidVausFamicom = 0x10, TwoVausDataRecorder = 0x11,
HyperShotController = 0x12, CoconutsPachinko = 0x13, ExcitingBoxing = 0x14,
JissenMahjong = 0x15, PartyTap = 0x16, OekaKidsTablet = 0x17,
SunsoftBarcodeBattler = 0x18, PianoKeyboard = 0x19, PokkunMoguraa = 0x1A,
TopRider = 0x1B, DoubleFisted = 0x1C, Famicom3DSystem = 0x1D,
DoremikkoKeyboard = 0x1E, GyroSet = 0x1F, DataRecorder = 0x20,
TurboFile = 0x21, StorageBattleBox = 0x22, FamilyBASICKeyboardDataRecorder = 0x23,
DongdaKeyboard = 0x24, BitCorpKeyboard = 0x25, SuborKeyboard = 0x26,
SuborKeyboardMouse = 0x27, SuborKeyboardMouse24 = 0x28, SNESMouse = 0x29,
Multicart = 0x2A, SNESControllers = 0x2B, RacerMateBicycle = 0x2C,
UForce = 0x2D, StackUp = 0x2E, PatrolmanLightgun = 0x2F,
C1CassetteInterface = 0x30, SwappedController = 0x31, SudokuPad = 0x32,
ABLPinball = 0x33, GoldenNuggetCasino = 0x34
}

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="byte" /></summary>
public class ExtentsByte
{
@@ -72,7 +72,7 @@ public class ExtentsByte
Tuple<byte, byte> removeTwo = null;
Tuple<byte, byte> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,13 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
using Schemas;
namespace Aaru.CommonTypes.Extents;
/// <summary>Converts extents</summary>
public static class ExtentsConverter
{
@@ -54,7 +55,7 @@ public static class ExtentsConverter
return null;
Tuple<ulong, ulong>[] tuples = extents.ToArray();
var array = new ExtentType[tuples.Length];
ExtentType[] array = new ExtentType[tuples.Length];
for(ulong i = 0; i < (ulong)array.LongLength; i++)
array[i] = new ExtentType
@@ -74,7 +75,8 @@ public static class ExtentsConverter
if(extents == null)
return null;
var tuples = extents.Select(extent => new Tuple<ulong, ulong>(extent.Start, extent.End)).ToList();
List<Tuple<ulong, ulong>> tuples = extents.Select(extent => new Tuple<ulong, ulong>(extent.Start, extent.End)).
ToList();
return new ExtentsULong(tuples);
}

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="int" /></summary>
public class ExtentsInt
{
@@ -72,7 +72,7 @@ public class ExtentsInt
Tuple<int, int> removeTwo = null;
Tuple<int, int> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="long" /></summary>
public class ExtentsLong
{
@@ -72,7 +72,7 @@ public class ExtentsLong
Tuple<long, long> removeTwo = null;
Tuple<long, long> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="sbyte" /></summary>
public class ExtentsSByte
{
@@ -72,7 +72,7 @@ public class ExtentsSByte
Tuple<sbyte, sbyte> removeTwo = null;
Tuple<sbyte, sbyte> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="short" /></summary>
public class ExtentsShort
{
@@ -72,7 +72,7 @@ public class ExtentsShort
Tuple<short, short> removeTwo = null;
Tuple<short, short> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="uint" /></summary>
public class ExtentsUInt
{
@@ -72,7 +72,7 @@ public class ExtentsUInt
Tuple<uint, uint> removeTwo = null;
Tuple<uint, uint> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="ulong" /></summary>
public class ExtentsULong
{
@@ -72,7 +72,7 @@ public class ExtentsULong
Tuple<ulong, ulong> removeTwo = null;
Tuple<ulong, ulong> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Extents;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Aaru.CommonTypes.Extents;
/// <summary>Implements extents for <see cref="ushort" /></summary>
public class ExtentsUShort
{
@@ -72,7 +72,7 @@ public class ExtentsUShort
Tuple<ushort, ushort> removeTwo = null;
Tuple<ushort, ushort> itemToAdd = null;
for(var i = 0; i < _backend.Count; i++)
for(int i = 0; i < _backend.Count; i++)
{
// Already contained in an extent
if(item >= _backend[i].Item1 &&

View File

@@ -36,8 +36,6 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System;
using System.Collections.Generic;
using System.IO;
@@ -47,6 +45,8 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.Console;
namespace Aaru.CommonTypes;
/// <summary>Manages the known filters</summary>
public sealed class FiltersList
{
@@ -89,7 +89,8 @@ public sealed class FiltersList
if(!filter.Identify(path))
continue;
var foundFilter = (IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(Array.Empty<object>());
var foundFilter = (IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.
Invoke(Array.Empty<object>());
if(foundFilter?.Open(path) == ErrorNumber.NoError)
return foundFilter;

View File

@@ -36,10 +36,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System.Linq;
namespace Aaru.CommonTypes;
/// <summary>Handles CHS geometries</summary>
public static class Geometry
{

View File

@@ -33,13 +33,13 @@
// ReSharper disable UnusedMember.Global
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using Aaru.CommonTypes.Enums;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Supported archive features</summary>
[Flags]
public enum ArchiveSupportedFeature : uint

View File

@@ -36,14 +36,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using Schemas;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Base interface for all images</summary>
public interface IBaseImage
{

View File

@@ -36,14 +36,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using Schemas;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc />
/// <summary>Base interface for all writable images</summary>
public interface IBaseWritableImage : IBaseImage

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc />
/// <summary>Interface defining linear media (chips, game carts, etc) images</summary>
public interface IByteAddressableImage : IBaseWritableImage

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Text;
using Schemas;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Interface to implement filesystem plugins.</summary>
public interface IFilesystem
{

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.IO;
using Aaru.CommonTypes.Enums;
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)
@@ -96,8 +96,8 @@ public interface IFilter
/// <summary>
/// Gets path to parent folder to the file referenced by this filter. If it's an archive, it's the full path to
/// the archive itself.<br /> UNIX: /path/to/archive.zip/path/to/file.bin =&gt; /path/to/archive.zip <br /> Windows:
/// C:\path\to\archive.zip\path\to\file.bin =&gt; C:\path\to\archive.zip
/// the archive itself. <br /> UNIX: /path/to/archive.zip/path/to/file.bin =&gt; /path/to/archive.zip <br /> Windows:
/// C:\path\to\archive.zip\path\to\file.bin = &gt; C:\path\to\archive.zip
/// </summary>
/// <returns>The parent folder.</returns>
string ParentFolder { get; }

View File

@@ -36,15 +36,15 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc />
/// <summary>
/// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is
/// needed because floppy formatting characteristics are not necesarily compatible with the whole. LBA-oriented
/// needed because floppy formatting characteristics are not necessarily compatible with the whole. LBA-oriented
/// interface is defined by <see cref="T:Aaru.CommonTypes.Interfaces.IMediaImage" />. All data returned by these
/// methods is already decoded from its corresponding bitstream.
/// </summary>

View File

@@ -37,10 +37,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Enums;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc />
/// <summary>Abstract class to implement disk image reading plugins.</summary>
public interface IMediaImage : IBaseImage

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc cref="IMediaImage" />
/// <summary>Abstract class to implement disk image reading plugins.</summary>
public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage, IVerifiableSectorsImage

View File

@@ -37,11 +37,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Collections.Generic;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Abstract class to implement partitioning schemes interpreting plugins.</summary>
public interface IPartition
{

View File

@@ -37,10 +37,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System.Collections.Generic;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Defines an image that can contain partitions</summary>
public interface IPartitionableMediaImage
{

View File

@@ -36,11 +36,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Collections.Generic;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Defines a register of all known plugins</summary>
public interface IPluginRegister
{

View File

@@ -37,14 +37,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc />
/// <summary>Defines the interface to implement reading the contents of a filesystem</summary>
public interface IReadOnlyFilesystem : IFilesystem

View File

@@ -37,11 +37,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System.Collections.Generic;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc />
/// <summary>Defines an image that can store the information from streaming, digital, tapes</summary>
public interface ITapeImage : IMediaImage

View File

@@ -37,10 +37,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System.Collections.Generic;
namespace Aaru.CommonTypes.Interfaces;
/// <summary>Defines an image that can verify the integrity of the sectors it contains</summary>
public interface IVerifiableSectorsImage
{

View File

@@ -36,11 +36,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc cref="IWritableImage" />
/// <summary>
/// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is

View File

@@ -36,10 +36,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Enums;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.IMediaImage" />
/// <summary>
/// Abstract class to implement disk image writing plugins. TODO: This interface is subject to change until

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.IOpticalMediaImage" />
/// <summary>Defines an image that is writable and can store an optical disc (CD, DVD, etc)</summary>
public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage

View File

@@ -37,10 +37,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
namespace Aaru.CommonTypes.Interfaces;
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.ITapeImage" />
/// <summary>Defines an image that is writable and can store information about a streaming, digital, tape</summary>
public interface IWritableTapeImage : ITapeImage, IWritableImage

View File

@@ -36,14 +36,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interop;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Principal;
namespace Aaru.CommonTypes.Interop;
/// <summary>Detects the underlying execution framework and operating system</summary>
public static class DetectOS
{

View File

@@ -36,10 +36,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interop;
using System.Diagnostics.CodeAnalysis;
namespace Aaru.CommonTypes.Interop;
/// <summary>Contains an arbitrary list of OSes, even if .NET does not run on them</summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum PlatformID

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Interop;
using System;
using System.Reflection;
using System.Runtime;
namespace Aaru.CommonTypes.Interop;
/// <summary>Gets our own, or the runtime's version</summary>
public static class Version
{

View File

@@ -39,6 +39,8 @@
// ReSharper disable InconsistentNaming
// TODO: Rename contents
using System;
#pragma warning disable 1591
// ReSharper disable UnusedMember.Global
@@ -46,16 +48,10 @@
namespace Aaru.CommonTypes;
using System;
public enum MediaEncoding
{
Unknown,
FM,
MFM,
M2FM,
AppleGCR,
CommodoreGCR
Unknown, FM, MFM,
M2FM, AppleGCR, CommodoreGCR
}
/// <summary>Contains an enumeration of all known types of media.</summary>
@@ -214,9 +210,7 @@ public enum MediaType : uint
/// <summary>Pioneer LaserDisc</summary>
LD = 80,
/// <summary>Pioneer LaserDisc data</summary>
LDROM = 81, LDROM2 = 82,
LVROM = 83,
MegaLD = 84,
LDROM = 81, LDROM2 = 82, LVROM = 83, MegaLD = 84,
/// <summary>Writable LaserDisc with support for component video</summary>
CRVdisc = 85,
#endregion LaserDisc based, types 80 to 89
@@ -248,8 +242,7 @@ public enum MediaType : uint
#endregion Plasmon UDO, types 100 to 109
#region Sony game media, types 110 to 129
PlayStationMemoryCard = 110,
PlayStationMemoryCard2 = 111,
PlayStationMemoryCard = 110, PlayStationMemoryCard2 = 111,
/// <summary>Sony PlayStation game CD</summary>
PS1CD = 112,
/// <summary>Sony PlayStation 2 game CD</summary>
@@ -287,14 +280,9 @@ public enum MediaType : uint
/// <summary>Sega/Yamaha Gigabyte Disc</summary>
GDROM = 152,
/// <summary>Sega/Yamaha recordable Gigabyte Disc</summary>
GDR = 153, SegaCard = 154,
MilCD = 155,
MegaDriveCartridge = 156,
_32XCartridge = 157,
SegaPicoCartridge = 158,
MasterSystemCartridge = 159,
GameGearCartridge = 160,
SegaSaturnCartridge = 161,
GDR = 153, SegaCard = 154, MilCD = 155, MegaDriveCartridge = 156,
_32XCartridge = 157, SegaPicoCartridge = 158, MasterSystemCartridge = 159,
GameGearCartridge = 160, SegaSaturnCartridge = 161,
#endregion Sega game media, types 150 to 169
#region Other game media, types 170 to 179
@@ -567,25 +555,15 @@ public enum MediaType : uint
#endregion Apricot ACT standard floppy formats, type 309
#region OnStream ADR, types 310 to 319
ADR2120 = 310,
ADR260 = 311,
ADR30 = 312,
ADR2120 = 310, ADR260 = 311, ADR30 = 312,
ADR50 = 313,
#endregion OnStream ADR, types 310 to 319
#region Advanced Intelligent Tape, types 320 to 339
AIT1 = 320,
AIT1Turbo = 321,
AIT2 = 322,
AIT2Turbo = 323,
AIT3 = 324,
AIT3Ex = 325,
AIT3Turbo = 326,
AIT4 = 327,
AIT5 = 328,
AITETurbo = 329,
SAIT1 = 330,
SAIT2 = 331,
AIT1 = 320, AIT1Turbo = 321, AIT2 = 322,
AIT2Turbo = 323, AIT3 = 324, AIT3Ex = 325,
AIT3Turbo = 326, AIT4 = 327, AIT5 = 328,
AITETurbo = 329, SAIT1 = 330, SAIT2 = 331,
#endregion Advanced Intelligent Tape, types 320 to 339
#region Iomega, types 340 to 359
@@ -594,17 +572,10 @@ public enum MediaType : uint
Bernoulli = 340,
/// <summary>Obsolete type for 5⅓" Bernoulli Box II disks</summary>
[Obsolete]
Bernoulli2 = 341, Ditto = 342,
DittoMax = 343,
Jaz = 344,
Jaz2 = 345,
PocketZip = 346,
REV120 = 347,
REV35 = 348,
REV70 = 349,
ZIP100 = 350,
ZIP250 = 351,
ZIP750 = 352,
Bernoulli2 = 341, Ditto = 342, DittoMax = 343, Jaz = 344,
Jaz2 = 345, PocketZip = 346, REV120 = 347,
REV35 = 348, REV70 = 349, ZIP100 = 350,
ZIP250 = 351, ZIP750 = 352,
/// <summary>5⅓" Bernoulli Box II disk with 35Mb capacity</summary>
Bernoulli35 = 353,
/// <summary>5⅓" Bernoulli Box II disk with 44Mb capacity</summary>
@@ -622,9 +593,7 @@ public enum MediaType : uint
#endregion Iomega, types 340 to 359
#region Audio or video media, types 360 to 369
CompactCassette = 360,
Data8 = 361,
MiniDV = 362,
CompactCassette = 360, Data8 = 361, MiniDV = 362,
/// <summary>D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track</summary>
Dcas25 = 363,
/// <summary>D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track</summary>
@@ -634,62 +603,34 @@ public enum MediaType : uint
#endregion Audio media, types 360 to 369
#region CompactFlash Association, types 370 to 379
CFast = 370,
CompactFlash = 371,
CompactFlashType2 = 372,
CFast = 370, CompactFlash = 371, CompactFlashType2 = 372,
#endregion CompactFlash Association, types 370 to 379
#region Digital Audio Tape / Digital Data Storage, types 380 to 389
DigitalAudioTape = 380,
DAT160 = 381,
DAT320 = 382,
DAT72 = 383,
DDS1 = 384,
DDS2 = 385,
DDS3 = 386,
DDS4 = 387,
DigitalAudioTape = 380, DAT160 = 381, DAT320 = 382,
DAT72 = 383, DDS1 = 384, DDS2 = 385,
DDS3 = 386, DDS4 = 387,
#endregion Digital Audio Tape / Digital Data Storage, types 380 to 389
#region DEC, types 390 to 399
CompactTapeI = 390,
CompactTapeII = 391,
DECtapeII = 392,
DLTtapeIII = 393,
DLTtapeIIIxt = 394,
DLTtapeIV = 395,
DLTtapeS4 = 396,
SDLT1 = 397,
SDLT2 = 398,
VStapeI = 399,
CompactTapeI = 390, CompactTapeII = 391, DECtapeII = 392,
DLTtapeIII = 393, DLTtapeIIIxt = 394, DLTtapeIV = 395,
DLTtapeS4 = 396, SDLT1 = 397, SDLT2 = 398,
VStapeI = 399,
#endregion DEC, types 390 to 399
#region Exatape, types 400 to 419
Exatape15m = 400,
Exatape22m = 401,
Exatape22mAME = 402,
Exatape28m = 403,
Exatape40m = 404,
Exatape45m = 405,
Exatape54m = 406,
Exatape75m = 407,
Exatape76m = 408,
Exatape80m = 409,
Exatape106m = 410,
Exatape160mXL = 411,
Exatape112m = 412,
Exatape125m = 413,
Exatape150m = 414,
Exatape170m = 415,
Exatape225m = 416,
Exatape15m = 400, Exatape22m = 401, Exatape22mAME = 402,
Exatape28m = 403, Exatape40m = 404, Exatape45m = 405,
Exatape54m = 406, Exatape75m = 407, Exatape76m = 408,
Exatape80m = 409, Exatape106m = 410, Exatape160mXL = 411,
Exatape112m = 412, Exatape125m = 413, Exatape150m = 414,
Exatape170m = 415, Exatape225m = 416,
#endregion Exatape, types 400 to 419
#region PCMCIA / ExpressCard, types 420 to 429
ExpressCard34 = 420,
ExpressCard54 = 421,
PCCardTypeI = 422,
PCCardTypeII = 423,
PCCardTypeIII = 424,
PCCardTypeIV = 425,
ExpressCard34 = 420, ExpressCard54 = 421, PCCardTypeI = 422,
PCCardTypeII = 423, PCCardTypeIII = 424, PCCardTypeIV = 425,
#endregion PCMCIA / ExpressCard, types 420 to 429
#region SyQuest, types 430 to 449
@@ -725,19 +666,11 @@ public enum MediaType : uint
#endregion SyQuest, types 430 to 449
#region Nintendo, types 450 to 469
FamicomGamePak = 450,
GameBoyAdvanceGamePak = 451,
GameBoyGamePak = 452,
FamicomGamePak = 450, GameBoyAdvanceGamePak = 451, GameBoyGamePak = 452,
/// <summary>Nintendo GameCube Optical Disc</summary>
GOD = 453, N64DD = 454,
N64GamePak = 455,
NESGamePak = 456,
Nintendo3DSGameCard = 457,
NintendoDiskCard = 458,
NintendoDSGameCard = 459,
NintendoDSiGameCard = 460,
SNESGamePak = 461,
SNESGamePakUS = 462,
GOD = 453, N64DD = 454, N64GamePak = 455, NESGamePak = 456,
Nintendo3DSGameCard = 457, NintendoDiskCard = 458, NintendoDSGameCard = 459,
NintendoDSiGameCard = 460, SNESGamePak = 461, SNESGamePakUS = 462,
/// <summary>Nintendo Wii Optical Disc</summary>
WOD = 463,
/// <summary>Nintendo Wii U Optical Disc</summary>
@@ -745,121 +678,66 @@ public enum MediaType : uint
#endregion Nintendo, types 450 to 469
#region IBM Tapes, types 470 to 479
IBM3470 = 470,
IBM3480 = 471,
IBM3490 = 472,
IBM3490E = 473,
IBM3592 = 474,
IBM3470 = 470, IBM3480 = 471, IBM3490 = 472,
IBM3490E = 473, IBM3592 = 474,
#endregion IBM Tapes, types 470 to 479
#region LTO Ultrium, types 480 to 509
LTO = 480,
LTO2 = 481,
LTO3 = 482,
LTO3WORM = 483,
LTO4 = 484,
LTO4WORM = 485,
LTO5 = 486,
LTO5WORM = 487,
LTO6 = 488,
LTO6WORM = 489,
LTO7 = 490,
LTO7WORM = 491,
LTO = 480, LTO2 = 481, LTO3 = 482,
LTO3WORM = 483, LTO4 = 484, LTO4WORM = 485,
LTO5 = 486, LTO5WORM = 487, LTO6 = 488,
LTO6WORM = 489, LTO7 = 490, LTO7WORM = 491,
#endregion LTO Ultrium, types 480 to 509
#region MemoryStick, types 510 to 519
MemoryStick = 510,
MemoryStickDuo = 511,
MemoryStickMicro = 512,
MemoryStickPro = 513,
MemoryStickProDuo = 514,
MemoryStick = 510, MemoryStickDuo = 511, MemoryStickMicro = 512,
MemoryStickPro = 513, MemoryStickProDuo = 514,
#endregion MemoryStick, types 510 to 519
#region SecureDigital, types 520 to 529
microSD = 520,
miniSD = 521,
SecureDigital = 522,
microSD = 520, miniSD = 521, SecureDigital = 522,
#endregion SecureDigital, types 520 to 529
#region MultiMediaCard, types 530 to 539
MMC = 530,
MMCmicro = 531,
RSMMC = 532,
MMCplus = 533,
MMCmobile = 534,
MMC = 530, MMCmicro = 531, RSMMC = 532,
MMCplus = 533, MMCmobile = 534,
#endregion MultiMediaCard, types 530 to 539
#region SLR, types 540 to 569
MLR1 = 540,
MLR1SL = 541,
MLR3 = 542,
SLR1 = 543,
SLR2 = 544,
SLR3 = 545,
SLR32 = 546,
SLR32SL = 547,
SLR4 = 548,
SLR5 = 549,
SLR5SL = 550,
SLR6 = 551,
SLRtape7 = 552,
SLRtape7SL = 553,
SLRtape24 = 554,
SLRtape24SL = 555,
SLRtape40 = 556,
SLRtape50 = 557,
SLRtape60 = 558,
SLRtape75 = 559,
SLRtape100 = 560,
MLR1 = 540, MLR1SL = 541, MLR3 = 542,
SLR1 = 543, SLR2 = 544, SLR3 = 545,
SLR32 = 546, SLR32SL = 547, SLR4 = 548,
SLR5 = 549, SLR5SL = 550, SLR6 = 551,
SLRtape7 = 552, SLRtape7SL = 553, SLRtape24 = 554,
SLRtape24SL = 555, SLRtape40 = 556, SLRtape50 = 557,
SLRtape60 = 558, SLRtape75 = 559, SLRtape100 = 560,
SLRtape140 = 561,
#endregion SLR, types 540 to 569
#region QIC, types 570 to 589
QIC11 = 570,
QIC120 = 571,
QIC1350 = 572,
QIC150 = 573,
QIC24 = 574,
QIC3010 = 575,
QIC3020 = 576,
QIC3080 = 577,
QIC3095 = 578,
QIC320 = 579,
QIC40 = 580,
QIC525 = 581,
QIC11 = 570, QIC120 = 571, QIC1350 = 572,
QIC150 = 573, QIC24 = 574, QIC3010 = 575,
QIC3020 = 576, QIC3080 = 577, QIC3095 = 578,
QIC320 = 579, QIC40 = 580, QIC525 = 581,
QIC80 = 582,
#endregion QIC, types 570 to 589
#region StorageTek tapes, types 590 to 609
STK4480 = 590,
STK4490 = 591,
STK9490 = 592,
T9840A = 593,
T9840B = 594,
T9840C = 595,
T9840D = 596,
T9940A = 597,
T9940B = 598,
T10000A = 599,
T10000B = 600,
T10000C = 601,
STK4480 = 590, STK4490 = 591, STK9490 = 592,
T9840A = 593, T9840B = 594, T9840C = 595,
T9840D = 596, T9940A = 597, T9940B = 598,
T10000A = 599, T10000B = 600, T10000C = 601,
T10000D = 602,
#endregion StorageTek tapes, types 590 to 609
#region Travan, types 610 to 619
Travan = 610,
Travan1Ex = 611,
Travan3 = 612,
Travan3Ex = 613,
Travan4 = 614,
Travan5 = 615,
Travan = 610, Travan1Ex = 611, Travan3 = 612,
Travan3Ex = 613, Travan4 = 614, Travan5 = 615,
Travan7 = 616,
#endregion Travan, types 610 to 619
#region VXA, types 620 to 629
VXA1 = 620,
VXA2 = 621,
VXA3 = 622,
VXA1 = 620, VXA2 = 621, VXA3 = 622,
#endregion VXA, types 620 to 629
#region Magneto-optical, types 630 to 659
@@ -926,47 +804,27 @@ public enum MediaType : uint
#endregion Magneto-optical, types 630 to 659
#region Other floppy standards, types 660 to 689
CompactFloppy = 660,
DemiDiskette = 661,
CompactFloppy = 660, DemiDiskette = 661,
/// <summary>3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169</summary>
Floptical = 662, HiFD = 663,
QuickDisk = 664,
UHD144 = 665,
VideoFloppy = 666,
Wafer = 667,
ZXMicrodrive = 668,
Floptical = 662, HiFD = 663, QuickDisk = 664, UHD144 = 665,
VideoFloppy = 666, Wafer = 667, ZXMicrodrive = 668,
/// <summary>5.25", SS, DD, 77 tracks, 16 spt, 256 bytes/sector, MFM, 100 tpi, 300rpm</summary>
MetaFloppy_Mod_II = 669,
#endregion Other floppy standards, types 660 to 669
#region Miscellaneous, types 670 to 689
BeeCard = 670,
Borsu = 671,
DataStore = 672,
DIR = 673,
DST = 674,
DTF = 675,
DTF2 = 676,
Flextra3020 = 677,
Flextra3225 = 678,
HiTC1 = 679,
HiTC2 = 680,
LT1 = 681,
MiniCard = 872,
Orb = 683,
Orb5 = 684,
SmartMedia = 685,
xD = 686,
XQD = 687,
DataPlay = 688,
BeeCard = 670, Borsu = 671, DataStore = 672,
DIR = 673, DST = 674, DTF = 675,
DTF2 = 676, Flextra3020 = 677, Flextra3225 = 678,
HiTC1 = 679, HiTC2 = 680, LT1 = 681,
MiniCard = 872, Orb = 683, Orb5 = 684,
SmartMedia = 685, xD = 686, XQD = 687,
DataPlay = 688,
#endregion Miscellaneous, types 670 to 689
#region Apple specific media, types 690 to 699
AppleProfile = 690,
AppleWidget = 691,
AppleHD20 = 692,
PriamDataTower = 693,
Pippin = 694,
AppleProfile = 690, AppleWidget = 691, AppleHD20 = 692,
PriamDataTower = 693, Pippin = 694,
#endregion Apple specific media, types 690 to 699
#region DEC hard disks, types 700 to 729
@@ -1108,18 +966,14 @@ public enum MediaType : uint
#endregion DEC hard disks, types 700 to 729
#region Imation, types 730 to 739
LS120 = 730,
LS240 = 731,
FD32MB = 732,
RDX = 733,
LS120 = 730, LS240 = 731, FD32MB = 732,
RDX = 733,
/// <summary>Imation 320Gb RDX</summary>
RDX320 = 734,
#endregion Imation, types 730 to 739
#region VideoNow, types 740 to 749
VideoNow = 740,
VideoNowColor = 741,
VideoNowXp = 742,
VideoNow = 740, VideoNowColor = 741, VideoNowXp = 742,
#endregion
#region Iomega, types 750 to 759
@@ -1132,9 +986,7 @@ public enum MediaType : uint
#endregion Iomega, types 750 to 759
#region Kodak, types 760 to 769
KodakVerbatim3 = 760,
KodakVerbatim6 = 761,
KodakVerbatim12 = 762,
KodakVerbatim3 = 760, KodakVerbatim6 = 761, KodakVerbatim12 = 762,
#endregion Kodak, types 760 to 769
#region Sony and Panasonic Blu-ray derived, types 770 to 799
@@ -1192,6 +1044,5 @@ public enum MediaType : uint
MetaFloppy_Mod_I = 820,
#endregion
AtariLynxCard = 821,
AtariJaguarCartridge = 822
AtariLynxCard = 821, AtariJaguarCartridge = 822
}

View File

@@ -32,10 +32,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using Aaru.Console;
namespace Aaru.CommonTypes;
public static partial class MediaTypeFromDevice
{
/// <summary>Gets the media type from an ATA (not ATAPI) device</summary>
@@ -66,6 +66,5 @@ public static partial class MediaTypeFromDevice
"Drive manufacturer is SyQuest, media has 1961069 blocks of 512 bytes, setting media type to SparQ.");
return MediaType.SparQ;
}
}

View File

@@ -32,11 +32,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System;
using Aaru.Console;
namespace Aaru.CommonTypes;
/// <summary>Gets the media type from a real device</summary>
public static partial class MediaTypeFromDevice
{

View File

@@ -32,10 +32,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using Aaru.Console;
namespace Aaru.CommonTypes;
public static partial class MediaTypeFromDevice
{
/// <summary>Gets the device type from a SCSI Optical Device</summary>

View File

@@ -32,11 +32,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System;
using Aaru.Console;
namespace Aaru.CommonTypes;
public static partial class MediaTypeFromDevice
{
/// <summary>Gets the media type from a SCSI Block Commands compliant device</summary>

View File

@@ -32,11 +32,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System;
using Aaru.Console;
namespace Aaru.CommonTypes;
public static partial class MediaTypeFromDevice
{
/// <summary>Tries to guess, from SCSI information, the media type of a device and/or its inserted media</summary>

View File

@@ -32,11 +32,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System;
using Aaru.Console;
namespace Aaru.CommonTypes;
public static partial class MediaTypeFromDevice
{
/// <summary>Gets the media type from an SCSI Streaming Commands compliant device</summary>

View File

@@ -36,10 +36,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Metadata;
using System.ComponentModel.DataAnnotations;
namespace Aaru.CommonTypes.Metadata;
/// <summary>Describes CD reading offset</summary>
public class CdOffset
{

View File

@@ -38,13 +38,6 @@
// This is obsolete
#pragma warning disable 1591
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace Aaru.CommonTypes.Metadata;
using System;
using System.ComponentModel;
using System.Xml.Serialization;
@@ -53,6 +46,13 @@ using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
using Newtonsoft.Json;
#pragma warning disable 1591
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace Aaru.CommonTypes.Metadata;
[Serializable, XmlRoot("DicDeviceReport", Namespace = "", IsNullable = false)]
public class DeviceReport
{

View File

@@ -38,16 +38,6 @@
// TODO: Re-enable CS1591 in this file
#pragma warning disable 1591
// ReSharper disable VirtualMemberNeverOverridden.Global
// ReSharper disable VirtualMemberCallInConstructor
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace Aaru.CommonTypes.Metadata;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -60,6 +50,16 @@ using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
using Newtonsoft.Json;
#pragma warning disable 1591
// ReSharper disable VirtualMemberNeverOverridden.Global
// ReSharper disable VirtualMemberCallInConstructor
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace Aaru.CommonTypes.Metadata;
public class DeviceReportV2
{
public DeviceReportV2() {}

View File

@@ -36,12 +36,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using Schemas;
#pragma warning disable 612
namespace Aaru.CommonTypes.Metadata;
using Schemas;
/// <summary>Physical dimensions for media types</summary>
public static class Dimensions
{

View File

@@ -36,13 +36,13 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Metadata;
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Schemas;
namespace Aaru.CommonTypes.Metadata;
/// <summary>Information that allows to resume a dump</summary>
[Serializable, XmlRoot("DicResume", Namespace = "", IsNullable = false)]
public class Resume

View File

@@ -39,12 +39,12 @@
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable UnusedMember.Global
namespace Aaru.CommonTypes.Metadata;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Xml.Serialization;
namespace Aaru.CommonTypes.Metadata;
/// <summary>Statistics</summary>
[XmlRoot("DicStats", Namespace = "", IsNullable = false)]
public class Stats

View File

@@ -36,11 +36,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Metadata;
using Aaru.CommonTypes.Interop;
using Schemas;
namespace Aaru.CommonTypes.Metadata;
/// <summary>Manages Aaru's version for metadata</summary>
public static class Version
{

View File

@@ -36,11 +36,11 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using System;
#pragma warning disable CS1591
namespace Aaru.CommonTypes;
using System;
/// <inheritdoc cref="System.IComparable&lt;Partition&gt;" />
/// <summary>Partition structure.</summary>
public struct Partition : IEquatable<Partition>, IComparable<Partition>

View File

@@ -36,13 +36,13 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes;
using System;
using System.Collections.Generic;
using System.Linq;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.CommonTypes;
/// <summary>Contain all plugins (filesystem, partition and image)</summary>
public class PluginBase
{

View File

@@ -38,8 +38,6 @@
// ReSharper disable UnusedMember.Global
namespace Aaru.CommonTypes.Structs.Devices.ATA;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -49,6 +47,8 @@ using Aaru.Console;
using Aaru.Helpers;
using Marshal = Aaru.Helpers.Marshal;
namespace Aaru.CommonTypes.Structs.Devices.ATA;
/// <summary>
/// Information from following standards: T10-791D rev. 4c (ATA) T10-948D rev. 4c (ATA-2) T13-1153D rev. 18
/// (ATA/ATAPI-4) T13-1321D rev. 3 (ATA/ATAPI-5) T13-1410D rev. 3b (ATA/ATAPI-6) T13-1532D rev. 4b (ATA/ATAPI-7)
@@ -108,18 +108,10 @@ public static class Identify
/// <summary>MUST be set</summary>
MustBeSet = 0x4000,
#pragma warning disable 1591
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved09 = 0x0200,
Reserved08 = 0x0100,
Reserved07 = 0x0080,
Reserved06 = 0x0040,
Reserved05 = 0x0020,
Reserved04 = 0x0010,
Reserved03 = 0x0008,
Reserved02 = 0x0004,
Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800,
Reserved10 = 0x0400, Reserved09 = 0x0200, Reserved08 = 0x0100,
Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020,
Reserved04 = 0x0010, Reserved03 = 0x0008, Reserved02 = 0x0004,
Reserved01 = 0x0002,
#pragma warning restore 1591
/// <summary>Indicates a device specific minimum standby timer value</summary>
@@ -272,9 +264,7 @@ public static class Identify
/// <summary>MUST be set</summary>
MustBeSet = 0x4000,
#pragma warning disable 1591
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800,
Reserved10 = 0x0400,
#pragma warning restore 1591
/// <summary>DSN feature set is supported</summary>
@@ -342,21 +332,11 @@ public static class Identify
public enum DataSetMgmtBit : ushort
{
#pragma warning disable 1591
Reserved15 = 0x8000,
Reserved14 = 0x4000,
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved09 = 0x0200,
Reserved08 = 0x0100,
Reserved07 = 0x0080,
Reserved06 = 0x0040,
Reserved05 = 0x0020,
Reserved04 = 0x0010,
Reserved03 = 0x0008,
Reserved02 = 0x0004,
Reserved01 = 0x0002,
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
Reserved12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
Reserved09 = 0x0200, Reserved08 = 0x0100, Reserved07 = 0x0080,
Reserved06 = 0x0040, Reserved05 = 0x0020, Reserved04 = 0x0010,
Reserved03 = 0x0008, Reserved02 = 0x0004, Reserved01 = 0x0002,
#pragma warning restore 1591
/// <summary>TRIM is supported</summary>
Trim = 0x0001
@@ -446,9 +426,7 @@ public static class Identify
public enum MajorVersionBit : ushort
{
#pragma warning disable 1591
Reserved15 = 0x8000,
Reserved14 = 0x4000,
Reserved13 = 0x2000,
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
Reserved12 = 0x1000,
#pragma warning restore 1591
/// <summary>ACS-4</summary>
@@ -499,9 +477,7 @@ public static class Identify
/// <summary>Supports NCQ</summary>
NCQ = 0x0100,
#pragma warning disable 1591
Reserved07 = 0x0080,
Reserved06 = 0x0040,
Reserved05 = 0x0020,
Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020,
Reserved04 = 0x0010,
#pragma warning restore 1591
/// <summary>Supports SATA Gen. 3 Signaling Speed (6.0Gb/s)</summary>
@@ -519,15 +495,9 @@ public static class Identify
public enum SATACapabilitiesBit2 : ushort
{
#pragma warning disable 1591
Reserved15 = 0x8000,
Reserved14 = 0x4000,
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved09 = 0x0200,
Reserved08 = 0x0100,
Reserved07 = 0x0080,
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
Reserved12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
Reserved09 = 0x0200, Reserved08 = 0x0100, Reserved07 = 0x0080,
#pragma warning restore 1591
/// <summary>Supports RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED</summary>
FPDMAQ = 0x0040,
@@ -554,14 +524,9 @@ public static class Identify
public enum SATAFeaturesBit : ushort
{
#pragma warning disable 1591
Reserved15 = 0x8000,
Reserved14 = 0x4000,
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved09 = 0x0200,
Reserved08 = 0x0100,
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
Reserved12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
Reserved09 = 0x0200, Reserved08 = 0x0100,
#pragma warning restore 1591
/// <summary>Supports NCQ autosense</summary>
NCQAutoSense = 0x0080,
@@ -590,15 +555,9 @@ public static class Identify
public enum SCTCommandTransportBit : ushort
{
#pragma warning disable 1591
Vendor15 = 0x8000,
Vendor14 = 0x4000,
Vendor13 = 0x2000,
Vendor12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved09 = 0x0200,
Reserved08 = 0x0100,
Reserved07 = 0x0080,
Vendor15 = 0x8000, Vendor14 = 0x4000, Vendor13 = 0x2000,
Vendor12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
Reserved09 = 0x0200, Reserved08 = 0x0100, Reserved07 = 0x0080,
Reserved06 = 0x0040,
#pragma warning restore 1591
/// <summary>SCT Command Transport Data Tables supported</summary>
@@ -620,19 +579,14 @@ public static class Identify
public enum SecurityStatusBit : ushort
{
#pragma warning disable 1591
Reserved15 = 0x8000,
Reserved14 = 0x4000,
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
Reserved12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
Reserved09 = 0x0200,
#pragma warning restore 1591
/// <summary>Maximum security level</summary>
Maximum = 0x0100,
#pragma warning disable 1591
Reserved07 = 0x0080,
Reserved06 = 0x0040,
Reserved07 = 0x0080, Reserved06 = 0x0040,
#pragma warning restore 1591
/// <summary>Supports enhanced security erase</summary>
Enhanced = 0x0020,
@@ -666,14 +620,9 @@ public static class Identify
public enum TransferMode : byte
{
#pragma warning disable 1591
Mode7 = 0x80,
Mode6 = 0x40,
Mode5 = 0x20,
Mode4 = 0x10,
Mode3 = 0x08,
Mode2 = 0x04,
Mode1 = 0x02,
Mode0 = 0x01
Mode7 = 0x80, Mode6 = 0x40, Mode5 = 0x20,
Mode4 = 0x10, Mode3 = 0x08, Mode2 = 0x04,
Mode1 = 0x02, Mode0 = 0x01
#pragma warning restore 1591
}
@@ -686,18 +635,10 @@ public static class Identify
/// <summary>MUST be set</summary>
Set = 0x4000,
#pragma warning disable 1591
Reserved13 = 0x2000,
Reserved12 = 0x1000,
Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved09 = 0x0200,
Reserved08 = 0x0100,
Reserved07 = 0x0080,
Reserved06 = 0x0040,
Reserved05 = 0x0020,
Reserved04 = 0x0010,
Reserved03 = 0x0008,
Reserved02 = 0x0004,
Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800,
Reserved10 = 0x0400, Reserved09 = 0x0200, Reserved08 = 0x0100,
Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020,
Reserved04 = 0x0010, Reserved03 = 0x0008, Reserved02 = 0x0004,
Reserved01 = 0x0002,
#pragma warning restore 1591
/// <summary>Trusted Computing feature set is supported</summary>
@@ -1100,8 +1041,8 @@ public static class Identify
ataId.WWN = DescrambleWWN(ataId.WWN);
ataId.WWNExtension = DescrambleWWN(ataId.WWNExtension);
var buf = new byte[512];
IntPtr ptr = System.Runtime.InteropServices.Marshal.AllocHGlobal(512);
byte[] buf = new byte[512];
nint ptr = System.Runtime.InteropServices.Marshal.AllocHGlobal(512);
System.Runtime.InteropServices.Marshal.StructureToPtr(ataId, ptr, false);
System.Runtime.InteropServices.Marshal.Copy(ptr, buf, 0, 512);
System.Runtime.InteropServices.Marshal.FreeHGlobal(ptr);
@@ -1125,7 +1066,7 @@ public static class Identify
static ulong DescrambleWWN(ulong WWN)
{
byte[] qwb = BitConverter.GetBytes(WWN);
var qword = new byte[8];
byte[] qword = new byte[8];
qword[7] = qwb[1];
qword[6] = qwb[0];
@@ -1143,7 +1084,7 @@ public static class Identify
{
byte[] outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length];
for(var i = 0; i < length; i += 2)
for(int i = 0; i < length; i += 2)
{
outbuf[i] = buffer[offset + i + 1];
outbuf[i + 1] = buffer[offset + i];
@@ -1156,9 +1097,9 @@ public static class Identify
static byte[] ScrambleATAString(string str, int length)
{
var buf = new byte[length];
byte[] buf = new byte[length];
for(var i = 0; i < length; i++)
for(int i = 0; i < length; i++)
buf[i] = 0x20;
if(str is null)
@@ -1168,13 +1109,13 @@ public static class Identify
if(bytes.Length % 2 != 0)
{
var tmp = new byte[bytes.Length + 1];
byte[] tmp = new byte[bytes.Length + 1];
tmp[^1] = 0x20;
Array.Copy(bytes, 0, tmp, 0, bytes.Length);
bytes = tmp;
}
for(var i = 0; i < bytes.Length; i += 2)
for(int i = 0; i < bytes.Length; i += 2)
{
buf[i] = bytes[i + 1];
buf[i + 1] = bytes[i];

View File

@@ -30,10 +30,10 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
using System.Diagnostics.CodeAnalysis;
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
/// <summary>List of known SCSI peripheral qualifiers</summary>
public enum PeripheralQualifiers : byte
{

View File

@@ -36,13 +36,13 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Aaru.Console;
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
/// <summary>
/// Information from the following standards: T9/375-D revision 10l T10/995-D revision 10 T10/1236-D revision 20
/// T10/1416-D revision 23 T10/1731-D revision 16 T10/502 revision 05 RFC 7144 ECMA-111
@@ -469,8 +469,8 @@ public struct Inquiry
decoded.VersionDescriptors = new ushort[descriptorsNo];
for(var i = 0; i < descriptorsNo; i++)
decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + i * 2);
for(int i = 0; i < descriptorsNo; i++)
decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + (i * 2));
}
switch(SCSIInquiryResponse.Length)
@@ -522,8 +522,8 @@ public struct Inquiry
Inquiry decoded = inq.Value;
var buffer = new byte[512];
byte length = 0;
byte[] buffer = new byte[512];
byte length = 0;
buffer[0] = (byte)(decoded.PeripheralQualifier << 5);
buffer[0] += decoded.PeripheralDeviceType;
@@ -686,8 +686,7 @@ public struct Inquiry
Array.Copy(decoded.Seagate_DriveSerialNumber, 0, buffer, 36, 8);
}
if(decoded.KreonIdentifier != null &&
decoded.KreonVersion != null)
if(decoded is { KreonIdentifier: {}, KreonVersion: {} })
{
length = 46;
Array.Copy(decoded.KreonIdentifier, 0, buffer, 36, 5);
@@ -717,8 +716,7 @@ public struct Inquiry
Array.Copy(decoded.HiMDSpecific, 0, buffer, 44, 12);
}
if(decoded.VendorSpecific != null &&
!decoded.IsHiMD)
if(decoded is { VendorSpecific: {}, IsHiMD: false })
{
length = 56;
Array.Copy(decoded.VendorSpecific, 0, buffer, 36, 20);
@@ -748,10 +746,10 @@ public struct Inquiry
if(decoded.VersionDescriptors != null)
{
length = (byte)(58 + decoded.VersionDescriptors.Length * 2);
length = (byte)(58 + (decoded.VersionDescriptors.Length * 2));
for(var i = 0; i < decoded.VersionDescriptors.Length; i++)
Array.Copy(BitConverter.GetBytes(decoded.VersionDescriptors[i]), 0, buffer, 56 + i * 2, 2);
for(int i = 0; i < decoded.VersionDescriptors.Length; i++)
Array.Copy(BitConverter.GetBytes(decoded.VersionDescriptors[i]), 0, buffer, 56 + (i * 2), 2);
}
if(decoded.Reserved5 != null)
@@ -779,7 +777,7 @@ public struct Inquiry
}
buffer[4] = length;
var dest = new byte[length];
byte[] dest = new byte[length];
Array.Copy(buffer, 0, dest, 0, length);
return dest;

View File

@@ -30,13 +30,13 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
#region Mode Page 0x2A: CD-ROM capabilities page
/// <summary>
/// CD-ROM capabilities page Page code 0x2A 16 bytes in OB-U0077C 20 bytes in SFF-8020i 22 bytes in MMC-1 26 bytes
@@ -263,14 +263,14 @@ public class ModePage_2A
decoded.RotationControlSelected = (byte)(pageResponse[27] & 0x03);
decoded.CurrentWriteSpeedSelected = (ushort)((pageResponse[28] << 8) + pageResponse[29]);
var descriptors = (ushort)((pageResponse.Length - 32) / 4);
ushort descriptors = (ushort)((pageResponse.Length - 32) / 4);
decoded.WriteSpeedPerformanceDescriptors = new ModePage_2A_WriteDescriptor[descriptors];
for(var i = 0; i < descriptors; i++)
for(int i = 0; i < descriptors; i++)
decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor
{
RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07),
WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4])
RotationControl = (byte)(pageResponse[1 + 32 + (i * 4)] & 0x07),
WriteSpeed = (ushort)((pageResponse[2 + 32 + (i * 4)] << 8) + pageResponse[3 + 32 + (i * 4)])
};
return decoded;
@@ -281,8 +281,8 @@ public class ModePage_2A
/// <returns>Raw page 2Ah</returns>
public static byte[] Encode(ModePage_2A decoded)
{
var pageResponse = new byte[512];
byte length = 16;
byte[] pageResponse = new byte[512];
byte length = 16;
pageResponse[0] = 0x2A;
@@ -480,20 +480,20 @@ public class ModePage_2A
{
length = 32;
for(var i = 0; i < decoded.WriteSpeedPerformanceDescriptors.Length; i++)
for(int i = 0; i < decoded.WriteSpeedPerformanceDescriptors.Length; i++)
{
length += 4;
pageResponse[1 + 32 + i * 4] = decoded.WriteSpeedPerformanceDescriptors[i].RotationControl;
length += 4;
pageResponse[1 + 32 + (i * 4)] = decoded.WriteSpeedPerformanceDescriptors[i].RotationControl;
pageResponse[2 + 32 + i * 4] =
pageResponse[2 + 32 + (i * 4)] =
(byte)((decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF00) >> 8);
pageResponse[3 + 32 + i * 4] = (byte)(decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF);
pageResponse[3 + 32 + (i * 4)] = (byte)(decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF);
}
}
pageResponse[1] = (byte)(length - 2);
var buf = new byte[length];
byte[] buf = new byte[length];
Array.Copy(pageResponse, 0, buf, 0, length);
return buf;

View File

@@ -37,12 +37,12 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Structs;
using System;
using System.Runtime.InteropServices;
using Newtonsoft.Json;
namespace Aaru.CommonTypes.Structs;
/// <summary>File attributes.</summary>
[Flags]
public enum FileAttributes : ulong

View File

@@ -36,14 +36,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.CommonTypes.Structs;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.CommonTypes.Structs;
/// <summary>Contains information about a dump image and its contents</summary>
public struct ImageInfo
{