// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : IWritableImage.cs // Author(s) : Natalia Portillo // // Component : Disc image plugins. // // --[ Description ] ---------------------------------------------------------- // // Defines interface to be implemented by writable image plugins. // // --[ 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 . // // ---------------------------------------------------------------------------- // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ using System; using System.Collections.Generic; using DiscImageChef.CommonTypes; namespace DiscImageChef.DiscImages { /// /// Abstract class to implement disk image writing plugins. /// TODO: This interface is subject to change until notice. /// public interface IWritableImage : IMediaImage { /// /// Gets a list of that are supported by the media image format /// IEnumerable SupportedMediaTags { get; } /// /// Gets a list of that are supported by the media image format /// IEnumerable SupportedSectorTags { get; } /// /// Gets a list of that are supported by the media image format /// IEnumerable SupportedMediaTypes { get; } /// /// Retrieves a list of options supported by the filesystem, with name, type and description /// IEnumerable<(string name, Type type, string description)> SupportedOptions { get; } /// /// Gets a list of known extensions for format auto-chosing /// IEnumerable KnownExtensions { get; } bool IsWriting { get; } string ErrorMessage { get; } /// /// Creates a new image in the specified path, for the specified , with the /// specified options to hold a media with the specified number of sectors /// /// Path to the new image, with extension /// that will be written in the image /// Options to be used when creating new image /// How many sectors the media has. /// true if operating completed successfully, false otherwise bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors); /// /// Writes a media tag to the image /// /// Media tag /// /// /// /// true if operating completed successfully, false otherwise bool WriteMediaTag(byte[] data, MediaTagType tag); /// /// Writes a sector to the image /// /// Sector data /// Sector address /// true if operating completed successfully, false otherwise bool WriteSector(byte[] data, ulong sectorAddress); /// /// Writes several sectors to the image /// /// Sectors data /// Sector starting address /// How many sectors to write /// true if operating completed successfully, false otherwise bool WriteSectors(byte[] data, ulong sectorAddress, uint length); /// /// Writes a sector to the image with tags attached /// /// Sector data with its tags attached /// Sector address /// true if operating completed successfully, false otherwise bool WriteSectorLong(byte[] data, ulong sectorAddress); /// /// Writes several sectors to the image /// /// Sector data with their tags attached /// Sector starting address /// How many sectors to write /// true if operating completed successfully, false otherwise bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length); /// /// Sets tracks for optical media /// /// List of tracks /// true if operating completed successfully, false otherwise bool SetTracks(List tracks); /// /// Closes and flushes to disk the image /// /// true if operating completed successfully, false otherwise bool Close(); /// /// Sets image metadata /// /// containing image metadata /// true if operating completed successfully, false otherwise bool SetMetadata(ImageInfo metadata); } }