General code refactor.

This commit is contained in:
2021-08-17 21:23:22 +01:00
parent 874a3d4bcb
commit d3451f3e4d
54 changed files with 934 additions and 1349 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -54,81 +54,81 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System"/>
</ItemGroup>
<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="Exceptions\Images.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\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" />
<Compile Include="Delegates.cs"/>
<Compile Include="Enums\DeviceType.cs"/>
<Compile Include="Enums\ErrorNumber.cs"/>
<Compile Include="Enums\Images.cs"/>
<Compile Include="Exceptions\Images.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\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="12.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0" PrivateAssets="all" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0"/>
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0"/>
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0" PrivateAssets="all"/>
</ItemGroup>
<ItemGroup>
<Content Include="..\LICENSE.MIT">
@@ -136,39 +136,39 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj" />
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj" />
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<StandardHeader IncludeInNewFiles="True" Text="/***************************************************************************&#xA;Aaru Data Preservation Suite&#xA;----------------------------------------------------------------------------&#xA; &#xA;Filename : ${FileName}&#xA;Author(s) : ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;Component : Component&#xA; &#xA;--[ Description ] ----------------------------------------------------------&#xA; &#xA; Description&#xA; &#xA;--[ License ] --------------------------------------------------------------&#xA; &#xA; This library is free software; you can redistribute it and/or modify&#xA; it under the terms of the GNU Lesser General Public License as&#xA; published by the Free Software Foundation; either version 2.1 of the&#xA; License, or (at your option) any later version.&#xA;&#xA; This library is distributed in the hope that it will be useful, but&#xA; WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU&#xA; Lesser General Public License for more details.&#xA;&#xA; You should have received a copy of the GNU Lesser General Public&#xA; License along with this library; if not, see &lt;http://www.gnu.org/licenses/&gt;.&#xA;&#xA;----------------------------------------------------------------------------&#xA;Copyright © 2011-${Year} ${CopyrightHolder}&#xA;****************************************************************************/" />
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp" />
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp" />
<StandardHeader IncludeInNewFiles="True" Text="/***************************************************************************&#xA;Aaru Data Preservation Suite&#xA;----------------------------------------------------------------------------&#xA; &#xA;Filename : ${FileName}&#xA;Author(s) : ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;Component : Component&#xA; &#xA;--[ Description ] ----------------------------------------------------------&#xA; &#xA; Description&#xA; &#xA;--[ License ] --------------------------------------------------------------&#xA; &#xA; This library is free software; you can redistribute it and/or modify&#xA; it under the terms of the GNU Lesser General Public License as&#xA; published by the Free Software Foundation; either version 2.1 of the&#xA; License, or (at your option) any later version.&#xA;&#xA; This library is distributed in the hope that it will be useful, but&#xA; WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU&#xA; Lesser General Public License for more details.&#xA;&#xA; You should have received a copy of the GNU Lesser General Public&#xA; License along with this library; if not, see &lt;http://www.gnu.org/licenses/&gt;.&#xA;&#xA;----------------------------------------------------------------------------&#xA;Copyright © 2011-${Year} ${CopyrightHolder}&#xA;****************************************************************************/"/>
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp"/>
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp"/>
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net40'">$(BaseFrameworkPathOverrideForMono)/4.0-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net45'">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net451'">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net452'">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net46'">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net461'">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net462'">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net47'">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net471'">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net40'">$(BaseFrameworkPathOverrideForMono)/4.0-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net45'">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net451'">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net452'">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net46'">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net461'">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net462'">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net47'">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net471'">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>
</Project>

View File

@@ -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>
ATA = 1,
/// <summary>
/// ATA Packet device (aka SCSI over ATA)
/// </summary>
/// <summary>ATA device</summary>
ATA = 1,
/// <summary>ATA Packet device (aka SCSI over ATA)</summary>
ATAPI = 2,
/// <summary>
/// SCSI device (or USB-MSC, SBP2, FC, UAS, etc)
/// </summary>
SCSI = 3,
/// <summary>
/// SecureDigital memory card
/// </summary>
/// <summary>SCSI device (or USB-MSC, SBP2, FC, UAS, etc)</summary>
SCSI = 3,
/// <summary>SecureDigital memory card</summary>
SecureDigital = 4,
/// <summary>
/// MultiMediaCard memory card
/// </summary>
MMC = 5,
/// <summary>
/// NVMe device
/// </summary>
NVMe = 6
/// <summary>MultiMediaCard memory card</summary>
MMC = 5,
/// <summary>NVMe device</summary>
NVMe = 6
}
}

View File

@@ -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>
CanStoreDataTracks = 0x03,
/// <summary>
/// Can store pregaps without needing to interpret the subchannel?
/// </summary>
CanStorePregaps = 0x04,
/// <summary>
/// Can store indexes without needing to interpret the subchannel?
/// </summary>
CanStoreIndexes = 0x08,
/// <summary>
/// Can store raw P to W subchannel data?
/// </summary>
CanStoreSubchannelRw = 0x10,
/// <summary>
/// Can store more than one session?
/// </summary>
CanStoreSessions = 0x20,
/// <summary>
/// Can store track ISRCs without needing to interpret the subchannel?
/// </summary>
CanStoreIsrc = 0x40,
/// <summary>
/// Can store Lead-In's CD-TEXT?
/// </summary>
CanStoreCdText = 0x80,
/// <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>
CanStoreRawData = 0x200,
/// <summary>
/// Can store more than 1 session in media that is not CD based (DVD et al)?
/// </summary>
/// <summary>Can store Yellow Book data tracks?</summary>
CanStoreDataTracks = 0x03,
/// <summary>Can store pregaps without needing to interpret the subchannel?</summary>
CanStorePregaps = 0x04,
/// <summary>Can store indexes without needing to interpret the subchannel?</summary>
CanStoreIndexes = 0x08,
/// <summary>Can store raw P to W subchannel data?</summary>
CanStoreSubchannelRw = 0x10,
/// <summary>Can store more than one session?</summary>
CanStoreSessions = 0x20,
/// <summary>Can store track ISRCs without needing to interpret the subchannel?</summary>
CanStoreIsrc = 0x40,
/// <summary>Can store Lead-In's CD-TEXT?</summary>
CanStoreCdText = 0x80,
/// <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>
CanStoreRawData = 0x200,
/// <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
}
}

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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; }

View File

@@ -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
{

View File

@@ -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>

View File

@@ -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>
@@ -86,4 +84,4 @@ namespace Aaru.CommonTypes.Interfaces
/// <returns>List of archive plugins</returns>
List<Type> GetAllArchivePlugins();
}
}
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
bool IsWriting { get; }
/// <summary>
/// Contains a description of the last error
/// </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>
string ErrorMessage { get; }
/// <summary>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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()
{

View File

@@ -40,6 +40,7 @@
// TODO: Rename contents
using System;
#pragma warning disable 1591
// ReSharper disable UnusedMember.Global

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
public string Model { get; set; }
/// <summary>
/// Reading offset
/// </summary>
public short Offset { get; set; }
/// <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>Drive model</summary>
public string Model { get; set; }
/// <summary>Reading offset</summary>
public short Offset { get; set; }
/// <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>
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:P0}")]
public float Agreement { get; set; }
}

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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>
public bool Removable;
/// <summary>
/// Is media a tape?
/// </summary>
public bool Tape;
/// <summary>
/// List of CD subchannels that did not read correctly
/// </summary>
/// <summary>Is media removable?</summary>
public bool Removable;
/// <summary>Is media a tape?</summary>
public bool Tape;
/// <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;
}

View File

@@ -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
{
@@ -75,50 +74,46 @@ namespace Aaru.CommonTypes.Metadata
public List<DeviceStats> Devices { get; set; }
/// <summary>Found media types, real, and in image</summary>
[XmlArrayItem("Media")]
public List<MediaStats> Medias { get; set; }
public List<MediaStats> Medias { get; set; }
/// <summary>Benchmark statistics</summary>
public BenchmarkStats Benchmark { get; set; }
/// <summary>Media scanning statistics</summary>
public MediaScanStats MediaScan { get; set; }
/// <summary>Image verification statistics</summary>
public VerifyStats Verify { get; set; }
public VerifyStats Verify { get; set; }
}
/// <summary>
/// DTO for statistics
/// </summary>
/// <summary>DTO for statistics</summary>
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
public class StatsDto
{
/// <summary>Executed commands</summary>
public List<NameValueStats> Commands { get; set; }
public List<NameValueStats> Commands { get; set; }
/// <summary>Operating systems Aaru has run from</summary>
public List<OsStats> OperatingSystems { get; set; }
public List<OsStats> OperatingSystems { get; set; }
/// <summary>Aaru versions</summary>
public List<NameValueStats> Versions { get; set; }
public List<NameValueStats> Versions { get; set; }
/// <summary>Detected filesystems</summary>
public List<NameValueStats> Filesystems { get; set; }
public List<NameValueStats> Filesystems { get; set; }
/// <summary>Detected partitioning schemes</summary>
public List<NameValueStats> Partitions { get; set; }
public List<NameValueStats> Partitions { get; set; }
/// <summary>Media image formats</summary>
public List<NameValueStats> MediaFormats { get; set; }
public List<NameValueStats> MediaFormats { get; set; }
/// <summary>Used filters</summary>
public List<NameValueStats> Filters { get; set; }
public List<NameValueStats> Filters { get; set; }
/// <summary>Found devices</summary>
public List<DeviceStats> Devices { get; set; }
public List<DeviceStats> Devices { get; set; }
/// <summary>Found media types, real, and in image</summary>
public List<MediaStats> Medias { get; set; }
public List<MediaStats> Medias { get; set; }
/// <summary>Remote applications</summary>
public List<OsStats> RemoteApplications { get; set; }
public List<OsStats> RemoteApplications { get; set; }
/// <summary>Remote application architectures</summary>
public List<NameValueStats> RemoteArchitectures { get; set; }
public List<NameValueStats> RemoteArchitectures { get; set; }
/// <summary>Operating systems where a remote application has been running</summary>
public List<OsStats> RemoteOperatingSystems { get; set; }
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>
public VerifiedItems MediaImages;
/// <summary>
/// Image contents verification statistics
/// </summary>
/// <summary>Image verification statistics</summary>
public VerifiedItems MediaImages;
/// <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>
public TimeStats Times;
/// <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>
public long MaxMemory;
/// <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>Maximum amount of memory used while running the benchmark</summary>
public long MaxMemory;
/// <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>
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>
public string Model { get; set; }
/// <summary>
/// Revision or firmware version
/// </summary>
public string Revision { get; set; }
/// <summary>
/// Bus the device was attached to
/// </summary>
public string Bus { get; set; }
/// <summary>Model string</summary>
public string Model { get; set; }
/// <summary>Revision or firmware version</summary>
public string Revision { get; set; }
/// <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; }
}

View File

@@ -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>

View File

@@ -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();

View File

@@ -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)
{
@@ -148,4 +146,4 @@ namespace Aaru.CommonTypes
Archives.Add(plugin.Name.ToLower(), plugin);
}
}
}
}

View File

@@ -109,10 +109,10 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
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,
Reserved01 = 0x0002,
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>
SpecificStandbyTimer = 0x0001
@@ -265,7 +265,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
MustBeSet = 0x4000,
#pragma warning disable 1591
Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800,
Reserved10 = 0x0400,
Reserved10 = 0x0400,
#pragma warning restore 1591
/// <summary>DSN feature set is supported</summary>
DSN = 0x0200,
@@ -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
{
@@ -484,7 +478,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
NCQ = 0x0100,
#pragma warning disable 1591
Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020,
Reserved04 = 0x0010,
Reserved04 = 0x0010,
#pragma warning restore 1591
/// <summary>Supports SATA Gen. 3 Signaling Speed (6.0Gb/s)</summary>
Gen3Speed = 0x0008,
@@ -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
{
@@ -654,18 +636,16 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
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,
Reserved01 = 0x0002,
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>
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)

View File

@@ -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>
SCSI2 = 3,
/// <summary>
/// SCSI-3
/// </summary>
/// <summary>SCSI-2</summary>
SCSI2 = 3,
/// <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
{

View File

@@ -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)

View File

@@ -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>
public bool Method2 { get; set; }
/// <summary>
/// Can read CD-RW
/// </summary>
public bool ReadCDRW { get; set; }
/// <summary>
/// Can read CD-R
/// </summary>
public bool ReadCDR { get; set; }
/// <summary>
/// Can write CD-RW
/// </summary>
public bool WriteCDRW { get; set; }
/// <summary>
/// Can write CD-R
/// </summary>
public bool WriteCDR { get; set; }
/// <summary>
/// Supports IEC-958 digital output on port 2
/// </summary>
/// <summary>Can read packet media</summary>
public bool Method2 { get; set; }
/// <summary>Can read CD-RW</summary>
public bool ReadCDRW { get; set; }
/// <summary>Can read CD-R</summary>
public bool ReadCDR { get; set; }
/// <summary>Can write CD-RW</summary>
public bool WriteCDRW { get; set; }
/// <summary>Can write CD-R</summary>
public bool WriteCDR { get; set; }
/// <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>
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>
public bool SSS { get; set; }
/// <summary>Contains a changer that can report the exact contents of the slots</summary>
public bool SDP { get; set; }
/// <summary>Page length</summary>
public byte Length { get; set; }
/// <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>
public bool RCK { get; set; }
/// <summary>
/// Can deliver a composite audio and video data stream
/// 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 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>
public bool SSS { get; set; }
/// <summary>
/// Contains a changer that can report the exact contents of the slots
/// </summary>
public bool SDP { get; set; }
/// <summary>
/// Page length
/// </summary>
public byte Length { get; set; }
/// <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>
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
/// </summary>
public bool BCK { get; set; }
public bool BCK { get; set; }
/// <summary>
/// Can do a test write
/// </summary>
public bool TestWrite { get; set; }
/// <summary>
/// Maximum write speed
/// </summary>
public ushort MaxWriteSpeed { get; set; }
/// <summary>
/// Current write speed
/// </summary>
/// <summary>Can do a test write</summary>
public bool TestWrite { get; set; }
/// <summary>Maximum write speed</summary>
public ushort MaxWriteSpeed { get; set; }
/// <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>
public bool ReadDVDRAM { get; set; }
/// <summary>
/// Can read DVD-R
/// </summary>
public bool ReadDVDR { get; set; }
/// <summary>
/// Can read DVD-ROM
/// </summary>
public bool ReadDVDROM { get; set; }
/// <summary>
/// Can write DVD-RAM
/// </summary>
public bool WriteDVDRAM { get; set; }
/// <summary>
/// Can write DVD-R
/// </summary>
public bool WriteDVDR { get; set; }
/// <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>
public bool SCC { get; set; }
/// <summary>
/// Support copyright management
/// </summary>
/// <summary>Can read DVD-RAM</summary>
public bool ReadDVDRAM { get; set; }
/// <summary>Can read DVD-R</summary>
public bool ReadDVDR { get; set; }
/// <summary>Can read DVD-ROM</summary>
public bool ReadDVDROM { get; set; }
/// <summary>Can write DVD-RAM</summary>
public bool WriteDVDRAM { get; set; }
/// <summary>Can write DVD-R</summary>
public bool WriteDVDR { get; set; }
/// <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>
public bool SCC { get; set; }
/// <summary>Support copyright management</summary>
public ushort CMRSupported { get; set; }
/// <summary>
/// Supports buffer under-run free recording
/// </summary>
public bool BUF { get; set; }
/// <summary>
/// Selected rotational control
/// </summary>
public byte RotationControlSelected { get; set; }
/// <summary>
/// Current write speed selected
/// </summary>
/// <summary>Supports buffer under-run free recording</summary>
public bool BUF { get; set; }
/// <summary>Selected rotational control</summary>
public byte RotationControlSelected { get; set; }
/// <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>
public byte RotationControl;
/// <summary>
/// Write speed
/// </summary>
/// <summary>Rotational control</summary>
public byte RotationControl;
/// <summary>Write speed</summary>
public ushort WriteSpeed;
}
#endregion Mode Page 0x2A: CD-ROM capabilities page

View File

@@ -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;
}

View File

@@ -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>();
}

View File

@@ -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>

View File

@@ -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>