mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[AaruFormat] Implement Identify.
This commit is contained in:
27
Aaru.Images/AaruFormat/Identify.cs
Normal file
27
Aaru.Images/AaruFormat/Identify.cs
Normal 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);
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user