// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : IFloppyImage.cs // Author(s) : Natalia Portillo // // Component : Disc image plugins. // // --[ Description ] ---------------------------------------------------------- // // Defines the interface to be implemented by floppy image plugins. // // --[ License ] -------------------------------------------------------------- // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // ---------------------------------------------------------------------------- // Copyright © 2011-2021 Natalia Portillo // ****************************************************************************/ using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Structs; namespace Aaru.CommonTypes.Interfaces { /// /// /// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is /// needed because floppy formatting characteristics are not necessarily compatible with the whole LBA-oriented /// interface defined by . All data expected by these methods /// is already decoded from its corresponding bitstream. /// public interface IWritableFloppyImage : IFloppyImage, IWritableImage { /// /// Indicates the image plugin the floppy physical characteristics and must be called before following methods are /// called. Once this is called, LBA-based methods should not be used. /// /// /// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, /// track density, etc... /// /// true if operating completed successfully, false otherwise bool SetFloppyCharacteristics(FloppyInfo info); /// Writes a sector's user data. /// /// If is one of the duplicates. If /// is , , /// it will be ignored. Otherwise, whatever data should be in the sector. /// /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// Logical sector ID. /// Status of sector. /// true if operating completed successfully, false otherwise bool WriteSector(byte[] data, ushort track, byte head, ushort sector, FloppySectorStatus status); /// Writes a whole track, including all gaps, address marks, sectors data, etc. /// The track data. /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// true if operating completed successfully, false otherwise bool WriteTrack(byte[] data, ushort track, byte head); /// Writes a sector's data including all tags, address mark, and so, in a format dependent of represented media. /// /// If is one of the duplicates. If /// is , , /// it will be ignored. Otherwise, whatever data should be in the sector. /// /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// Logical sector ID. /// Status of request. /// true if operating completed successfully, false otherwise bool WriteSectorLong(byte[] data, ushort track, byte head, ushort sector, out FloppySectorStatus status); } }