[AaruFormat] Implement Identify.

This commit is contained in:
2025-10-11 16:29:58 +01:00
parent a4ec143c8b
commit f2b421a6b3
2 changed files with 27 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Images;
public sealed partial class AaruFormat
{
#region IWritableOpticalImage Members
/// <inheritdoc />
public bool Identify(IFilter imageFilter)
{
string imagePath = imageFilter.BasePath;
int ret = aaruf_identify(imagePath);
return ret >= 100;
}
#endregion
// AARU_EXPORT int AARU_CALL aaruf_identify(const char *filename)
[LibraryImport("libaaruformat", EntryPoint = "aaruf_identify", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvStdcall)])]
private static partial int aaruf_identify(string filename);
}

View File

@@ -22,9 +22,6 @@ public sealed partial class AaruFormat
#region IWritableOpticalImage Members
/// <inheritdoc />
public bool Identify(IFilter imageFilter) => throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber Open(IFilter imageFilter) => throw new NotImplementedException();