/***************************************************************************
FileSystem identifier and checker
----------------------------------------------------------------------------
Filename : ImagePlugin.cs
Version : 1.0
Author(s) : Natalia Portillo
Component : Disc image plugins
Revision : $Revision$
Last change by : $Author$
Date : $Date$
--[ Description ] ----------------------------------------------------------
Defines functions to be used by disc image plugins and several constants.
--[ License ] --------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
----------------------------------------------------------------------------
Copyright (C) 2011-2014 Claunia.com
****************************************************************************/
//$Id$
using System;
using System.Collections.Generic;
namespace FileSystemIDandChk.ImagePlugins
{
public abstract class ImagePlugin
{
public string Name;
public Guid PluginUUID;
protected ImagePlugin()
{
}
// Basic image handling functions
public abstract bool IdentifyImage(string imagePath);
// Returns true if the plugin can handle the given image file
public abstract bool OpenImage(string imagePath);
// Initialize internal plugin structures to handle image
public abstract bool ImageHasPartitions();
// Image has different partitions (sessions, tracks)
// Image size functions
public abstract UInt64 GetImageSize();
// Returns image size, without headers, in bytes
public abstract UInt64 GetSectors();
// Returns image size in sectors
public abstract UInt32 GetSectorSize();
// Returns sector size in bytes (user data only)
// Image reading functions
public abstract byte[] ReadDiskTag(DiskTagType tag);
// Gets a disk tag
public abstract byte[] ReadSector(UInt64 sectorAddress);
// Reads a sector (user data only)
public abstract byte[] ReadSectorTag(UInt64 sectorAddress, SectorTagType tag);
// Reads specified tag from sector
public abstract byte[] ReadSector(UInt64 sectorAddress, UInt32 track);
// Reads a sector (user data only), relative to track
public abstract byte[] ReadSectorTag(UInt64 sectorAddress, UInt32 track, SectorTagType tag);
// Reads specified tag from sector
public abstract byte[] ReadSectors(UInt64 sectorAddress, UInt32 length);
// Reads sector (user data only)
public abstract byte[] ReadSectorsTag(UInt64 sectorAddress, UInt32 length, SectorTagType tag);
// Reads specified tag from sector
public abstract byte[] ReadSectors(UInt64 sectorAddress, UInt32 length, UInt32 track);
// Reads a sector (user data only), relative to track
public abstract byte[] ReadSectorsTag(UInt64 sectorAddress, UInt32 length, UInt32 track, SectorTagType tag);
// Reads specified tag from sector, relative to track
public abstract byte[] ReadSectorLong(UInt64 sectorAddress);
// Reads a sector (user data + tags)
public abstract byte[] ReadSectorLong(UInt64 sectorAddress, UInt32 track);
// Reads a sector (user data + tags), relative to track
public abstract byte[] ReadSectorsLong(UInt64 sectorAddress, UInt32 length);
// Reads sector (user data + tags)
public abstract byte[] ReadSectorsLong(UInt64 sectorAddress, UInt32 length, UInt32 track);
// Reads sectors (user data + tags), relative to track
// Image information functions
public abstract string GetImageFormat();
// Gets image format
public abstract string GetImageVersion();
// Gets format's version
public abstract string GetImageApplication();
// Gets application that created this image
public abstract string GetImageApplicationVersion();
// Gets application version
public abstract string GetImageCreator();
// Gets image creator (person)
public abstract DateTime GetImageCreationTime();
// Gets image creation time
public abstract DateTime GetImageLastModificationTime();
// Gets image last modification time
public abstract string GetImageName();
// Gets image name
public abstract string GetImageComments();
// Gets image comments
// Functions to get information from disk represented by image
public abstract string GetDiskManufacturer();
// Gets disk manufacturer
public abstract string GetDiskModel();
// Gets disk model
public abstract string GetDiskSerialNumber();
// Gets disk serial number
public abstract string GetDiskBarcode();
// Gets disk (or product)
public abstract string GetDiskPartNumber();
// Gets disk part no. as manufacturer set
public abstract DiskType GetDiskType();
// Gets disk type
public abstract int GetDiskSequence();
// Gets disk sequence number, 1-starting
public abstract int GetLastDiskSequence();
// Gets last disk sequence number
// Functions to get information from drive used to create image
public abstract string GetDriveManufacturer();
// Gets drive manufacturer
public abstract string GetDriveModel();
// Gets drive model
public abstract string GetDriveSerialNumber();
// Gets drive serial number
// Partitioning functions
public abstract List GetPartitions();
// Returns disc partitions, tracks, sessions, as partition extents
public abstract List