mirror of
https://github.com/aaru-dps/Aaru.CommonTypes.git
synced 2025-12-16 11:14:29 +00:00
Use Aaru Metadata instead of CICM Metadata.
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
@@ -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(),
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user