From 1003088cc36b21164ea92e3b6ae3dff6c908bd18 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 22 Oct 2025 02:01:59 +0100 Subject: [PATCH] Move SectorStatus from AaruFormat to CommonTypes. --- Aaru.CommonTypes/Enums/SectorStatus.cs | 90 ++++++++++++++++++++++++++ Aaru.Images/AaruFormat/Enums.cs | 52 --------------- 2 files changed, 90 insertions(+), 52 deletions(-) create mode 100644 Aaru.CommonTypes/Enums/SectorStatus.cs diff --git a/Aaru.CommonTypes/Enums/SectorStatus.cs b/Aaru.CommonTypes/Enums/SectorStatus.cs new file mode 100644 index 000000000..0c30ceb75 --- /dev/null +++ b/Aaru.CommonTypes/Enums/SectorStatus.cs @@ -0,0 +1,90 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : SectorStatus.cs +// Author(s) : Natalia Portillo +// +// Component : Common types. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines enumerations of sector status. +// +// --[ License ] -------------------------------------------------------------- +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2025 Natalia Portillo +// ****************************************************************************/ + +namespace Aaru.CommonTypes.Enums; + +/// +/// Sector status. Same as in libaaruformat. +/// +public enum SectorStatus : byte +{ + /// + /// Sector(s) not yet acquired during image dumping. + /// + NotDumped = 0x0, + /// + /// Sector(s) successfully dumped without error. + /// + Dumped = 0x1, + /// + /// Error during dumping; data may be incomplete or corrupt. + /// + Errored = 0x2, + /// + /// Valid MODE 1 data with regenerable suffix/prefix. + /// + Mode1Correct = 0x3, + /// + /// Suffix verified/regenerable for MODE 2 Form 1. + /// + Mode2Form1Ok = 0x4, + /// + /// Suffix matches MODE 2 Form 2 with valid CRC. + /// + Mode2Form2Ok = 0x5, + /// + /// Suffix matches MODE 2 Form 2 but CRC empty/missing. + /// + Mode2Form2NoCrc = 0x6, + /// + /// Pointer references a twin sector table. + /// + Twin = 0x7, + /// + /// Sector physically unrecorded; repeated reads non-deterministic. + /// + Unrecorded = 0x8, + /// + /// Content encrypted and stored encrypted in image. + /// + Encrypted = 0x9, + /// + /// Content originally encrypted but stored decrypted in image. + /// + Unencrypted = 0xA +} \ No newline at end of file diff --git a/Aaru.Images/AaruFormat/Enums.cs b/Aaru.Images/AaruFormat/Enums.cs index 77777b53a..7a366d58d 100644 --- a/Aaru.Images/AaruFormat/Enums.cs +++ b/Aaru.Images/AaruFormat/Enums.cs @@ -45,58 +45,6 @@ public sealed partial class AaruFormat #endregion -#region Nested type: SectorStatus - - enum SectorStatus : byte - { - /// - /// Sector(s) not yet acquired during image dumping. - /// - NotDumped = 0x0, - /// - /// Sector(s) successfully dumped without error. - /// - Dumped = 0x1, - /// - /// Error during dumping; data may be incomplete or corrupt. - /// - Errored = 0x2, - /// - /// Valid MODE 1 data with regenerable suffix/prefix. - /// - Mode1Correct = 0x3, - /// - /// Suffix verified/regenerable for MODE 2 Form 1. - /// - Mode2Form1Ok = 0x4, - /// - /// Suffix matches MODE 2 Form 2 with valid CRC. - /// - Mode2Form2Ok = 0x5, - /// - /// Suffix matches MODE 2 Form 2 but CRC empty/missing. - /// - Mode2Form2NoCrc = 0x6, - /// - /// Pointer references a twin sector table. - /// - Twin = 0x7, - /// - /// Sector physically unrecorded; repeated reads non-deterministic. - /// - Unrecorded = 0x8, - /// - /// Content encrypted and stored encrypted in image. - /// - Encrypted = 0x9, - /// - /// Content originally encrypted but stored decrypted in image. - /// - Unencrypted = 0xA - } - -#endregion - #region Nested type: Status ///