Use Aaru Metadata instead of CICM Metadata.

This commit is contained in:
2022-12-15 22:20:59 +00:00
parent d2c24f9fb1
commit 4cdf541a09
10 changed files with 454 additions and 455 deletions

View File

@@ -78,8 +78,8 @@ public class BlockMedia
public DimensionsNew Dimensions { get; set; }
public List<Partition> FileSystemInformation { get; set; }
public List<DumpHardware> DumpHardware { get; set; }
public string DiskType { get; set; }
public string DiskSubType { get; set; }
public string MediaType { get; set; }
public string MediaSubType { get; set; }
public string Interface { get; set; }
}

View File

@@ -274,8 +274,8 @@ public enum MediaTagType
DVD_DiscKey_Decrypted = 73
}
/// <summary>Enumeration of media types defined in CICM metadata</summary>
public enum XmlMediaType : byte
/// <summary>Enumeration of media types defined in metadata</summary>
public enum MetadataMediaType : byte
{
/// <summary>Purely optical discs</summary>
OpticalDisc = 0,

View File

@@ -39,7 +39,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Schemas;
using Aaru.CommonTypes.AaruMetadata;
namespace Aaru.CommonTypes.Extents;
@@ -49,28 +49,28 @@ public static class ExtentsConverter
/// <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)
public static List<Extent> ToMetadata(ExtentsULong extents)
{
if(extents == null)
return null;
Tuple<ulong, ulong>[] tuples = extents.ToArray();
ExtentType[] array = new ExtentType[tuples.Length];
List<Extent> list = new();
for(ulong i = 0; i < (ulong)array.LongLength; i++)
array[i] = new ExtentType
for(ulong i = 0; i < (ulong)tuples.LongLength; i++)
list.Add(new Extent
{
Start = tuples[i].Item1,
End = tuples[i].Item2
};
});
return array;
return list;
}
/// <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)
public static ExtentsULong FromMetadata(IEnumerable<Extent> extents)
{
if(extents == null)
return null;

View File

@@ -38,9 +38,9 @@
using System;
using System.Collections.Generic;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using Schemas;
namespace Aaru.CommonTypes.Interfaces;
@@ -49,10 +49,10 @@ public interface IBaseImage
{
/// <summary>Plugin author</summary>
string Author { get; }
/// <summary>Gets the CICM XML metadata for the image</summary>
CICMMetadataType CicmMetadata { get; }
/// <summary>Gets the Aaru Metadata for the image</summary>
AaruMetadata.Metadata AaruMetadata { get; }
/// <summary>List of dump hardware used to create the image from real media</summary>
List<DumpHardwareType> DumpHardware { get; }
List<DumpHardware> DumpHardware { get; }
/// <summary>Gets the image format.</summary>
/// <value>The image format.</value>
string Format { get; }

View File

@@ -38,9 +38,9 @@
using System;
using System.Collections.Generic;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using Schemas;
namespace Aaru.CommonTypes.Interfaces;
@@ -79,14 +79,14 @@ public interface IBaseWritableImage : IBaseImage
/// <returns>Error number</returns>
bool Close();
/// <summary>Sets the CICM XML metadata for the image</summary>
bool SetCicmMetadata(CICMMetadataType metadata);
/// <summary>Sets the Aaru Metadata for the image</summary>
bool SetMetadata(AaruMetadata.Metadata metadata);
/// <summary>Sets the list of dump hardware used to create the image from real media</summary>
bool SetDumpHardware(List<DumpHardwareType> dumpHardware);
bool SetDumpHardware(List<DumpHardware> dumpHardware);
/// <summary>Sets image metadata</summary>
/// <param name="metadata"><see cref="ImageInfo" /> containing image metadata</param>
/// <param name="imageInfo"><see cref="ImageInfo" /> containing image metadata</param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool SetMetadata(ImageInfo metadata);
bool SetImageInfo(ImageInfo imageInfo);
}

View File

@@ -38,7 +38,7 @@
using System;
using System.Text;
using Schemas;
using Aaru.CommonTypes.AaruMetadata;
namespace Aaru.CommonTypes.Interfaces;
@@ -51,9 +51,8 @@ public interface IFilesystem
string Name { get; }
/// <summary>Plugin UUID.</summary>
Guid Id { get; }
/// <summary>Information about the filesystem as expected by CICM Metadata XML</summary>
/// <value>Information about the filesystem as expected by CICM Metadata XML</value>
FileSystemType XmlFsType { get; }
/// <summary>Information about the filesystem as expected by Aaru Metadata</summary>
FileSystem Metadata { get; }
/// <summary>Plugin author</summary>
string Author { get; }

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,7 @@ using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
using Schemas;
using Aaru.CommonTypes.AaruMetadata;
namespace Aaru.CommonTypes.Metadata;
@@ -76,11 +76,11 @@ public class Resume
public List<int> BadSubchannels;
/// <summary>Extents of BLANK sectors for magneto-opticals</summary>
[XmlArrayItem("Extent")]
public ExtentType[] BlankExtents;
public Extent[] BlankExtents;
/// <summary>Title keys that has not been read</summary>
[XmlArrayItem("Block")]
public List<ulong> MissingTitleKeys;
/// <summary>List of dump tries</summary>
[XmlArrayItem("DumpTry")]
public List<DumpHardwareType> Tries;
public List<DumpHardware> Tries;
}

View File

@@ -36,8 +36,8 @@
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Interop;
using Schemas;
namespace Aaru.CommonTypes.Metadata;
@@ -46,7 +46,7 @@ public static class Version
{
/// <summary>Gets XML software type for the running version</summary>
/// <returns>XML software type</returns>
public static SoftwareType GetSoftwareType() => new()
public static Software GetSoftware() => new()
{
Name = "Aaru",
OperatingSystem = DetectOS.GetRealPlatformID().ToString(),

View File

@@ -102,7 +102,7 @@ public struct ImageInfo
/// <summary>Firmware revision of the drive used to read the media represented by the image</summary>
public string DriveFirmwareRevision;
/// <summary>Type of the media represented by the image to use in XML sidecars</summary>
public XmlMediaType XmlMediaType;
public MetadataMediaType MetadataMediaType;
// CHS geometry...
/// <summary>Cylinders of the media represented by the image</summary>