Files
Aaru/Aaru.Images/DiskDupe/Identify.cs

57 lines
2.1 KiB
C#
Raw Normal View History

2021-03-07 18:09:30 +01:00
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Identify.cs
// Author(s) : Michael Drüing <michael@drueing.de>
//
// Component : Disk image plugins.
//
// --[ Description ] ----------------------------------------------------------
//
// Identifies DiskDupe DDI disk images.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2024-12-19 10:45:18 +00:00
// Copyright © 2021-2025 Michael Drüing
// Copyright © 2011-2025 Natalia Portillo
2021-03-07 18:09:30 +01:00
// ****************************************************************************/
using System.IO;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Images;
2022-03-06 13:29:38 +00:00
public sealed partial class DiskDupe
2021-03-07 18:09:30 +01:00
{
2023-10-03 23:34:59 +01:00
#region IMediaImage Members
2022-03-06 13:29:38 +00:00
/// <inheritdoc />
public bool Identify(IFilter imageFilter)
2021-03-07 18:09:30 +01:00
{
2022-03-06 13:29:38 +00:00
Stream stream = imageFilter.GetDataForkStream();
var fHeader = new FileHeader();
TrackInfo[] trackMap = null;
long[] trackOffsets = null;
2021-03-07 18:09:30 +01:00
2022-03-06 13:29:38 +00:00
// TODO: validate the tracks
// For now, having a valid header should be sufficient.
return TryReadHeader(stream, ref fHeader, ref trackMap, ref trackOffsets);
2021-03-07 18:09:30 +01:00
}
2023-10-03 23:34:59 +01:00
#endregion
2021-03-07 18:09:30 +01:00
}