diff --git a/Aaru.Archives/Register.cs b/Aaru.Archives/Register.cs index 0859cd6b2..ecf7f4c94 100644 --- a/Aaru.Archives/Register.cs +++ b/Aaru.Archives/Register.cs @@ -46,30 +46,41 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.Archives { + /// public sealed class Register : IPluginRegister { + /// public List GetAllChecksumPlugins() => null; + /// public List GetAllFilesystemPlugins() => null; + /// public List GetAllFilterPlugins() => null; + /// public List GetAllFloppyImagePlugins() => null; + /// public List GetAllMediaImagePlugins() => null; + /// public List GetAllPartitionPlugins() => null; + /// public List GetAllReadOnlyFilesystemPlugins() => null; + /// public List GetAllWritableFloppyImagePlugins() => null; + /// public List GetAllWritableImagePlugins() => null; + /// public List GetAllArchivePlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). - Contains(typeof(IArchive - ))).Where(t => t.IsClass). + Contains(typeof(IArchive + ))).Where(t => t.IsClass). ToList(); } } diff --git a/Aaru.Checksums b/Aaru.Checksums index b7f3192ef..8ca59cbcd 160000 --- a/Aaru.Checksums +++ b/Aaru.Checksums @@ -1 +1 @@ -Subproject commit b7f3192eff12ad1be41f272395258497bb576a38 +Subproject commit 8ca59cbcd0a4a9a2740ea11531937bc26965d4b2 diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 433bed214..fb6e3cf36 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 433bed2145dec49dfdff0bfe620702ad67d38136 +Subproject commit fb6e3cf36116dac98001f505c131c64ac59e481c diff --git a/Aaru.Compression/AppleRle.cs b/Aaru.Compression/AppleRle.cs index 8448aa7ec..64d59d744 100644 --- a/Aaru.Compression/AppleRle.cs +++ b/Aaru.Compression/AppleRle.cs @@ -35,6 +35,9 @@ using System.IO; namespace Aaru.Compression { + /// + /// Implements the Apple version of RLE + /// public class AppleRle { const uint DART_CHUNK = 20960; @@ -45,6 +48,10 @@ namespace Aaru.Compression byte _repeatedByteA, _repeatedByteB; bool _repeatMode; // true if we're repeating, false if we're just copying + /// + /// Initializes a decompressor for the specified stream + /// + /// Stream containing the compressed data public AppleRle(Stream stream) { _inStream = stream; @@ -59,6 +66,10 @@ namespace Aaru.Compression _repeatMode = false; } + /// + /// Decompresses a byte + /// + /// Decompressed byte public int ProduceByte() { if(_repeatMode && _count > 0) diff --git a/Aaru.Compression/TeleDiskLzh.cs b/Aaru.Compression/TeleDiskLzh.cs index 641d48a0c..a64893185 100644 --- a/Aaru.Compression/TeleDiskLzh.cs +++ b/Aaru.Compression/TeleDiskLzh.cs @@ -53,6 +53,9 @@ namespace Aaru.Compression * Adaptive Huffman Coding coded by Haruyasu YOSHIZAKI * Edited and translated to English by Kenji RIKITAKE */ + /// + /// Implements the TeleDisk version of LZH + /// public class TeleDiskLzh { const int BUFSZ = 512; @@ -133,6 +136,10 @@ namespace Aaru.Compression Tdlzhuf _tdctl; + /// + /// Implements the TeleDisk LZH algorithm over the specified stream. + /// + /// Stream with compressed data. public TeleDiskLzh(Stream dataStream) { int i; @@ -156,6 +163,12 @@ namespace Aaru.Compression */ + /// + /// Decompresses data + /// + /// Buffer to write the decompressed data to + /// Number of bytes to decompress + /// Number of decompressed bytes public int Decode(out byte[] buf, int len) /* Decoding/Uncompressing */ { short c; diff --git a/Aaru.Console b/Aaru.Console index 75db40d0e..dc0e013d8 160000 --- a/Aaru.Console +++ b/Aaru.Console @@ -1 +1 @@ -Subproject commit 75db40d0e3f610aca134b9576afe46f757027269 +Subproject commit dc0e013d8d965752bc585013bdb3191cb05ed92e diff --git a/Aaru.Core/Checksum.cs b/Aaru.Core/Checksum.cs index 7674111ab..b68f0df99 100644 --- a/Aaru.Core/Checksum.cs +++ b/Aaru.Core/Checksum.cs @@ -39,18 +39,68 @@ using Schemas; namespace Aaru.Core { + /// + /// Enabled checksums + /// [Flags] public enum EnableChecksum { - Adler32 = 1, Crc16 = 2, Crc32 = 4, - Crc64 = 8, Md5 = 16, Sha1 = 64, - Sha256 = 128, Sha384 = 256, Sha512 = 512, - SpamSum = 1024, Fletcher16 = 2048, Fletcher32 = 4096, + /// + /// Enables Adler-32 + /// + Adler32 = 1, + /// + /// Enables CRC-16 + /// + Crc16 = 2, + /// + /// Enables CRC-32 + /// + Crc32 = 4, + /// + /// Enables CRC-64 + /// + Crc64 = 8, + /// + /// Enables MD5 + /// + Md5 = 16, + /// + /// Enables SHA1 + /// + Sha1 = 64, + /// + /// Enables SHA2-256 + /// + Sha256 = 128, + /// + /// Enables SHA2-384 + /// + Sha384 = 256, + /// + /// Enables SHA2-512 + /// + Sha512 = 512, + /// + /// Enables SpamSum + /// + SpamSum = 1024, + /// + /// Enables Fletcher-16 + /// + Fletcher16 = 2048, + /// + /// Enables Fletcher-32 + /// + Fletcher32 = 4096, + /// + /// Enables all known checksums + /// All = Adler32 | Crc16 | Crc32 | Crc64 | Md5 | Sha1 | Sha256 | Sha384 | Sha512 | SpamSum | Fletcher16 | Fletcher32 } - /// Checksums and hashes data, with different algorithms multithreaded + /// Checksums and hashes data, with different algorithms, multithreaded public sealed class Checksum { readonly IChecksum _adler32Ctx; @@ -91,6 +141,10 @@ namespace Aaru.Core HashPacket _spamsumPkt; Thread _spamsumThread; + /// + /// Initializes an instance of the checksum operations + /// + /// Enabled checksums public Checksum(EnableChecksum enabled = EnableChecksum.All) { _enabled = enabled; @@ -229,6 +283,10 @@ namespace Aaru.Core _f32Thread = new Thread(UpdateHash); } + /// + /// Updates the checksum with new data + /// + /// New data public void Update(byte[] data) { if(_enabled.HasFlag(EnableChecksum.Adler32)) @@ -353,6 +411,10 @@ namespace Aaru.Core _f32Thread = new Thread(UpdateHash); } + /// + /// Finishes the checksums + /// + /// Returns the checksum results public List End() { List chks = new List(); diff --git a/Aaru.Core/Devices/Dumping/Dump.cs b/Aaru.Core/Devices/Dumping/Dump.cs index 1e96fb9c8..426ec5491 100644 --- a/Aaru.Core/Devices/Dumping/Dump.cs +++ b/Aaru.Core/Devices/Dumping/Dump.cs @@ -48,10 +48,19 @@ using Schemas; namespace Aaru.Core.Devices.Dumping { + /// Subchannel requested to dump public enum DumpSubchannel { - Any, Rw, RwOrPq, - Pq, None + /// Any available subchannel, in order: raw P to W, PQ, none + Any, + /// Raw P to W + Rw, + /// Raw P to W or PQ if not possible + RwOrPq, + /// PQ + Pq, + /// None + None } public partial class Dump @@ -266,6 +275,9 @@ namespace Aaru.Core.Devices.Dumping fs.Close(); } + /// + /// Aborts the dump in progress + /// public void Abort() { _aborted = true; diff --git a/Aaru.Core/Devices/Dumping/NVMe.cs b/Aaru.Core/Devices/Dumping/NVMe.cs index 081523209..e7df17503 100644 --- a/Aaru.Core/Devices/Dumping/NVMe.cs +++ b/Aaru.Core/Devices/Dumping/NVMe.cs @@ -36,6 +36,9 @@ namespace Aaru.Core.Devices.Dumping { public partial class Dump { + /// + /// Dumps an NVMe device + /// public void NVMe() => StoppingErrorMessage?.Invoke("NVMe devices not yet supported."); } } \ No newline at end of file diff --git a/Aaru.Core/Devices/Info/DeviceInfo.cs b/Aaru.Core/Devices/Info/DeviceInfo.cs index ef62a6593..bae7d19c3 100644 --- a/Aaru.Core/Devices/Info/DeviceInfo.cs +++ b/Aaru.Core/Devices/Info/DeviceInfo.cs @@ -47,8 +47,15 @@ using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry; namespace Aaru.Core.Devices.Info { + /// + /// Obtains and contains information about a device + /// public partial class DeviceInfo { + /// + /// Initializes an instance of this class for the specified device + /// + /// Device public DeviceInfo(Device dev) { Type = dev.Type; diff --git a/Aaru.Core/Devices/Info/Plextor.cs b/Aaru.Core/Devices/Info/Plextor.cs index fef8cac86..7e2da2244 100644 --- a/Aaru.Core/Devices/Info/Plextor.cs +++ b/Aaru.Core/Devices/Info/Plextor.cs @@ -32,38 +32,134 @@ namespace Aaru.Core.Devices.Info { + /// + /// Contains information about Plextor features + /// public class Plextor { + /// + /// Access time limit + /// public byte AccessTimeLimit; + /// + /// Drive supports setting book type bit for DVD+R + /// public bool BitSetting; + /// + /// Drive supports setting book type bit for DVD+R DL + /// public bool BitSettingDl; + /// + /// CD read speed limit + /// public byte CdReadSpeedLimit; + /// + /// Time drive has spent reading CDs + /// public uint CdReadTime; + /// + /// CD write speed limit + /// public byte CdWriteSpeedLimit; + /// + /// Time drive has spent writing CDs + /// public uint CdWriteTime; + /// + /// Total number of loaded discs + /// public ushort Discs; + /// + /// Drive supports test writing DVD+ + /// public bool DvdPlusWriteTest; + /// + /// DVD read limit + /// public byte DvdReadSpeedLimit; + /// + /// Time drive has spent reading DVDs + /// public uint DvdReadTime; + /// + /// Time drive has spent writing DVDs + /// public uint DvdWriteTime; + /// + /// Raw contents of EEPROM + /// public byte[] Eeprom; + /// + /// Drive supports GigaRec + /// public bool GigaRec; + /// + /// Drive will show recordable CDs as embossed + /// public bool HidesRecordables; + /// + /// Drive will hide sessions + /// public bool HidesSessions; + /// + /// Drive supports hiding recordable CDs and sessions + /// public bool Hiding; + /// + /// Drive is a DVD capable drive + /// public bool IsDvd; + /// + /// Drive supports PoweRec + /// public bool PoweRec; + /// + /// Drive has PoweRec enabled + /// public bool PoweRecEnabled; + /// + /// Last used PoweRec in KiB/sec + /// public ushort PoweRecLast; + /// + /// Maximum supported PoweRec for currently inserted media in KiB/sec + /// public ushort PoweRecMax; + /// + /// Recommended supported PoweRec for currently inserted media in KiB/sec + /// public ushort PoweRecRecommendedSpeed; + /// + /// Selected supported PoweRec for currently inserted media in KiB/sec + /// public ushort PoweRecSelected; + /// + /// Drive supports SecuRec + /// public bool SecuRec; + /// + /// Drive supports SilentMode + /// public bool SilentMode; + /// + /// Drive has SilentMode enabled + /// public bool SilentModeEnabled; + /// + /// Drive supports SpeedRead + /// public bool SpeedRead; + /// + /// Drive has SpeedRead enabled + /// public bool SpeedReadEnabled; + /// + /// Drive supports VariRec + /// public bool VariRec; + /// + /// Drive supports VariRec for DVDs + /// public bool VariRecDvd; } } \ No newline at end of file diff --git a/Aaru.Core/Devices/Info/Properties.cs b/Aaru.Core/Devices/Info/Properties.cs index fef6096f4..c543e3590 100644 --- a/Aaru.Core/Devices/Info/Properties.cs +++ b/Aaru.Core/Devices/Info/Properties.cs @@ -44,51 +44,189 @@ namespace Aaru.Core.Devices.Info { public partial class DeviceInfo { + /// + /// Raw IDENTIFY DEVICE response + /// public byte[] AtaIdentify { get; } + /// + /// Raw IDENTIFY PACKET DEVICE response + /// public byte[] AtapiIdentify { get; } + /// + /// Raw INQUIRY response + /// public byte[] ScsiInquiryData { get; } + /// + /// Decoded INQUIRY response + /// public Inquiry? ScsiInquiry { get; } + /// + /// Response for ATA Memory Card Pass Through + /// public AtaErrorRegistersChs? AtaMcptError { get; } + /// + /// List of raw EVPD page indexed by page number + /// public Dictionary ScsiEvpdPages { get; } + /// + /// Decoded MODE SENSE response + /// public Modes.DecodedMode? ScsiMode { get; } + /// + /// Raw MODE SENSE(6) response + /// public byte[] ScsiModeSense6 { get; } + /// + /// Raw MODE SENSE(10) response + /// public byte[] ScsiModeSense10 { get; } + /// + /// Raw GET CONFIGURATION response + /// public byte[] MmcConfiguration { get; } + /// + /// Decoded Plextor features + /// public Plextor PlextorFeatures { get; } + /// + /// Decoded Kreon features + /// public KreonFeatures KreonFeatures { get; } + /// + /// Raw GET BLOCK LIMITS support + /// public byte[] BlockLimits { get; } + /// + /// Raw density support + /// public byte[] DensitySupport { get; } + /// + /// Decoded density support + /// public DensitySupport.DensitySupportHeader? DensitySupportHeader { get; } + /// + /// Raw medium density support + /// public byte[] MediumDensitySupport { get; } + /// + /// Decoded medium density support + /// public DensitySupport.MediaTypeSupportHeader? MediaTypeSupportHeader { get; } + /// + /// Raw CID registers + /// public byte[] CID { get; } + /// + /// Raw CSD + /// public byte[] CSD { get; } + /// + /// Raw extended CSD + /// public byte[] ExtendedCSD { get; } + /// + /// Raw SCR registers + /// public byte[] SCR { get; } + /// + /// Raw OCR registers + /// public byte[] OCR { get; } + /// + /// Aaru's device type + /// public DeviceType Type { get; } + /// + /// Device manufacturer + /// public string Manufacturer { get; } + /// + /// Device model + /// public string Model { get; } + /// + /// Device firmware version or revision + /// public string FirmwareRevision { get; } + /// + /// Device serial number + /// public string Serial { get; } + /// + /// SCSI Peripheral Device Type + /// public PeripheralDeviceTypes ScsiType { get; } + /// + /// Is media removable from device? + /// public bool IsRemovable { get; } + /// + /// Is device attached via USB? + /// public bool IsUsb { get; } + /// + /// USB vendor ID + /// public ushort UsbVendorId { get; } + /// + /// USB product ID + /// public ushort UsbProductId { get; } + /// + /// Raw USB descriptors + /// public byte[] UsbDescriptors { get; } + /// + /// USB manufacturer string + /// public string UsbManufacturerString { get; } + /// + /// USB product string + /// public string UsbProductString { get; } + /// + /// USB serial number string + /// public string UsbSerialString { get; } + /// + /// Is device attached via FireWire? + /// public bool IsFireWire { get; } + /// + /// FireWire's device GUID + /// public ulong FireWireGuid { get; } + /// + /// FireWire's device model ID + /// public uint FireWireModel { get; } + /// + /// FireWire's device model name + /// public string FireWireModelName { get; } + /// + /// FireWire's device vendor ID + /// public uint FireWireVendor { get; } + /// + /// FireWire's device vendor name + /// public string FireWireVendorName { get; } + /// + /// Is device a CompactFlash device? + /// public bool IsCompactFlash { get; } + /// + /// Is device a PCMCIA or CardBus device? + /// public bool IsPcmcia { get; } + /// + /// PCMCIA/CardBus CIS + /// public byte[] Cis { get; } + /// + /// MMC device CSS/CPRM Region Protection Code + /// public CSS_CPRM.RegionalPlaybackControlState? RPC { get; } } } \ No newline at end of file diff --git a/Aaru.Core/Devices/Report/ATA.cs b/Aaru.Core/Devices/Report/ATA.cs index f5dae240b..64c057fff 100644 --- a/Aaru.Core/Devices/Report/ATA.cs +++ b/Aaru.Core/Devices/Report/ATA.cs @@ -41,6 +41,10 @@ namespace Aaru.Core.Devices.Report { public sealed partial class DeviceReport { + /// + /// Creates a report for media inserted into an ATA device + /// + /// Media report public TestedMedia ReportAtaMedia() { var mediaTest = new TestedMedia(); @@ -721,6 +725,11 @@ namespace Aaru.Core.Devices.Report return capabilities; } + /// + /// Clear serial numbers and other private fields from an IDENTIFY ATA DEVICE response + /// + /// IDENTIFY ATA DEVICE response + /// IDENTIFY ATA DEVICE response without the private fields public static byte[] ClearIdentify(byte[] buffer) { byte[] empty = new byte[512]; diff --git a/Aaru.Core/Devices/Report/DeviceReport.cs b/Aaru.Core/Devices/Report/DeviceReport.cs index 4f9b3410c..fda310476 100644 --- a/Aaru.Core/Devices/Report/DeviceReport.cs +++ b/Aaru.Core/Devices/Report/DeviceReport.cs @@ -38,6 +38,10 @@ namespace Aaru.Core.Devices.Report { readonly Device _dev; + /// + /// Initializes a device report for the specified device (must be opened) + /// + /// Device public DeviceReport(Device device) => _dev = device; } } \ No newline at end of file diff --git a/Aaru.Core/Devices/Report/GdRomSwapTrick.cs b/Aaru.Core/Devices/Report/GdRomSwapTrick.cs index 8f331d119..a441ddfc8 100644 --- a/Aaru.Core/Devices/Report/GdRomSwapTrick.cs +++ b/Aaru.Core/Devices/Report/GdRomSwapTrick.cs @@ -45,6 +45,10 @@ namespace Aaru.Core.Devices.Report { public sealed partial class DeviceReport { + /// + /// Tries and checks reading a GD-ROM disc using the swap disc trick and adds the result to a device report + /// + /// Device report public void ReportGdRomSwapTrick(ref DeviceReportV2 report) { report.GdRomSwapDiscCapabilities = new GdRomSwapDiscCapabilities(); diff --git a/Aaru.Core/Devices/Report/MMC.cs b/Aaru.Core/Devices/Report/MMC.cs index e33495f31..cc80129ef 100644 --- a/Aaru.Core/Devices/Report/MMC.cs +++ b/Aaru.Core/Devices/Report/MMC.cs @@ -71,6 +71,10 @@ namespace Aaru.Core.Devices.Report return response; } + /// + /// Creates a report for the GET CONFIGURATION response of an MMC device + /// + /// MMC features report public MmcFeatures ReportMmcFeatures() { AaruConsole.WriteLine("Querying MMC GET CONFIGURATION..."); @@ -570,6 +574,16 @@ namespace Aaru.Core.Devices.Report return report; } + /// + /// Creates a report for media inserted into an MMC device + /// + /// Expected media type name + /// Try Plextor vendor commands + /// Try Pioneer vendor commands + /// Try NEC vendor commands + /// Try HL-DT-ST vendor commands + /// Try MediaTek vendor commands + /// public TestedMedia ReportMmcMedia(string mediaType, bool tryPlextor, bool tryPioneer, bool tryNec, bool tryHldtst, bool tryMediaTekF106) { diff --git a/Aaru.Core/Devices/Report/SSC.cs b/Aaru.Core/Devices/Report/SSC.cs index d57e9acb3..f91aec334 100644 --- a/Aaru.Core/Devices/Report/SSC.cs +++ b/Aaru.Core/Devices/Report/SSC.cs @@ -41,6 +41,10 @@ namespace Aaru.Core.Devices.Report { public sealed partial class DeviceReport { + /// + /// Creates a report from a SCSI Sequential Commands device + /// + /// SSC report public Ssc ReportScsiSsc() { var report = new Ssc(); @@ -137,6 +141,10 @@ namespace Aaru.Core.Devices.Report return report; } + /// + /// Creates a report for media inserted into an SSC device + /// + /// Media report public TestedSequentialMedia ReportSscMedia() { var seqTest = new TestedSequentialMedia(); diff --git a/Aaru.Core/Devices/Report/Scsi.cs b/Aaru.Core/Devices/Report/Scsi.cs index 604684ee6..8d4419124 100644 --- a/Aaru.Core/Devices/Report/Scsi.cs +++ b/Aaru.Core/Devices/Report/Scsi.cs @@ -45,6 +45,10 @@ namespace Aaru.Core.Devices.Report { public sealed partial class DeviceReport { + /// + /// Creates a report for the SCSI INQUIRY response + /// + /// SCSI report public Scsi ReportScsiInquiry() { AaruConsole.WriteLine("Querying SCSI INQUIRY..."); @@ -85,6 +89,11 @@ namespace Aaru.Core.Devices.Report return inquiry; } + /// + /// Returns a list of decoded SCSI EVPD pages + /// + /// Decoded SCSI vendor identification + /// List of decoded SCSI EVPD pages public List ReportEvpdPages(string vendor) { AaruConsole.WriteLine("Querying list of SCSI EVPDs..."); @@ -187,6 +196,12 @@ namespace Aaru.Core.Devices.Report return pageResponse; } + /// + /// Adds reports for the decoded SCSI MODE SENSE pages to a device report + /// + /// Device report + /// Returns raw MODE SENSE page 2Ah, aka CD-ROM page + /// Returns decoded list of supported media types response public void ReportScsiModes(ref DeviceReportV2 report, out byte[] cdromMode, out MediumTypes mediumType) { Modes.DecodedMode? decMode = null; @@ -419,6 +434,10 @@ namespace Aaru.Core.Devices.Report report.SCSI.ModeSense.ModePages = modePages; } + /// + /// Creates a report for media inserted into a SCSI device + /// + /// Media report public TestedMedia ReportScsiMedia() { var mediaTest = new TestedMedia(); @@ -684,6 +703,10 @@ namespace Aaru.Core.Devices.Report return mediaTest; } + /// + /// Creates a media report for a non-removable SCSI device + /// + /// Media report public TestedMedia ReportScsi() { var capabilities = new TestedMedia diff --git a/Aaru.Core/Devices/Scanning/MediaScan.cs b/Aaru.Core/Devices/Scanning/MediaScan.cs index 4e2dc4cc8..b02da641d 100644 --- a/Aaru.Core/Devices/Scanning/MediaScan.cs +++ b/Aaru.Core/Devices/Scanning/MediaScan.cs @@ -68,6 +68,11 @@ namespace Aaru.Core.Devices.Scanning _useBufferedReads = useBufferedReads; } + /// + /// Starts a media scan + /// + /// Media scan results + /// Unknown device type public ScanResults Scan() { switch(_dev.Type) @@ -82,6 +87,9 @@ namespace Aaru.Core.Devices.Scanning } } + /// + /// Aborts the running media scan + /// public void Abort() => _aborted = true; /// Event raised when the progress bar is not longer needed @@ -96,9 +104,13 @@ namespace Aaru.Core.Devices.Scanning public event UpdateProgressHandler UpdateProgress; /// Event raised to update the status of an indeterminate progress bar public event PulseProgressHandler PulseProgress; + /// Updates lists of time taken on scanning from the specified sector public event ScanTimeHandler ScanTime; + /// Specified a number of blocks could not be read on scan public event ScanUnreadableHandler ScanUnreadable; + /// Initializes a block map that's going to be filled with a media scan public event InitBlockMapHandler InitBlockMap; + /// Sends the speed of scanning a specific sector public event ScanSpeedHandler ScanSpeed; } } \ No newline at end of file diff --git a/Aaru.Core/Entropy.cs b/Aaru.Core/Entropy.cs index b2be20fa4..fca58d86c 100644 --- a/Aaru.Core/Entropy.cs +++ b/Aaru.Core/Entropy.cs @@ -41,24 +41,43 @@ using Aaru.Console; namespace Aaru.Core { + /// + /// Media image entropy operations + /// public sealed class Entropy { readonly bool _debug; readonly IMediaImage _inputFormat; + /// + /// Initializes an instance with the specified parameters + /// + /// Debug enabled + /// Media image public Entropy(bool debug, IMediaImage inputFormat) { _debug = debug; _inputFormat = inputFormat; } + /// Event raised when a progress bar is needed public event InitProgressHandler InitProgressEvent; + /// Event raised to update the values of a determinate progress bar public event UpdateProgressHandler UpdateProgressEvent; + /// Event raised when the progress bar is not longer needed public event EndProgressHandler EndProgressEvent; + /// Event raised when a progress bar is needed public event InitProgressHandler InitProgress2Event; + /// Event raised to update the values of a determinate progress bar public event UpdateProgressHandler UpdateProgress2Event; + /// Event raised when the progress bar is not longer needed public event EndProgressHandler EndProgress2Event; + /// + /// Calculates the tracks entropy + /// + /// Checks for duplicated sectors + /// Calculated entropy public EntropyResults[] CalculateTracksEntropy(bool duplicatedSectors) { List entropyResults = new List(); @@ -144,6 +163,11 @@ namespace Aaru.Core return entropyResults.ToArray(); } + /// + /// Calculates the media entropy + /// + /// Checks for duplicated sectors + /// Calculated entropy public EntropyResults CalculateMediaEntropy(bool duplicatedSectors) { var entropy = new EntropyResults @@ -190,11 +214,26 @@ namespace Aaru.Core } } + /// + /// Entropy results + /// public struct EntropyResults { + /// + /// Track number, if applicable + /// public uint Track; + /// + /// Entropy + /// public double Entropy; + /// + /// Number of unique sectors + /// public int? UniqueSectors; + /// + /// Number of total sectors + /// public ulong Sectors; } } \ No newline at end of file diff --git a/Aaru.Core/Error.cs b/Aaru.Core/Error.cs index 4d1dbe565..9e2ecba27 100644 --- a/Aaru.Core/Error.cs +++ b/Aaru.Core/Error.cs @@ -34,8 +34,16 @@ using Aaru.CommonTypes.Interop; namespace Aaru.Core { + /// + /// Prints the description of a system error number. + /// public static class Error { + /// + /// Prints the description of a system error number. + /// + /// System error number. + /// Error description. public static string Print(int errno) { switch(DetectOS.GetRealPlatformID()) diff --git a/Aaru.Core/Filesystems.cs b/Aaru.Core/Filesystems.cs index d2e158fb9..6f7224811 100644 --- a/Aaru.Core/Filesystems.cs +++ b/Aaru.Core/Filesystems.cs @@ -37,6 +37,9 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.Core { + /// + /// Core filesystem operations + /// public static class Filesystems { /// diff --git a/Aaru.Core/GetPluginBase.cs b/Aaru.Core/GetPluginBase.cs index 6e8ed2df5..a53196346 100644 --- a/Aaru.Core/GetPluginBase.cs +++ b/Aaru.Core/GetPluginBase.cs @@ -36,8 +36,14 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.Core { + /// + /// Plugin base operations + /// public static class GetPluginBase { + /// + /// Gets an instance with all the known plugins + /// public static PluginBase Instance { get diff --git a/Aaru.Core/ImageFormat.cs b/Aaru.Core/ImageFormat.cs index 183b462f6..a515d003d 100644 --- a/Aaru.Core/ImageFormat.cs +++ b/Aaru.Core/ImageFormat.cs @@ -38,6 +38,9 @@ using Aaru.Console; namespace Aaru.Core { + /// + /// Core media image format operations + /// public static class ImageFormat { /// Detects the image plugin that recognizes the data inside a filter diff --git a/Aaru.Core/ImageInfo.cs b/Aaru.Core/ImageInfo.cs index 629932884..6cf39228e 100644 --- a/Aaru.Core/ImageInfo.cs +++ b/Aaru.Core/ImageInfo.cs @@ -56,6 +56,9 @@ using Tuple = Aaru.Decoders.PCMCIA.Tuple; namespace Aaru.Core { + /// + /// Image information operations + /// public static class ImageInfo { const string MANUFACTURER_STRING = "Manufacturer"; @@ -67,6 +70,10 @@ namespace Aaru.Core const string START_STRING = "Start"; const string END_STRING = "End"; + /// + /// Prints image information to console + /// + /// Media image public static void PrintImageInfo(IMediaImage imageFormat) { AaruConsole.WriteLine("Image information:"); diff --git a/Aaru.Core/Logging/ErrorLog.cs b/Aaru.Core/Logging/ErrorLog.cs index 163226134..9c0d52eb4 100644 --- a/Aaru.Core/Logging/ErrorLog.cs +++ b/Aaru.Core/Logging/ErrorLog.cs @@ -35,6 +35,9 @@ using Aaru.Decoders.SCSI; namespace Aaru.Core.Logging { + /// + /// Logs errors + /// public sealed class ErrorLog { readonly StreamWriter _logSw; diff --git a/Aaru.Core/Logging/SubchannelLog.cs b/Aaru.Core/Logging/SubchannelLog.cs index c46963971..c242b002d 100644 --- a/Aaru.Core/Logging/SubchannelLog.cs +++ b/Aaru.Core/Logging/SubchannelLog.cs @@ -32,13 +32,16 @@ using Aaru.Decoders.CD; namespace Aaru.Core.Logging { + /// + /// Logs subchannel data + /// public class SubchannelLog { const int _subSize = 96; readonly bool _bcd; readonly StreamWriter _logSw; - /// Initializes the dump log + /// Initializes the subchannel log /// Output log file /// Drive returns subchannel in BCD format public SubchannelLog(string outputFile, bool bcd) @@ -55,7 +58,7 @@ namespace Aaru.Core.Logging _logSw.Flush(); } - /// Finishes and closes the dump log + /// Finishes and closes the subchannel log public void Close() { _logSw.WriteLine("######################################################"); @@ -63,6 +66,15 @@ namespace Aaru.Core.Logging _logSw.Close(); } + /// + /// Logs an entry to the subchannel log + /// + /// Subchannel data + /// Set to true if the subchannel data is raw + /// First LBA read from drive to retrieve the data + /// Number of blocks read + /// Set to true if the subchannel has been generated, false if read from media + /// Set to true if the subchannel has been fixed, false if as is public void WriteEntry(byte[] subchannel, bool raw, long startingLba, uint blocks, bool generated, bool @fixed) { if(subchannel.Length / _subSize != blocks) @@ -219,34 +231,87 @@ namespace Aaru.Core.Logging _logSw.Flush(); } + /// + /// Logs message indicating the P subchannel has been fixed + /// + /// LBA fix belongs to public void WritePFix(long lba) => WriteMessageWithPosition(lba, "fixed P subchannel using weight average."); + /// + /// Logs message indicating the R-W subchannels have been fixed + /// + /// LBA fix belongs to public void WriteRwFix(long lba) => WriteMessageWithPosition(lba, "fixed R-W subchannels writing empty data."); + /// + /// Logs message indicating the ADR field of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQAdrFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct ADR."); + /// + /// Logs message indicating the CONTROL field of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQCtrlFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct CONTROL."); + /// + /// Logs message indicating the ZERO field of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQZeroFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct ZERO."); + /// + /// Logs message indicating the TNO field of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQTnoFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct TNO."); + /// + /// Logs message indicating the INDEX field of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQIndexFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct INDEX."); + /// + /// Logs message indicating the relative position of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQRelPosFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct RELATIVE POSITION."); + /// + /// Logs message indicating the absolute position of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQAbsPosFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct ABSOLUTE POSITION."); + /// + /// Logs message indicating the CRC of the Q subchannel has been fixed + /// + /// LBA fix belongs to public void WriteQCrcFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with correct CRC."); + /// + /// Logs message indicating the the Q subchannel has been fixed with a known good MCN + /// + /// LBA fix belongs to public void WriteQMcnFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with known good MCN."); + /// + /// Logs message indicating the the Q subchannel has been fixed with a known good ISRC + /// + /// LBA fix belongs to public void WriteQIsrcFix(long lba) => WriteMessageWithPosition(lba, "fixed Q subchannel with known good ISRC."); + /// + /// Logs a message with a specified position + /// + /// LBA position + /// Message to log public void WriteMessageWithPosition(long lba, string message) { long minute = (lba + 150) / 4500; diff --git a/Aaru.Core/Media/CompactDisc.cs b/Aaru.Core/Media/CompactDisc.cs index 31bcd27d7..57627ecc9 100644 --- a/Aaru.Core/Media/CompactDisc.cs +++ b/Aaru.Core/Media/CompactDisc.cs @@ -41,6 +41,9 @@ using Aaru.Helpers; namespace Aaru.Core.Media { + /// + /// Operations over CD based media + /// public static class CompactDisc { /// Writes subchannel data to an image diff --git a/Aaru.Core/Media/Detection/MMC.cs b/Aaru.Core/Media/Detection/MMC.cs index 29619aafd..36391ea31 100644 --- a/Aaru.Core/Media/Detection/MMC.cs +++ b/Aaru.Core/Media/Detection/MMC.cs @@ -51,6 +51,9 @@ using DMI = Aaru.Decoders.Xbox.DMI; namespace Aaru.Core.Media.Detection { + /// + /// Detects media type for MMC class devices + /// public static class MMC { /// SHA256 of PlayStation 2 boot sectors, seen in PAL discs diff --git a/Aaru.Core/Media/Info/CompactDisc.cs b/Aaru.Core/Media/Info/CompactDisc.cs index 8d2879b84..3a510a69f 100644 --- a/Aaru.Core/Media/Info/CompactDisc.cs +++ b/Aaru.Core/Media/Info/CompactDisc.cs @@ -45,6 +45,9 @@ using Device = Aaru.Database.Models.Device; namespace Aaru.Core.Media.Info { + /// + /// Core operations for retrieving information about CD based media + /// public static class CompactDisc { /// Gets the offset bytes from a Compact Disc diff --git a/Aaru.Core/Media/Info/ScsiInfo.cs b/Aaru.Core/Media/Info/ScsiInfo.cs index 9b30ba2da..9a4055594 100644 --- a/Aaru.Core/Media/Info/ScsiInfo.cs +++ b/Aaru.Core/Media/Info/ScsiInfo.cs @@ -53,8 +53,15 @@ using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry; namespace Aaru.Core.Media.Info { + /// + /// Retrieves information from a SCSI device + /// public sealed class ScsiInfo { + /// + /// Initializes this class with the specific device, and fills in the information + /// + /// Device public ScsiInfo(Device dev) { if(dev.Type != DeviceType.SCSI && @@ -1492,74 +1499,281 @@ namespace Aaru.Core.Media.Info MediaType = tmpType; } + /// + /// Decoded DVD Pre-Recorded Information + /// public PRI.PreRecordedInformation? DecodedDvdPrePitInformation { get; } + /// + /// Decoded recordable DVD Physical Format Information + /// public PFI.PhysicalFormatInformation? DecodedDvdrPfi { get; } + /// + /// Raw media serial number + /// public byte[] MediaSerialNumber { get; } + /// + /// Raw Xbox security sectors + /// public byte[] XboxSecuritySector { get; } + /// + /// Decoded Xbox security sectors + /// public SS.SecuritySector? DecodedXboxSecuritySector { get; } + /// + /// Information about an XGD, XGD2 or XGD3 media + /// public XgdInfo XgdInfo { get; } + /// + /// MMC drive raw GET CONFIGURATION + /// public byte[] MmcConfiguration { get; } + /// + /// Raw recognized format layers + /// public byte[] RecognizedFormatLayers { get; } + /// + /// Raw write protection status + /// public byte[] WriteProtectionStatus { get; } + /// + /// Raw DVD Physical Format Information + /// public byte[] DvdPfi { get; } + /// + /// Decoded DVD Physical Format Information + /// public PFI.PhysicalFormatInformation? DecodedPfi { get; } + /// + /// Raw DVD Disc Manufacturing Information + /// public byte[] DvdDmi { get; } + /// + /// Raw DVD Copyright Management Information + /// public byte[] DvdCmi { get; } + /// + /// Raw DVD Burst Cutting Area + /// public byte[] DvdBca { get; } + /// + /// Raw DVD AACS information + /// public byte[] DvdAacs { get; } + /// + /// Raw DVD-RAM Disc Definition Structure + /// public byte[] DvdRamDds { get; } + /// + /// Raw DVD-RAM Cartridge Status + /// public byte[] DvdRamCartridgeStatus { get; } + /// + /// Raw DVD-RAM Spare Area Information + /// public byte[] DvdRamSpareArea { get; } + /// + /// Raw DVD-R(W) Last Border-Out RMD + /// public byte[] LastBorderOutRmd { get; } + /// + /// Raw DVD-R(W) Pre-Recorded Information + /// public byte[] DvdPreRecordedInfo { get; } + /// + /// Raw DVD-R Media ID + /// public byte[] DvdrMediaIdentifier { get; } + /// + /// Raw recordable DVD Physical Format Information + /// public byte[] DvdrPhysicalInformation { get; } + /// + /// Raw DVD+R(W) ADIP + /// public byte[] DvdPlusAdip { get; } + /// + /// Raw DVD+R(W) Disc Control Blocks + /// public byte[] DvdPlusDcb { get; } + /// + /// Raw HD DVD Copyright Management Information + /// public byte[] HddvdCopyrightInformation { get; } + /// + /// Raw HD DVD-R Medium Status + /// public byte[] HddvdrMediumStatus { get; } + /// + /// Raw HD DVD-R(W) Last Border-Out RMD + /// public byte[] HddvdrLastRmd { get; } + /// + /// Raw DVD-R(W) Layer Capacity + /// public byte[] DvdrLayerCapacity { get; } + /// + /// Raw DVD-R DL Middle Zone start + /// public byte[] DvdrDlMiddleZoneStart { get; } + /// + /// Raw DVD-R DL Jump Interval size + /// public byte[] DvdrDlJumpIntervalSize { get; } + /// + /// Raw DVD-R DL Manual Layer Jump Start LBA + /// public byte[] DvdrDlManualLayerJumpStartLba { get; } + /// + /// Raw DVD-R DL Remap Anchor Point + /// public byte[] DvdrDlRemapAnchorPoint { get; } + /// + /// Raw Blu-ray Disc Information + /// public byte[] BlurayDiscInformation { get; } + /// + /// Raw Blu-ray PAC + /// public byte[] BlurayPac { get; } + /// + /// Raw Blu-ray Burst Cutting Area + /// public byte[] BlurayBurstCuttingArea { get; } + /// + /// Raw Blu-ray Disc Definition Structure + /// public byte[] BlurayDds { get; } + /// + /// Raw Blu-ray Cartridge Status + /// public byte[] BlurayCartridgeStatus { get; } + /// + /// Raw Blu-ray Spare Area Information + /// public byte[] BluraySpareAreaInformation { get; } + /// + /// Raw Blu-ray DFL + /// public byte[] BlurayRawDfl { get; } + /// + /// Raw Blu-ray Pseudo OverWrite Resources + /// public byte[] BlurayPowResources { get; } + /// + /// Raw READ TOC response + /// public byte[] Toc { get; } + /// + /// Raw READ ATIP response + /// public byte[] Atip { get; } + /// + /// Raw READ DISC INFORMATION response + /// public byte[] DiscInformation { get; } + /// + /// Raw READ SESSION response + /// public byte[] Session { get; } + /// + /// Raw READ FULL TOC response + /// public byte[] RawToc { get; } + /// + /// Raw READ PMA response + /// public byte[] Pma { get; } + /// + /// Raw Lead-In's CD-TEXT response + /// public byte[] CdTextLeadIn { get; } + /// + /// Decoded READ TOC response + /// public TOC.CDTOC? DecodedToc { get; } + /// + /// Decoded READ ATIP response + /// public ATIP.CDATIP DecodedAtip { get; } + /// + /// Decoded READ SESSION response + /// public Session.CDSessionInfo? DecodedSession { get; } + /// + /// Decoded READ FULL TOC response + /// public FullTOC.CDFullTOC? FullToc { get; } + /// + /// Decoded Lead-In CD-TEXT response + /// public CDTextOnLeadIn.CDText? DecodedCdTextLeadIn { get; } + /// + /// Raw Blu-ray track resources + /// public byte[] BlurayTrackResources { get; } + /// + /// Decoded Blu-ray Disc Information + /// public DiscInformation.StandardDiscInformation? DecodedDiscInformation { get; } + /// + /// Decoded Media Catalogue Number + /// public string Mcn { get; } + /// + /// List of decoded track ISRCs + /// public Dictionary Isrcs { get; } + /// + /// Set if media is inserted in drive + /// public bool MediaInserted { get; } + /// + /// Detected media type + /// public MediaType MediaType { get; } + /// + /// Device information + /// public DeviceInfo DeviceInfo { get; } + /// + /// Raw READ CAPACITY(10) response + /// public byte[] ReadCapacity { get; } + /// + /// Number of blocks in media + /// public ulong Blocks { get; } + /// + /// Logical block size + /// public uint BlockSize { get; } + /// + /// Raw READ CAPACITY(16) response + /// public byte[] ReadCapacity16 { get; } + /// + /// Raw SSC Density support + /// public byte[] DensitySupport { get; } + /// + /// Decoded SSC Density support + /// public DensitySupport.DensitySupportHeader? DensitySupportHeader { get; } + /// + /// Raw SSC media support + /// public byte[] MediaTypeSupport { get; } + /// + /// Decoded SSC media support + /// public DensitySupport.MediaTypeSupportHeader? MediaTypeSupportHeader { get; } + /// + /// Raw data from DVD sector Copyright Management Information + /// public byte[] DvdSectorCmi { get; } + /// + /// Raw DVD Disc Key + /// public byte[] DvdDiscKey { get; } } } \ No newline at end of file diff --git a/Aaru.Core/Media/Info/XgdInfo.cs b/Aaru.Core/Media/Info/XgdInfo.cs index 8d4736d58..9870dc956 100644 --- a/Aaru.Core/Media/Info/XgdInfo.cs +++ b/Aaru.Core/Media/Info/XgdInfo.cs @@ -32,13 +32,34 @@ namespace Aaru.Core.Media.Info { + /// + /// Information about an XGD, XGD2 or XGD3 media. + /// public sealed class XgdInfo { + /// + /// Size of the game partition + /// public ulong GameSize; + /// + /// Size of layer 0 of the video partition + /// public ulong L0Video; + /// + /// Size of layer 1 of the video partition + /// public ulong L1Video; + /// + /// Real layer break + /// public ulong LayerBreak; + /// + /// Size of the middle zone + /// public ulong MiddleZone; + /// + /// Total size of media + /// public ulong TotalSize; } } \ No newline at end of file diff --git a/Aaru.Core/Options.cs b/Aaru.Core/Options.cs index ee1d083a1..3275f9358 100644 --- a/Aaru.Core/Options.cs +++ b/Aaru.Core/Options.cs @@ -36,8 +36,16 @@ using System.Text; namespace Aaru.Core { + /// + /// Option parsing + /// public static class Options { + /// + /// Parses a string with options + /// + /// Options string + /// Options name-value dictionary public static Dictionary Parse(string options) { Dictionary parsed = new Dictionary(); diff --git a/Aaru.Core/PrintScsiModePages.cs b/Aaru.Core/PrintScsiModePages.cs index 299d27028..19667ba48 100644 --- a/Aaru.Core/PrintScsiModePages.cs +++ b/Aaru.Core/PrintScsiModePages.cs @@ -37,8 +37,17 @@ using Aaru.Helpers; namespace Aaru.Core { + /// + /// Prints all SCSI MODE pages + /// public static class PrintScsiModePages { + /// + /// Prints all SCSI MODE pages + /// + /// Decoded SCSI MODE SENSE + /// SCSI Peripheral Type + /// SCSI vendor identification public static void Print(Modes.DecodedMode decMode, PeripheralDeviceTypes devType, byte[] vendorId) { AaruConsole.WriteLine(Modes.PrettifyModeHeader(decMode.Header, devType)); diff --git a/Aaru.Core/Remote.cs b/Aaru.Core/Remote.cs index 6a2d7ec57..f45aa83e4 100644 --- a/Aaru.Core/Remote.cs +++ b/Aaru.Core/Remote.cs @@ -111,6 +111,10 @@ namespace Aaru.Core submitThread.Start(); } + /// + /// Updates the main database + /// + /// If true creates the database from scratch, otherwise updates an existing database public static void UpdateMainDatabase(bool create) { var mctx = AaruContext.Create(Settings.Settings.MainDbPath); diff --git a/Aaru.Core/Sidecar/BlockTape.cs b/Aaru.Core/Sidecar/BlockTape.cs index f927ff926..11b8ea1f4 100644 --- a/Aaru.Core/Sidecar/BlockTape.cs +++ b/Aaru.Core/Sidecar/BlockTape.cs @@ -36,6 +36,9 @@ using Schemas; namespace Aaru.Core { + /// + /// Sidecar operations + /// public sealed partial class Sidecar { /// Creates a metadata sidecar for a block tape (e.g. scsi streaming) diff --git a/Aaru.Core/Sidecar/Events.cs b/Aaru.Core/Sidecar/Events.cs index 114d67e66..f07bc8a0b 100644 --- a/Aaru.Core/Sidecar/Events.cs +++ b/Aaru.Core/Sidecar/Events.cs @@ -36,28 +36,42 @@ namespace Aaru.Core { public sealed partial class Sidecar { + /// Initializes a progress indicator (e.g. makes a progress bar visible) public event InitProgressHandler InitProgressEvent; + /// Updates a progress indicator with text public event UpdateProgressHandler UpdateProgressEvent; + /// Uninitializes a progress indicator (e.g. adds a newline to the console) public event EndProgressHandler EndProgressEvent; + /// Initializes a secondary progress indicator (e.g. makes a progress bar visible) public event InitProgressHandler2 InitProgressEvent2; + /// Event raised to update the values of a determinate progress bar public event UpdateProgressHandler2 UpdateProgressEvent2; + /// Event raised when the progress bar is not longer needed public event EndProgressHandler2 EndProgressEvent2; + /// Updates a status indicator public event UpdateStatusHandler UpdateStatusEvent; + /// Initializes a progress indicator (e.g. makes a progress bar visible) public void InitProgress() => InitProgressEvent?.Invoke(); + /// Updates a progress indicator with text public void UpdateProgress(string text, long current, long maximum) => UpdateProgressEvent?.Invoke(string.Format(text, current, maximum), current, maximum); + /// Uninitializes a progress indicator (e.g. adds a newline to the console) public void EndProgress() => EndProgressEvent?.Invoke(); + /// Initializes a secondary progress indicator (e.g. makes a progress bar visible) public void InitProgress2() => InitProgressEvent2?.Invoke(); + /// Event raised to update the values of a determinate progress bar public void UpdateProgress2(string text, long current, long maximum) => UpdateProgressEvent2?.Invoke(string.Format(text, current, maximum), current, maximum); + /// Event raised when the progress bar is not longer needed public void EndProgress2() => EndProgressEvent2?.Invoke(); + /// Updates a status indicator public void UpdateStatus(string text, params object[] args) => UpdateStatusEvent?.Invoke(string.Format(text, args)); } diff --git a/Aaru.Core/Sidecar/Sidecar.cs b/Aaru.Core/Sidecar/Sidecar.cs index 18cd58955..03f7ea4f6 100644 --- a/Aaru.Core/Sidecar/Sidecar.cs +++ b/Aaru.Core/Sidecar/Sidecar.cs @@ -56,6 +56,9 @@ namespace Aaru.Core FileStream _fs; CICMMetadataType _sidecar; + /// + /// Initializes a new instance of this class + /// public Sidecar() { _plugins = GetPluginBase.Instance; @@ -167,6 +170,9 @@ namespace Aaru.Core return _sidecar; } + /// + /// Aborts sidecar running operation + /// public void Abort() { UpdateStatus("Aborting..."); diff --git a/Aaru.Database/Context.cs b/Aaru.Database/Context.cs index bfcf509c8..07edcd6f3 100644 --- a/Aaru.Database/Context.cs +++ b/Aaru.Database/Context.cs @@ -35,30 +35,94 @@ using Microsoft.EntityFrameworkCore; namespace Aaru.Database { + /// + /// + /// Database context + /// public sealed class AaruContext : DbContext { + /// + /// Creates a database context with the specified options + /// + /// Options public AaruContext(DbContextOptions options) : base(options) {} + /// + /// List of known devices + /// public DbSet Devices { get; set; } + /// + /// List of local device reports + /// public DbSet Reports { get; set; } + /// + /// Command usage statistics + /// public DbSet Commands { get; set; } + /// + /// Statistics for found filesystems + /// public DbSet Filesystems { get; set; } + /// + /// Statistics for used filters + /// public DbSet Filters { get; set; } + /// + /// Statistics for media image formats + /// public DbSet MediaFormats { get; set; } + /// + /// Statistics for partitioning schemes + /// public DbSet Partitions { get; set; } + /// + /// Statistics for media types + /// public DbSet Medias { get; set; } + /// + /// Statistics for devices seen using commands + /// public DbSet SeenDevices { get; set; } + /// + /// Statistics for operating systems + /// public DbSet OperatingSystems { get; set; } + /// + /// Statistics for used Aaru versions + /// public DbSet Versions { get; set; } + /// + /// List of known USB vendors + /// public DbSet UsbVendors { get; set; } + /// + /// List of known USB products + /// public DbSet UsbProducts { get; set; } + /// + /// List of CD reading offsets + /// public DbSet CdOffsets { get; set; } + /// + /// Statistics of remote applications + /// public DbSet RemoteApplications { get; set; } + /// + /// Statistics of remote architectures + /// public DbSet RemoteArchitectures { get; set; } + /// + /// Statistics of remote operating systems + /// public DbSet RemoteOperatingSystems { get; set; } // Note: If table does not appear check that last migration has been REALLY added to the project + /// + /// Creates a database context with the database in the specified path + /// + /// Path to database file + /// Database context public static AaruContext Create(string dbPath) { var optionsBuilder = new DbContextOptionsBuilder(); @@ -67,6 +131,7 @@ namespace Aaru.Database return new AaruContext(optionsBuilder.Options); } + /// protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); diff --git a/Aaru.Database/ContextFactory.cs b/Aaru.Database/ContextFactory.cs index 3c3de026c..bed05c9fc 100644 --- a/Aaru.Database/ContextFactory.cs +++ b/Aaru.Database/ContextFactory.cs @@ -34,8 +34,16 @@ using Microsoft.EntityFrameworkCore.Design; namespace Aaru.Database { + /// + /// Database context factory, for design time + /// public class AaruContextFactory : IDesignTimeDbContextFactory { + /// + /// Creates a database context + /// + /// Ignored parameters + /// A database context public AaruContext CreateDbContext(string[] args) => AaruContext.Create("aaru.db"); } } \ No newline at end of file diff --git a/Aaru.Database/Models/BaseModel.cs b/Aaru.Database/Models/BaseModel.cs index 76494d9d8..aced6e42e 100644 --- a/Aaru.Database/Models/BaseModel.cs +++ b/Aaru.Database/Models/BaseModel.cs @@ -34,8 +34,14 @@ using System.ComponentModel.DataAnnotations; namespace Aaru.Database.Models { + /// + /// Base database model + /// public abstract class BaseModel { + /// + /// Database ID + /// [Key] public int Id { get; set; } } diff --git a/Aaru.Database/Models/BaseOperatingSystem.cs b/Aaru.Database/Models/BaseOperatingSystem.cs index 1277693a1..5092793f5 100644 --- a/Aaru.Database/Models/BaseOperatingSystem.cs +++ b/Aaru.Database/Models/BaseOperatingSystem.cs @@ -32,11 +32,26 @@ namespace Aaru.Database.Models { + /// + /// Operating system statistics + /// public abstract class BaseOperatingSystem : BaseModel { + /// + /// Operating system name + /// public string Name { get; set; } + /// + /// Operating system version + /// public string Version { get; set; } + /// + /// Has already been synchronized with Aaru's server + /// public bool Synchronized { get; set; } + /// + /// Statistical count + /// public ulong Count { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/CdOffset.cs b/Aaru.Database/Models/CdOffset.cs index 24fd9f5af..734ecae80 100644 --- a/Aaru.Database/Models/CdOffset.cs +++ b/Aaru.Database/Models/CdOffset.cs @@ -34,10 +34,24 @@ using System; namespace Aaru.Database.Models { + /// + /// CD read offset + /// public class CdOffset : CommonTypes.Metadata.CdOffset { + /// + /// Builds an empty CD read offset + /// public CdOffset() {} + /// + /// Builds a CD read offset with the specified parameters + /// + /// Manufacturer + /// Model + /// Read offset + /// Number of submissions + /// Percentage of agreement of submissions public CdOffset(string manufacturer, string model, short offset, int submissions, float agreement) { Manufacturer = manufacturer; @@ -48,6 +62,10 @@ namespace Aaru.Database.Models AddedWhen = ModifiedWhen = DateTime.UtcNow; } + /// + /// Builds a CD read offset from the metadata type + /// + /// Read offset metadata public CdOffset(CommonTypes.Metadata.CdOffset offset) { Manufacturer = offset.Manufacturer; @@ -58,8 +76,17 @@ namespace Aaru.Database.Models AddedWhen = ModifiedWhen = DateTime.UtcNow; } + /// + /// Database ID + /// public int Id { get; set; } + /// + /// Date when model has been added to the database + /// public DateTime AddedWhen { get; set; } + /// + /// Date when model was last modified + /// public DateTime ModifiedWhen { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/Command.cs b/Aaru.Database/Models/Command.cs index ad9a016fe..4455de1cb 100644 --- a/Aaru.Database/Models/Command.cs +++ b/Aaru.Database/Models/Command.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Command statistics. + /// public class Command : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Database/Models/Device.cs b/Aaru.Database/Models/Device.cs index ccbea4b45..0fd086edf 100644 --- a/Aaru.Database/Models/Device.cs +++ b/Aaru.Database/Models/Device.cs @@ -36,10 +36,20 @@ using Aaru.CommonTypes.Metadata; namespace Aaru.Database.Models { + /// + /// Known device + /// public class Device : DeviceReportV2 { + /// + /// Builds an empty device + /// public Device() => LastSynchronized = DateTime.UtcNow; + /// + /// Builds a device from a device report + /// + /// Device report public Device(DeviceReportV2 report) { ATA = report.ATA; @@ -59,11 +69,20 @@ namespace Aaru.Database.Models GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities; } + /// + /// When this known device was last synchronized with the server + /// public DateTime LastSynchronized { get; set; } + /// + /// Optimal number of blocks to read at once + /// [DefaultValue(0)] public int OptimalMultipleSectorsRead { get; set; } + /// + /// Can read GD-ROM using swap trick? + /// [DefaultValue(null)] public bool? CanReadGdRomUsingSwapDisc { get; set; } } diff --git a/Aaru.Database/Models/DeviceStat.cs b/Aaru.Database/Models/DeviceStat.cs index 8bdeeef74..d4e0211a6 100644 --- a/Aaru.Database/Models/DeviceStat.cs +++ b/Aaru.Database/Models/DeviceStat.cs @@ -32,12 +32,30 @@ namespace Aaru.Database.Models { + /// + /// Device found in usage + /// public class DeviceStat : BaseModel { + /// + /// Manufacturer + /// public string Manufacturer { get; set; } + /// + /// Model + /// public string Model { get; set; } + /// + /// Revision or firmware version + /// public string Revision { get; set; } + /// + /// Bus + /// public string Bus { get; set; } + /// + /// Has already been synchronized with Aaru's server + /// public bool Synchronized { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/Filesystem.cs b/Aaru.Database/Models/Filesystem.cs index 64dc2a388..6a3117c8d 100644 --- a/Aaru.Database/Models/Filesystem.cs +++ b/Aaru.Database/Models/Filesystem.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Filesystem found + /// public class Filesystem : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Database/Models/Filter.cs b/Aaru.Database/Models/Filter.cs index f79549b81..354713c31 100644 --- a/Aaru.Database/Models/Filter.cs +++ b/Aaru.Database/Models/Filter.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Filter used + /// public class Filter : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Database/Models/Media.cs b/Aaru.Database/Models/Media.cs index c895af85f..10c7d8a5b 100644 --- a/Aaru.Database/Models/Media.cs +++ b/Aaru.Database/Models/Media.cs @@ -32,11 +32,26 @@ namespace Aaru.Database.Models { + /// + /// Media type found + /// public class Media : BaseModel { + /// + /// Media type name + /// public string Type { get; set; } + /// + /// Found physically, or in image + /// public bool Real { get; set; } + /// + /// Has already been synchronized with Aaru's server + /// public bool Synchronized { get; set; } + /// + /// Count of times found + /// public ulong Count { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/MediaFormat.cs b/Aaru.Database/Models/MediaFormat.cs index a75720853..8f9da5dec 100644 --- a/Aaru.Database/Models/MediaFormat.cs +++ b/Aaru.Database/Models/MediaFormat.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Media image format + /// public class MediaFormat : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Database/Models/NameCountModel.cs b/Aaru.Database/Models/NameCountModel.cs index 2eafee2fd..874396209 100644 --- a/Aaru.Database/Models/NameCountModel.cs +++ b/Aaru.Database/Models/NameCountModel.cs @@ -32,10 +32,22 @@ namespace Aaru.Database.Models { + /// + /// Model for name-count values. + /// public abstract class NameCountModel : BaseModel { + /// + /// Value name + /// public string Name { get; set; } + /// + /// Has already been synchronized with Aaru's server + /// public bool Synchronized { get; set; } + /// + /// Value count + /// public ulong Count { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/OperatingSystem.cs b/Aaru.Database/Models/OperatingSystem.cs index 4fb750e63..697cb771b 100644 --- a/Aaru.Database/Models/OperatingSystem.cs +++ b/Aaru.Database/Models/OperatingSystem.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Operating system + /// public class OperatingSystem : BaseOperatingSystem {} } \ No newline at end of file diff --git a/Aaru.Database/Models/Partition.cs b/Aaru.Database/Models/Partition.cs index a0b98e013..eecebf11d 100644 --- a/Aaru.Database/Models/Partition.cs +++ b/Aaru.Database/Models/Partition.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Partitioning scheme + /// public class Partition : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Database/Models/RemoteApplication.cs b/Aaru.Database/Models/RemoteApplication.cs index 75822990d..4b48b5b75 100644 --- a/Aaru.Database/Models/RemoteApplication.cs +++ b/Aaru.Database/Models/RemoteApplication.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Remote application + /// public class RemoteApplication : BaseOperatingSystem {} } \ No newline at end of file diff --git a/Aaru.Database/Models/RemoteArchitecture.cs b/Aaru.Database/Models/RemoteArchitecture.cs index 7805922a0..75df98a8b 100644 --- a/Aaru.Database/Models/RemoteArchitecture.cs +++ b/Aaru.Database/Models/RemoteArchitecture.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Remote architecture + /// public class RemoteArchitecture : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Database/Models/RemoteOperatingSystem.cs b/Aaru.Database/Models/RemoteOperatingSystem.cs index 3e4e8833b..0da5e617f 100644 --- a/Aaru.Database/Models/RemoteOperatingSystem.cs +++ b/Aaru.Database/Models/RemoteOperatingSystem.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Remote operating system + /// public class RemoteOperatingSystem : BaseOperatingSystem {} } \ No newline at end of file diff --git a/Aaru.Database/Models/Report.cs b/Aaru.Database/Models/Report.cs index 4fd5f0c50..a13cc5af5 100644 --- a/Aaru.Database/Models/Report.cs +++ b/Aaru.Database/Models/Report.cs @@ -35,14 +35,24 @@ using Aaru.CommonTypes.Metadata; namespace Aaru.Database.Models { + /// + /// Device report + /// public class Report : DeviceReportV2 { + /// + /// Builds an empty device report + /// public Report() { Created = DateTime.UtcNow; Uploaded = false; } + /// + /// Builds a device report model from a device report + /// + /// Device report public Report(DeviceReportV2 report) { ATA = report.ATA; @@ -62,7 +72,13 @@ namespace Aaru.Database.Models Type = report.Type; } + /// + /// Date when the device report was created + /// public DateTime Created { get; set; } + /// + /// If this model has already been upload + /// public bool Uploaded { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/UsbProduct.cs b/Aaru.Database/Models/UsbProduct.cs index 8f15556cf..7d9d0e731 100644 --- a/Aaru.Database/Models/UsbProduct.cs +++ b/Aaru.Database/Models/UsbProduct.cs @@ -35,10 +35,22 @@ using System.ComponentModel.DataAnnotations; namespace Aaru.Database.Models { + /// + /// USB product + /// public class UsbProduct { + /// + /// Builds an empty USB product + /// public UsbProduct() {} + /// + /// Builds a USB product with the specified parameters + /// + /// Vendor ID + /// Product ID + /// Product name public UsbProduct(ushort vendorId, ushort id, string product) { VendorId = vendorId; @@ -47,13 +59,34 @@ namespace Aaru.Database.Models AddedWhen = ModifiedWhen = DateTime.UtcNow; } + /// + /// Database ID + /// [Key] public int Id { get; set; } + /// + /// Product ID + /// public ushort ProductId { get; set; } + /// + /// Product name + /// public string Product { get; set; } + /// + /// Date when model has been added to the database + /// public DateTime AddedWhen { get; set; } + /// + /// Date when model was last modified + /// public DateTime ModifiedWhen { get; set; } + /// + /// USB vendor ID + /// public ushort VendorId { get; set; } + /// + /// Database link to USB vendor + /// public virtual UsbVendor Vendor { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/UsbVendor.cs b/Aaru.Database/Models/UsbVendor.cs index 1a4ebeb77..3098519bb 100644 --- a/Aaru.Database/Models/UsbVendor.cs +++ b/Aaru.Database/Models/UsbVendor.cs @@ -36,10 +36,21 @@ using System.ComponentModel.DataAnnotations; namespace Aaru.Database.Models { + /// + /// USB vendor + /// public class UsbVendor { + /// + /// Builds an empty USB vendor + /// public UsbVendor() {} + /// + /// Builds a USB vendor with the specified parameters + /// + /// Vendor ID + /// Vendor name public UsbVendor(ushort id, string vendor) { Id = id; @@ -47,12 +58,27 @@ namespace Aaru.Database.Models AddedWhen = ModifiedWhen = DateTime.UtcNow; } + /// + /// Database ID + /// [Key] public ushort Id { get; set; } + /// + /// Vendor name + /// public string Vendor { get; set; } + /// + /// Date when model has been added to the database + /// public DateTime AddedWhen { get; set; } + /// + /// Date when model was last modified + /// public DateTime ModifiedWhen { get; set; } + /// + /// List of products from this vendor + /// public virtual ICollection Products { get; set; } } } \ No newline at end of file diff --git a/Aaru.Database/Models/Version.cs b/Aaru.Database/Models/Version.cs index 58a688544..e831b8a79 100644 --- a/Aaru.Database/Models/Version.cs +++ b/Aaru.Database/Models/Version.cs @@ -32,5 +32,8 @@ namespace Aaru.Database.Models { + /// + /// Aaru version + /// public class Version : NameCountModel {} } \ No newline at end of file diff --git a/Aaru.Decoders b/Aaru.Decoders index 6e744af7f..f7fa22672 160000 --- a/Aaru.Decoders +++ b/Aaru.Decoders @@ -1 +1 @@ -Subproject commit 6e744af7f3b20e89de7abf82b55114f99c40c90e +Subproject commit f7fa226727375a8e093d8252d95f4a02c4b45cf0 diff --git a/Aaru.Devices/Device/AtaCommands/Ata28.cs b/Aaru.Devices/Device/AtaCommands/Ata28.cs index d06e55139..bd448c255 100644 --- a/Aaru.Devices/Device/AtaCommands/Ata28.cs +++ b/Aaru.Devices/Device/AtaCommands/Ata28.cs @@ -37,6 +37,14 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Reads the drive buffer using PIO transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadBuffer(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { @@ -58,6 +66,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads the drive buffer using DMA transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadBufferDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { @@ -78,10 +94,31 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using 28-bit addressing and DMA transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count, uint timeout, out double duration) => ReadDma(out buffer, out statusRegisters, true, lba, count, timeout, out duration); + /// + /// Reads sectors using 48-bit addressing and DMA transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Retry on error + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count, uint timeout, out double duration) { @@ -109,6 +146,16 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using 28-bit addressing and PIO transfer, sending an interrupt only after all the sectors have been transferred + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadMultiple(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count, uint timeout, out double duration) { @@ -137,6 +184,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads native max address using 28-bit addressing + /// + /// Maximum addressable block + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadNativeMaxAddress(out uint lba, out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { @@ -170,10 +225,31 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using 28-bit addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Read(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count, uint timeout, out double duration) => Read(out buffer, out statusRegisters, true, lba, count, timeout, out duration); + /// + /// Reads sectors using 28-bit addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// Retry on error + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Read(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count, uint timeout, out double duration) { @@ -202,10 +278,31 @@ namespace Aaru.Devices return sense; } + /// + /// Reads a long sector using 28-bit addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// Size in bytes of the long sector + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, uint blockSize, uint timeout, out double duration) => ReadLong(out buffer, out statusRegisters, true, lba, blockSize, timeout, out duration); + /// + /// Reads a long sector using 28-bit addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// Retry on error + /// LBA of read start + /// Size in bytes of the long sector + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, uint blockSize, uint timeout, out double duration) { @@ -234,6 +331,14 @@ namespace Aaru.Devices return sense; } + /// + /// Sets the reading mechanism ready to read the specified block using 28-bit LBA addressing + /// + /// Returned status registers + /// LBA to position reading mechanism ready to read + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Seek(out AtaErrorRegistersLba28 statusRegisters, uint lba, uint timeout, out double duration) { byte[] buffer = new byte[0]; diff --git a/Aaru.Devices/Device/AtaCommands/Ata48.cs b/Aaru.Devices/Device/AtaCommands/Ata48.cs index 533cf73eb..d60ba5a4b 100644 --- a/Aaru.Devices/Device/AtaCommands/Ata48.cs +++ b/Aaru.Devices/Device/AtaCommands/Ata48.cs @@ -37,6 +37,14 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Gets native max address using 48-bit addressing + /// + /// Maximum addressable block + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool GetNativeMaxAddressExt(out ulong lba, out AtaErrorRegistersLba48 statusRegisters, uint timeout, out double duration) { @@ -71,6 +79,16 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using 48-bit addressing and DMA transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// How many blocks to read, or 0 to indicate 65536 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba48 statusRegisters, ulong lba, ushort count, uint timeout, out double duration) { @@ -100,6 +118,17 @@ namespace Aaru.Devices return sense; } + /// + /// Reads a drive log using PIO transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Log address + /// Log page number + /// How log blocks to read + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadLog(out byte[] buffer, out AtaErrorRegistersLba48 statusRegisters, byte logAddress, ushort pageNumber, ushort count, uint timeout, out double duration) { @@ -126,6 +155,17 @@ namespace Aaru.Devices return sense; } + /// + /// Reads a drive log using DMA transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Log address + /// Log page number + /// How log blocks to read + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadLogDma(out byte[] buffer, out AtaErrorRegistersLba48 statusRegisters, byte logAddress, ushort pageNumber, ushort count, uint timeout, out double duration) { @@ -151,6 +191,16 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using 48-bit addressing and PIO transfer, sending an interrupt only after all the sectors have been transferred + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadMultiple(out byte[] buffer, out AtaErrorRegistersLba48 statusRegisters, ulong lba, ushort count, uint timeout, out double duration) { @@ -181,6 +231,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads native max address using 48-bit addressing + /// + /// Maximum addressable block + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadNativeMaxAddress(out ulong lba, out AtaErrorRegistersLba48 statusRegisters, uint timeout, out double duration) { @@ -216,6 +274,16 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using 48-bit addressing and PIO transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// LBA of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Read(out byte[] buffer, out AtaErrorRegistersLba48 statusRegisters, ulong lba, ushort count, uint timeout, out double duration) { diff --git a/Aaru.Devices/Device/AtaCommands/AtaCHS.cs b/Aaru.Devices/Device/AtaCommands/AtaCHS.cs index 740e0543f..3a9e0beb9 100644 --- a/Aaru.Devices/Device/AtaCommands/AtaCHS.cs +++ b/Aaru.Devices/Device/AtaCommands/AtaCHS.cs @@ -87,10 +87,35 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using CHS addressing and DMA transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadDma(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration) => ReadDma(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration); + /// + /// Reads sectors using CHS addressing and DMA transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Retry on error + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadDma(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, bool retry, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration) { @@ -116,6 +141,18 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using CHS addressing and PIO transfer, sending an interrupt only after all the sectors have been transferred + /// + /// Buffer that contains the read data + /// Returned status registers + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadMultiple(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration) { @@ -142,10 +179,35 @@ namespace Aaru.Devices return sense; } + /// + /// Reads sectors using CHS addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Read(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration) => Read(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration); + /// + /// Reads sectors using CHS addressing and PIO transfer + /// + /// Buffer that contains the read data + /// Returned status registers + /// Retry on error + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// How many blocks to read, or 0 to indicate 256 blocks + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Read(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, bool retry, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration) { @@ -172,10 +234,35 @@ namespace Aaru.Devices return sense; } + /// + /// Reads a long sector using CHS addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// Size in bytes of the long sector + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadLong(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, uint blockSize, uint timeout, out double duration) => ReadLong(out buffer, out statusRegisters, true, cylinder, head, sector, blockSize, timeout, out duration); + /// + /// Reads a long sector using CHS addressing and PIO transfer, retrying on error + /// + /// Buffer that contains the read data + /// Returned status registers + /// Retry on error + /// Cylinder of read start + /// Head of read start + /// Sector of read start + /// Size in bytes of the long sector + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadLong(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, bool retry, ushort cylinder, byte head, byte sector, uint blockSize, uint timeout, out double duration) { @@ -202,6 +289,16 @@ namespace Aaru.Devices return sense; } + /// + /// Sets the reading mechanism ready to read the specified block using CHS addressing + /// + /// Returned status registers + /// Cylinder to position reading mechanism ready to read + /// Head to position reading mechanism ready to read + /// Sector to position reading mechanism ready to read + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Seek(out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, uint timeout, out double duration) { @@ -227,10 +324,30 @@ namespace Aaru.Devices return sense; } + /// + /// Enables drive features + /// + /// Returned status registers + /// Feature to enable + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SetFeatures(out AtaErrorRegistersChs statusRegisters, AtaFeatures feature, uint timeout, out double duration) => SetFeatures(out statusRegisters, feature, 0, 0, 0, 0, timeout, out duration); + /// + /// Enables drive features + /// + /// Returned status registers + /// Feature to enable + /// Value for the cylinder register + /// Value for the head register + /// Value for the sector register + /// Value for the sector count register + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SetFeatures(out AtaErrorRegistersChs statusRegisters, AtaFeatures feature, ushort cylinder, byte head, byte sector, byte sectorCount, uint timeout, out double duration) { @@ -258,6 +375,13 @@ namespace Aaru.Devices return sense; } + /// + /// Prevents ejection of the media inserted in the drive + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool DoorLock(out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) { byte[] buffer = new byte[0]; @@ -278,6 +402,13 @@ namespace Aaru.Devices return sense; } + /// + /// Allows ejection of the media inserted in the drive + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool DoorUnlock(out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) { byte[] buffer = new byte[0]; @@ -298,6 +429,13 @@ namespace Aaru.Devices return sense; } + /// + /// Ejects the media inserted in the drive + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool MediaEject(out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) { byte[] buffer = new byte[0]; diff --git a/Aaru.Devices/Device/AtaCommands/Cfa.cs b/Aaru.Devices/Device/AtaCommands/Cfa.cs index a64fde7b9..228738ec2 100644 --- a/Aaru.Devices/Device/AtaCommands/Cfa.cs +++ b/Aaru.Devices/Device/AtaCommands/Cfa.cs @@ -37,6 +37,15 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Requests to translate an LBA to a card physical address + /// + /// Data buffer + /// Returned status registers + /// LBA to start reading from + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool TranslateSector(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, uint timeout, out double duration) { @@ -64,6 +73,17 @@ namespace Aaru.Devices return sense; } + /// + /// Requests to translate a CHS to a card physical address + /// + /// Data buffer + /// Returned status registers + /// Cylinder + /// Head + /// Sector + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool TranslateSector(out byte[] buffer, out AtaErrorRegistersChs statusRegisters, ushort cylinder, byte head, byte sector, uint timeout, out double duration) { @@ -89,6 +109,14 @@ namespace Aaru.Devices return sense; } + /// + /// Requests an extended error code + /// + /// Error code + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool RequestExtendedErrorCode(out byte errorCode, out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { diff --git a/Aaru.Devices/Device/AtaCommands/MCPT.cs b/Aaru.Devices/Device/AtaCommands/MCPT.cs index e5da92883..e1c045d12 100644 --- a/Aaru.Devices/Device/AtaCommands/MCPT.cs +++ b/Aaru.Devices/Device/AtaCommands/MCPT.cs @@ -37,14 +37,36 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Enables media card pass through + /// + /// Status registers. + /// Timeout in seconds + /// Time it took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool EnableMediaCardPassThrough(out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) => CheckMediaCardType(1, out statusRegisters, timeout, out duration); + /// + /// Disables media card pass through + /// + /// Status registers. + /// Timeout in seconds + /// Time it took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool DisableMediaCardPassThrough(out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) => CheckMediaCardType(0, out statusRegisters, timeout, out duration); + /// + /// Checks media card pass through + /// + /// Feature + /// Status registers. + /// Timeout in seconds + /// Time it took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool CheckMediaCardType(byte feature, out AtaErrorRegistersChs statusRegisters, uint timeout, out double duration) { diff --git a/Aaru.Devices/Device/AtaCommands/Smart.cs b/Aaru.Devices/Device/AtaCommands/Smart.cs index 754475fcf..23b451ae7 100644 --- a/Aaru.Devices/Device/AtaCommands/Smart.cs +++ b/Aaru.Devices/Device/AtaCommands/Smart.cs @@ -37,6 +37,13 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Disables S.M.A.R.T. + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartDisable(out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { byte[] buffer = new byte[0]; @@ -60,6 +67,13 @@ namespace Aaru.Devices return sense; } + /// + /// Enables auto-saving of S.M.A.R.T. attributes + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartEnableAttributeAutosave(out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { @@ -85,6 +99,13 @@ namespace Aaru.Devices return sense; } + /// + /// Disables auto-saving of S.M.A.R.T. attributes + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartDisableAttributeAutosave(out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { @@ -109,6 +130,13 @@ namespace Aaru.Devices return sense; } + /// + /// Enables S.M.A.R.T. + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartEnable(out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { byte[] buffer = new byte[0]; @@ -132,6 +160,14 @@ namespace Aaru.Devices return sense; } + /// + /// Requests drive to execute offline immediate S.M.A.R.T. test + /// + /// Subcommand + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartExecuteOffLineImmediate(out AtaErrorRegistersLba28 statusRegisters, byte subcommand, uint timeout, out double duration) { @@ -157,6 +193,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads S.M.A.R.T. data + /// + /// Buffer containing data + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartReadData(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { @@ -181,6 +225,15 @@ namespace Aaru.Devices return sense; } + /// + /// Reads S.M.A.R.T. log + /// + /// Buffer containing log + /// Returned status registers + /// Log address + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartReadLog(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, byte logAddress, uint timeout, out double duration) { @@ -206,6 +259,13 @@ namespace Aaru.Devices return sense; } + /// + /// Retrieves S.M.A.R.T. status + /// + /// Returned status registers + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SmartReturnStatus(out AtaErrorRegistersLba28 statusRegisters, uint timeout, out double duration) { byte[] buffer = new byte[0]; diff --git a/Aaru.Devices/Device/Commands.cs b/Aaru.Devices/Device/Commands.cs index c6aa7a3b0..72a0bbde1 100644 --- a/Aaru.Devices/Device/Commands.cs +++ b/Aaru.Devices/Device/Commands.cs @@ -242,19 +242,59 @@ namespace Aaru.Devices timeout); } + /// + /// Encapsulates a single MMC command to send in a queue + /// + [SuppressMessage("ReSharper", "InconsistentNaming")] + [SuppressMessage("ReSharper", "MemberCanBeInternal")] public class MmcSingleCommand { + /// + /// Command argument + /// public uint argument; + /// + /// How many blocks to transfer + /// public uint blocks; + /// + /// Size of block in bytes + /// public uint blockSize; + /// + /// Buffer for MMC/SD command response + /// public byte[] buffer; + /// + /// MMC/SD opcode + /// public MmcCommands command; + /// + /// Flags indicating kind and place of response + /// public MmcFlags flags; + /// + /// True if command should be preceded with CMD55 + /// public bool isApplication; + /// + /// Response registers + /// public uint[] response; + /// + /// True if data is sent from host to card + /// public bool write; } + /// + /// Concatenates a queue of commands to be send to a remote SecureDigital or MultiMediaCard attached to an SDHCI controller + /// + /// List of commands + /// Duration to execute all commands, in milliseconds + /// Set to true if any of the commands returned an error status, false otherwise + /// Maximum allowed time to execute a single command + /// 0 if no error occurred, otherwise, errno public int SendMultipleMmcCommands(MmcSingleCommand[] commands, out double duration, out bool sense, uint timeout = 15) { @@ -293,6 +333,10 @@ namespace Aaru.Devices return error; } + /// + /// Closes then immediately reopens a device + /// + /// Returned error number if any public bool ReOpen() { if(!(_remote is null)) @@ -308,6 +352,14 @@ namespace Aaru.Devices return Error; } + /// + /// Reads data using operating system buffers. + /// + /// Data buffer + /// Offset in remote device to start reading, in bytes + /// Number of bytes to read + /// Total time in milliseconds the reading took + /// true if there was an error, false otherwise public bool BufferedOsRead(out byte[] buffer, long offset, uint length, out double duration) { if(!(_remote is null)) diff --git a/Aaru.Devices/Device/Constructor.cs b/Aaru.Devices/Device/Constructor.cs index 2a1862b90..e35a63e97 100644 --- a/Aaru.Devices/Device/Constructor.cs +++ b/Aaru.Devices/Device/Constructor.cs @@ -59,6 +59,9 @@ using VendorString = Aaru.Decoders.SecureDigital.VendorString; namespace Aaru.Devices { + /// + /// Implements a device or media containing drive + /// [SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "UnusedMember.Global"), SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public sealed partial class Device diff --git a/Aaru.Devices/Device/Destructor.cs b/Aaru.Devices/Device/Destructor.cs index 797d289c6..ff65d632e 100644 --- a/Aaru.Devices/Device/Destructor.cs +++ b/Aaru.Devices/Device/Destructor.cs @@ -45,6 +45,9 @@ namespace Aaru.Devices /// ~Device() => Close(); + /// + /// Closes a device + /// public void Close() { if(_remote != null) diff --git a/Aaru.Devices/Device/List.cs b/Aaru.Devices/Device/List.cs index 3f7cb45f7..90a370985 100644 --- a/Aaru.Devices/Device/List.cs +++ b/Aaru.Devices/Device/List.cs @@ -38,35 +38,75 @@ using PlatformID = Aaru.CommonTypes.Interop.PlatformID; namespace Aaru.Devices { + /// + /// Contains device information + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct DeviceInfo { + /// + /// Device path + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string Path; + /// + /// Device vendor or manufacturer + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Vendor; + /// + /// Device model or product name + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Model; + /// + /// Device serial number + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Serial; + /// + /// Bus the device is attached to + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Bus; + /// + /// Set to true if Aaru can send commands to the device in the current machine or remote, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool Supported; + /// + /// Padding + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] Padding; } public sealed partial class Device { + /// + /// Lists devices attached to current machine + /// + /// List of devices public static DeviceInfo[] ListDevices() => ListDevices(out _, out _, out _, out _, out _, out _); + /// + /// Lists devices attached to current machine or specified remote + /// + /// Is remote + /// Remote application + /// Remote application version + /// Remote operating system name + /// Remote operating system version + /// Remote architecture + /// Remote URI + /// List of devices + /// public static DeviceInfo[] ListDevices(out bool isRemote, out string serverApplication, out string serverVersion, out string serverOperatingSystem, out string serverOperatingSystemVersion, out string serverArchitecture, diff --git a/Aaru.Devices/Device/MmcCommands/MMC.cs b/Aaru.Devices/Device/MmcCommands/MMC.cs index 0524d8376..1354061c7 100644 --- a/Aaru.Devices/Device/MmcCommands/MMC.cs +++ b/Aaru.Devices/Device/MmcCommands/MMC.cs @@ -37,6 +37,14 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Reads the CSD register from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadCsd(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[16]; @@ -52,6 +60,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads the CID register from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadCid(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[16]; @@ -67,6 +83,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads the OCR register from a MultiMediaCard device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadOcr(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[4]; @@ -82,6 +106,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads the extended CSD from a MultiMediaCard device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadExtendedCsd(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[512]; @@ -97,6 +129,14 @@ namespace Aaru.Devices return sense; } + /// + /// Sets the block length for transfers from a SecureDigital or MultiMediaCard device + /// + /// Block length in bytes + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool SetBlockLength(uint length, out uint[] response, uint timeout, out double duration) { byte[] buffer = new byte[0]; @@ -112,6 +152,18 @@ namespace Aaru.Devices return sense; } + /// + /// Reads blocks from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// LBA to start reading from + /// Block size in bytes + /// Number of bytes to transfer + /// Card is byte-addressed + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool Read(out byte[] buffer, out uint[] response, uint lba, uint blockSize, ushort transferLength, bool byteAddressed, uint timeout, out double duration) { @@ -134,6 +186,17 @@ namespace Aaru.Devices return sense; } + /// + /// Reads a single block from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// LBA to start reading from + /// Block size in bytes + /// Card is byte-addressed + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadSingleBlock(out byte[] buffer, out uint[] response, uint lba, uint blockSize, bool byteAddressed, uint timeout, out double duration) { @@ -159,6 +222,18 @@ namespace Aaru.Devices static bool _readMultipleBlockCannotSetBlockCount; + /// + /// Reads multiple blocks from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// LBA to start reading from + /// Block size in bytes + /// Number of bytes to transfer + /// Card is byte-addressed + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadMultipleBlock(out byte[] buffer, out uint[] response, uint lba, uint blockSize, ushort transferLength, bool byteAddressed, uint timeout, out double duration) { @@ -190,6 +265,18 @@ namespace Aaru.Devices return sense; } + /// + /// Reads blocks using a single block read from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// LBA to start reading from + /// Block size in bytes + /// Number of bytes to transfer + /// Card is byte-addressed + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadMultipleUsingSingle(out byte[] buffer, out uint[] response, uint lba, uint blockSize, ushort transferLength, bool byteAddressed, uint timeout, out double duration) @@ -229,6 +316,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads status register from a MultiMediaCard device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadStatus(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[4]; @@ -244,6 +339,18 @@ namespace Aaru.Devices return sense; } + /// + /// Reads blocks with block count from a SecureDigital or MultiMediaCard device + /// + /// Data buffer + /// Response + /// LBA to start reading from + /// Block size in bytes + /// Number of bytes to transfer + /// Card is byte-addressed + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadWithBlockCount(out byte[] buffer, out uint[] response, uint lba, uint blockSize, ushort transferLength, bool byteAddressed, uint timeout, out double duration) { diff --git a/Aaru.Devices/Device/MmcCommands/SecureDigital.cs b/Aaru.Devices/Device/MmcCommands/SecureDigital.cs index 9482b59b9..3bcfa7dd9 100644 --- a/Aaru.Devices/Device/MmcCommands/SecureDigital.cs +++ b/Aaru.Devices/Device/MmcCommands/SecureDigital.cs @@ -36,6 +36,14 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Reads the status register from a SecureDigital device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadSdStatus(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[64]; @@ -51,6 +59,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads the OCR register from a SecureDigital device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadSdocr(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[4]; @@ -66,6 +82,14 @@ namespace Aaru.Devices return sense; } + /// + /// Reads the SCR register from a SecureDigital device + /// + /// Data buffer + /// Response + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool ReadScr(out byte[] buffer, out uint[] response, uint timeout, out double duration) { buffer = new byte[8]; diff --git a/Aaru.Devices/Device/ScsiCommands/Fujitsu.cs b/Aaru.Devices/Device/ScsiCommands/Fujitsu.cs index c95f70166..1745b6c45 100644 --- a/Aaru.Devices/Device/ScsiCommands/Fujitsu.cs +++ b/Aaru.Devices/Device/ScsiCommands/Fujitsu.cs @@ -39,6 +39,17 @@ namespace Aaru.Devices { public sealed partial class Device { + /// + /// Sets the data for the integrated display + /// + /// Returned SENSE buffer + /// If the display should start flashing + /// Display mode + /// String to be shown in the first line of the display + /// String to be shown in the second line of the display + /// Timeout to wait for command execution + /// Time the device took to execute the command in milliseconds + /// true if the device set an error condition, false otherwise public bool FujitsuDisplay(out byte[] senseBuffer, bool flash, FujitsuDisplayModes mode, string firstHalf, string secondHalf, uint timeout, out double duration) { diff --git a/Aaru.Devices/Device/ScsiCommands/MMC.cs b/Aaru.Devices/Device/ScsiCommands/MMC.cs index b73e6210b..2e0f2339a 100644 --- a/Aaru.Devices/Device/ScsiCommands/MMC.cs +++ b/Aaru.Devices/Device/ScsiCommands/MMC.cs @@ -527,12 +527,29 @@ namespace Aaru.Devices return sense; } + /// Prevents ejection of the media inserted in the drive + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool PreventMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) => PreventAllowMediumRemoval(out senseBuffer, false, true, timeout, out duration); + /// Allows ejection of the media inserted in the drive + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool AllowMediumRemoval(out byte[] senseBuffer, uint timeout, out double duration) => PreventAllowMediumRemoval(out senseBuffer, false, false, timeout, out duration); + /// Prevents or allows ejection of the media inserted in the drive + /// Sense buffer. + /// Persistent. + /// Prevent. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool PreventAllowMediumRemoval(out byte[] senseBuffer, bool persistent, bool prevent, uint timeout, out double duration) { @@ -560,18 +577,49 @@ namespace Aaru.Devices return sense; } + /// Loads the media tray + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool LoadTray(out byte[] senseBuffer, uint timeout, out double duration) => StartStopUnit(out senseBuffer, false, 0, 0, false, true, true, timeout, out duration); + /// Ejects the media or its tray + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool EjectTray(out byte[] senseBuffer, uint timeout, out double duration) => StartStopUnit(out senseBuffer, false, 0, 0, false, true, false, timeout, out duration); + /// Starts the drive's reading mechanism + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool StartUnit(out byte[] senseBuffer, uint timeout, out double duration) => StartStopUnit(out senseBuffer, false, 0, 0, false, false, true, timeout, out duration); + /// Stops the drive's reading mechanism + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool StopUnit(out byte[] senseBuffer, uint timeout, out double duration) => StartStopUnit(out senseBuffer, false, 0, 0, false, false, false, timeout, out duration); + /// Starts or stops the drive's reading mechanism or tray + /// Sense buffer. + /// Return from execution immediately + /// Choose density layer for hybrid discs + /// Power condition + /// Change format layer + /// Loads or ejects the media + /// Starts the mechanism + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool StartStopUnit(out byte[] senseBuffer, bool immediate, byte formatLayer, byte powerConditions, bool changeFormatLayer, bool loadEject, bool start, uint timeout, out double duration) { @@ -613,6 +661,13 @@ namespace Aaru.Devices return sense; } + /// Reads the MCN from a disc + /// Decoded MCN. + /// Buffer containing raw drive response. + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool ReadMcn(out string mcn, out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { @@ -645,6 +700,14 @@ namespace Aaru.Devices return sense; } + /// Reads the ISRC from a track + /// Track number. + /// Decoded ISRC. + /// Buffer containing raw drive response. + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool ReadIsrc(byte trackNumber, out string isrc, out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { @@ -678,6 +741,14 @@ namespace Aaru.Devices return sense; } + /// Sets the reading speed + /// Sense buffer. + /// Rotational control. + /// Read speed. + /// Write speed. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool SetCdSpeed(out byte[] senseBuffer, RotationalControl rotationalControl, ushort readSpeed, ushort writeSpeed, uint timeout, out double duration) { diff --git a/Aaru.Devices/Device/ScsiCommands/MiniDisc.cs b/Aaru.Devices/Device/ScsiCommands/MiniDisc.cs index 0ee611d07..aeff45573 100644 --- a/Aaru.Devices/Device/ScsiCommands/MiniDisc.cs +++ b/Aaru.Devices/Device/ScsiCommands/MiniDisc.cs @@ -31,11 +31,18 @@ // ****************************************************************************/ using Aaru.Console; +// ReSharper disable InconsistentNaming namespace Aaru.Devices { public sealed partial class Device { + /// Reads the data TOC from an MD-DATA + /// Buffer where the response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool MiniDiscReadDataTOC(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { ushort transferLength = 2336; @@ -59,6 +66,13 @@ namespace Aaru.Devices return sense; } + /// Reads the user TOC from an MD-DATA + /// Buffer where the response will be stored + /// Sense buffer. + /// TOC sector to read + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool MiniDiscReadUserTOC(out byte[] buffer, out byte[] senseBuffer, uint sector, uint timeout, out double duration) { @@ -87,6 +101,12 @@ namespace Aaru.Devices return sense; } + /// Sends a D5h command to a MD-DATA drive (harmless) + /// Buffer where the response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool MiniDiscD5(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { ushort transferLength = 4; @@ -110,7 +130,13 @@ namespace Aaru.Devices return sense; } - public bool MiniDiscStopPlaying(out byte[] buffer, out byte[] senseBuffer, uint sector, uint timeout, + /// Stops playing MiniDisc audio from an MD-DATA drive + /// Buffer where the response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. + public bool MiniDiscStopPlaying(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { senseBuffer = new byte[64]; @@ -130,6 +156,12 @@ namespace Aaru.Devices return sense; } + /// Gets current position while playing MiniDisc audio from an MD-DATA drive + /// Buffer where the response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool MiniDiscReadPosition(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { ushort transferLength = 4; @@ -153,6 +185,12 @@ namespace Aaru.Devices return sense; } + /// Gets MiniDisc type from an MD-DATA drive + /// Buffer where the response will be stored + /// Sense buffer. + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed and contains the sense buffer. public bool MiniDiscGetType(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration) { ushort transferLength = 8; diff --git a/Aaru.Devices/Device/ScsiCommands/SPC.cs b/Aaru.Devices/Device/ScsiCommands/SPC.cs index d1bbea032..b71dc35b3 100644 --- a/Aaru.Devices/Device/ScsiCommands/SPC.cs +++ b/Aaru.Devices/Device/ScsiCommands/SPC.cs @@ -777,9 +777,24 @@ namespace Aaru.Devices return sense; } + /// + /// Requests the device fixed sense + /// + /// Sense buffer + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed. public bool RequestSense(out byte[] buffer, uint timeout, out double duration) => RequestSense(false, out buffer, timeout, out duration); + /// + /// Requests the device sense + /// + /// Request a descriptor sense + /// Sense buffer + /// Timeout in seconds. + /// Duration in milliseconds it took for the device to execute the command. + /// true if the command failed. public bool RequestSense(bool descriptor, out byte[] buffer, uint timeout, out double duration) { byte[] cdb = new byte[6]; diff --git a/Aaru.Devices/Device/ScsiCommands/SSC.cs b/Aaru.Devices/Device/ScsiCommands/SSC.cs index bdfe109cd..a50b4ebd9 100644 --- a/Aaru.Devices/Device/ScsiCommands/SSC.cs +++ b/Aaru.Devices/Device/ScsiCommands/SSC.cs @@ -952,6 +952,15 @@ namespace Aaru.Devices return sense; } + /// + /// Writes a space mark in the media + /// + /// Sense buffer. + /// Space type code. + /// How many marks to write + /// Timeout. + /// Duration. + /// true, if select was tracked, false otherwise. public bool Space(out byte[] senseBuffer, SscSpaceCodes code, int count, uint timeout, out double duration) { senseBuffer = new byte[64]; diff --git a/Aaru.Devices/Device/Variables.cs b/Aaru.Devices/Device/Variables.cs index efe9d36c9..f7156b4ef 100644 --- a/Aaru.Devices/Device/Variables.cs +++ b/Aaru.Devices/Device/Variables.cs @@ -166,6 +166,9 @@ namespace Aaru.Devices bool? _isRemoteAdmin; readonly string _devicePath; + /// + /// Returns if remote is running under administrative (aka root) privileges + /// public bool IsRemoteAdmin { get @@ -176,12 +179,33 @@ namespace Aaru.Devices } } + /// + /// Current device is remote + /// public bool IsRemote => _remote != null; + /// + /// Remote application + /// public string RemoteApplication => _remote?.ServerApplication; + /// + /// Remote application server + /// public string RemoteVersion => _remote?.ServerVersion; + /// + /// Remote operating system name + /// public string RemoteOperatingSystem => _remote?.ServerOperatingSystem; + /// + /// Remote operating system version + /// public string RemoteOperatingSystemVersion => _remote?.ServerOperatingSystemVersion; + /// + /// Remote architecture + /// public string RemoteArchitecture => _remote?.ServerArchitecture; + /// + /// Remote protocol version + /// public int RemoteProtocolVersion => _remote?.ServerProtocolVersion ?? 0; } } \ No newline at end of file diff --git a/Aaru.Devices/Enums.cs b/Aaru.Devices/Enums.cs index f67eeb297..0f9c9ddc1 100644 --- a/Aaru.Devices/Enums.cs +++ b/Aaru.Devices/Enums.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +#pragma warning disable 1591 // ReSharper disable UnusedType.Global diff --git a/Aaru.Devices/Remote/Consts.cs b/Aaru.Devices/Remote/Consts.cs index 9cd201b1e..e629adf57 100644 --- a/Aaru.Devices/Remote/Consts.cs +++ b/Aaru.Devices/Remote/Consts.cs @@ -32,11 +32,26 @@ namespace Aaru.Devices.Remote { + /// + /// AaruRemote protocol constants + /// public class Consts { + /// + /// Primary unique packet identifier + /// public const uint REMOTE_ID = 0x52434944; // "DICR" + /// + /// Secondary unique packet identifier + /// public const uint PACKET_ID = 0x544B4350; // "PCKT" + /// + /// Default packet version + /// public const int PACKET_VERSION = 1; + /// + /// Maximum supported protocol version + /// public const int MAX_PROTOCOL = 2; } } \ No newline at end of file diff --git a/Aaru.Devices/Remote/Enums.cs b/Aaru.Devices/Remote/Enums.cs index fc6c8b807..0102d43df 100644 --- a/Aaru.Devices/Remote/Enums.cs +++ b/Aaru.Devices/Remote/Enums.cs @@ -32,8 +32,12 @@ namespace Aaru.Devices.Remote { + /// + /// Packet type enumeration + /// public enum AaruPacketType : sbyte { + #pragma warning disable 1591 Nop = -1, Hello = 1, CommandListDevices = 2, ResponseListDevices = 3, CommandOpen = 4, CommandScsi = 5, ResponseScsi = 6, CommandAtaChs = 7, ResponseAtaChs = 8, @@ -45,12 +49,45 @@ namespace Aaru.Devices.Remote ResponseGetPcmciaData = 24, CommandCloseDevice = 25, CommandAmIRoot = 26, ResponseAmIRoot = 27, MultiCommandSdhci = 28, ResponseMultiSdhci = 29, CommandReOpenDevice = 30, CommandOsRead = 31, ResponseOsRead = 32 + #pragma warning restore 1591 } + /// + /// Reasons for non-data request or response + /// public enum AaruNopReason : byte { - OutOfOrder = 0, NotImplemented = 1, NotRecognized = 2, - ErrorListDevices = 3, OpenOk = 4, OpenError = 5, - ReOpenOk = 6, CloseError = 7 + /// + /// Request or response has arrived unexpectedly + /// + OutOfOrder = 0, + /// + /// Packet or version of packet is not implemented + /// + NotImplemented = 1, + /// + /// Unknown or non-recognized packet + /// + NotRecognized = 2, + /// + /// Error trying to get list of devices + /// + ErrorListDevices = 3, + /// + /// Device opened correctly + /// + OpenOk = 4, + /// + /// An error occurred opening the device + /// + OpenError = 5, + /// + /// Device re-opened correctly + /// + ReOpenOk = 6, + /// + /// An error occurred closing the device + /// + CloseError = 7 } } \ No newline at end of file diff --git a/Aaru.Devices/Remote/Remote.cs b/Aaru.Devices/Remote/Remote.cs index dc8322cce..912328c38 100644 --- a/Aaru.Devices/Remote/Remote.cs +++ b/Aaru.Devices/Remote/Remote.cs @@ -43,14 +43,26 @@ using Aaru.Console; using Aaru.Decoders.ATA; using Marshal = Aaru.Helpers.Marshal; using Version = Aaru.CommonTypes.Interop.Version; +// ReSharper disable MemberCanBeInternal namespace Aaru.Devices.Remote { + /// + /// + /// Handles communication with a remote device that's connected using the AaruRemote protocol + /// public class Remote : IDisposable { readonly string _host; readonly Socket _socket; + /// + /// Connects using TCP/IP to the specified remote + /// + /// URI of the remote + /// Unsupported or invalid remote protocol. + /// Host not found. + /// Network error. public Remote(Uri uri) { if(uri.Scheme != "aaru" && @@ -185,13 +197,34 @@ namespace Aaru.Devices.Remote throw new IOException(); } + /// + /// Remote server application + /// public string ServerApplication { get; } + /// + /// Remote server application version + /// public string ServerVersion { get; } + /// + /// Remote server operating system + /// public string ServerOperatingSystem { get; } + /// + /// Remote server operating system version + /// public string ServerOperatingSystemVersion { get; } + /// + /// Remote server architecture + /// public string ServerArchitecture { get; } + /// + /// Remote server protocol version + /// public int ServerProtocolVersion { get; } + /// + /// Is remote running with administrative (aka root) privileges? + /// public bool IsRoot { get @@ -264,8 +297,12 @@ namespace Aaru.Devices.Remote } } + /// public void Dispose() => Disconnect(); + /// + /// Disconnects from remote + /// public void Disconnect() { try @@ -279,6 +316,10 @@ namespace Aaru.Devices.Remote } } + /// + /// Lists devices attached to remote + /// + /// List of devices public DeviceInfo[] ListDevices() { var cmdPkt = new AaruPacketCommandListDevices @@ -387,6 +428,13 @@ namespace Aaru.Devices.Remote return devices.ToArray(); } + /// + /// Opens the specified device path on the remote + /// + /// Device path + /// Returned error + /// true if opened correctly, falseotherwise + /// Support for the specified device has not yet been implemented in the remote application. public bool Open(string devicePath, out int lastError) { lastError = 0; @@ -474,6 +522,18 @@ namespace Aaru.Devices.Remote return false; } + /// Sends a SCSI command to the remote device + /// 0 if no error occurred, otherwise, errno + /// SCSI CDB + /// Buffer for SCSI command response + /// Buffer with the SCSI sense + /// Timeout in seconds + /// SCSI command transfer direction + /// Time it took to execute the command in milliseconds + /// + /// True if SCSI command returned non-OK status and contains + /// SCSI sense + /// public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, ScsiDirection direction, out double duration, out bool sense) { @@ -572,6 +632,20 @@ namespace Aaru.Devices.Remote return (int)res.error_no; } + /// Sends an ATA/ATAPI command to the remote device using CHS addressing + /// 0 if no error occurred, otherwise, errno + /// ATA registers. + /// Status/error registers. + /// ATA Protocol. + /// Indicates which register indicates the transfer length + /// Buffer for ATA/ATAPI command response + /// Timeout in seconds + /// + /// If set to true, transfer is indicated in blocks, otherwise, it is indicated in + /// bytes. + /// + /// Time it took to execute the command in milliseconds + /// True if ATA/ATAPI command returned non-OK status public int SendAtaCommand(AtaRegistersChs registers, out AtaErrorRegistersChs errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) @@ -667,6 +741,20 @@ namespace Aaru.Devices.Remote return (int)res.error_no; } + /// Sends an ATA/ATAPI command to the remote device using 28-bit LBA addressing + /// 0 if no error occurred, otherwise, errno + /// ATA registers. + /// Status/error registers. + /// ATA Protocol. + /// Indicates which register indicates the transfer length + /// Buffer for ATA/ATAPI command response + /// Timeout in seconds + /// + /// If set to true, transfer is indicated in blocks, otherwise, it is indicated in + /// bytes. + /// + /// Time it took to execute the command in milliseconds + /// True if ATA/ATAPI command returned non-OK status public int SendAtaCommand(AtaRegistersLba28 registers, out AtaErrorRegistersLba28 errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) @@ -763,6 +851,20 @@ namespace Aaru.Devices.Remote return (int)res.error_no; } + /// Sends an ATA/ATAPI command to the remote device using 48-bit LBA addressing + /// 0 if no error occurred, otherwise, errno + /// ATA registers. + /// Status/error registers. + /// ATA Protocol. + /// Indicates which register indicates the transfer length + /// Buffer for ATA/ATAPI command response + /// Timeout in seconds + /// + /// If set to true, transfer is indicated in blocks, otherwise, it is indicated in + /// bytes. + /// + /// Time it took to execute the command in milliseconds + /// True if ATA/ATAPI command returned non-OK status public int SendAtaCommand(AtaRegistersLba48 registers, out AtaErrorRegistersLba48 errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) @@ -859,6 +961,20 @@ namespace Aaru.Devices.Remote return (int)res.error_no; } + /// Sends a MMC/SD command to the remote device + /// The result of the command. + /// MMC/SD opcode + /// Buffer for MMC/SD command response + /// Timeout in seconds + /// Time it took to execute the command in milliseconds + /// True if MMC/SD returned non-OK status + /// True if data is sent from host to card + /// True if command should be preceded with CMD55 + /// Flags indicating kind and place of response + /// How many blocks to transfer + /// Command argument + /// Response registers + /// Size of block in bytes public int SendMmcCommand(MmcCommands command, bool write, bool isApplication, MmcFlags flags, uint argument, uint blockSize, uint blocks, ref byte[] buffer, out uint[] response, out double duration, out bool sense, uint timeout = 0) @@ -964,6 +1080,10 @@ namespace Aaru.Devices.Remote return (int)res.res.error_no; } + /// + /// Gets the for the remote device + /// + /// public DeviceType GetDeviceType() { var cmdPkt = new AaruPacketCmdGetDeviceType @@ -1033,6 +1153,14 @@ namespace Aaru.Devices.Remote return res.device_type; } + /// + /// Retrieves the SDHCI registers from the remote device + /// + /// CSD register + /// CID register + /// OCR register + /// SCR register + /// true if the device is attached to an SDHCI controller, false otherwise public bool GetSdhciRegisters(out byte[] csd, out byte[] cid, out byte[] ocr, out byte[] scr) { csd = null; @@ -1148,6 +1276,16 @@ namespace Aaru.Devices.Remote return res.isSdhci; } + /// + /// Gets the USB data from the remote device + /// + /// USB descriptors + /// USB vendor ID + /// USB product ID + /// USB manufacturer string + /// USB product string + /// USB serial number string + /// true if the device is attached via USB, false otherwise public bool GetUsbData(out byte[] descriptors, out ushort idVendor, out ushort idProduct, out string manufacturer, out string product, out string serial) { @@ -1235,6 +1373,15 @@ namespace Aaru.Devices.Remote return true; } + /// + /// Gets the FireWire data from the remote device + /// + /// FireWire vendor ID + /// FireWire product ID + /// FireWire vendor string + /// FireWire model string + /// FireWire GUID + /// true if the device is attached via FireWire, false otherwise public bool GetFireWireData(out uint idVendor, out uint idProduct, out ulong guid, out string vendor, out string model) { @@ -1321,6 +1468,11 @@ namespace Aaru.Devices.Remote return true; } + /// + /// Gets the PCMCIA/CardBus data from the remote device + /// + /// Card Information Structure + /// true if the device is attached via PCMCIA or CardBus, false otherwise public bool GetPcmciaData(out byte[] cis) { cis = null; @@ -1397,6 +1549,14 @@ namespace Aaru.Devices.Remote return true; } + /// + /// Receives data from a socket into a buffer + /// + /// Socket + /// Data buffer + /// Expected total size in bytes + /// Socket flags + /// Retrieved number of bytes static int Receive(Socket socket, byte[] buffer, int size, SocketFlags socketFlags) { int offset = 0; @@ -1415,6 +1575,9 @@ namespace Aaru.Devices.Remote return offset; } + /// + /// Closes the remote device, without closing the network connection + /// public void Close() { var cmdPkt = new AaruPacketCmdClose @@ -1441,6 +1604,14 @@ namespace Aaru.Devices.Remote } } + /// + /// Concatenates a queue of commands to be send to a remote SecureDigital or MultiMediaCard attached to an SDHCI controller + /// + /// List of commands + /// Duration to execute all commands, in milliseconds + /// Set to true if any of the commands returned an error status, false otherwise + /// Maximum allowed time to execute a single command + /// 0 if no error occurred, otherwise, errno public int SendMultipleMmcCommands(Device.MmcSingleCommand[] commands, out double duration, out bool sense, uint timeout = 0) { @@ -1599,6 +1770,14 @@ namespace Aaru.Devices.Remote return error; } + /// + /// Concatenates a queue of commands to be send to a remote SecureDigital or MultiMediaCard attached to an SDHCI controller, using protocol version 1 without specific support for such a queueing + /// + /// List of commands + /// Duration to execute all commands, in milliseconds + /// Set to true if any of the commands returned an error status, false otherwise + /// Maximum allowed time to execute a single command + /// 0 if no error occurred, otherwise, errno int SendMultipleMmcCommandsV1(Device.MmcSingleCommand[] commands, out double duration, out bool sense, uint timeout) { @@ -1621,6 +1800,10 @@ namespace Aaru.Devices.Remote return error; } + /// + /// Closes then immediately reopens a remote device + /// + /// Returned error number if any public bool ReOpen() { if(ServerProtocolVersion < 2) @@ -1713,6 +1896,14 @@ namespace Aaru.Devices.Remote return false; } + /// + /// Reads data using operating system buffers. + /// + /// Data buffer + /// Offset in remote device to start reading, in bytes + /// Number of bytes to read + /// Total time in milliseconds the reading took + /// true if there was an error, false otherwise public bool BufferedOsRead(out byte[] buffer, long offset, uint length, out double duration) { duration = 0; diff --git a/Aaru.Devices/Remote/Structs.cs b/Aaru.Devices/Remote/Structs.cs index 65f084144..1199d4bf0 100644 --- a/Aaru.Devices/Remote/Structs.cs +++ b/Aaru.Devices/Remote/Structs.cs @@ -33,385 +33,839 @@ using System.Runtime.InteropServices; using Aaru.CommonTypes.Enums; using Aaru.Decoders.ATA; +// ReSharper disable MemberCanBeInternal +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable FieldCanBeMadeReadOnly.Global +// ReSharper disable IdentifierTypo namespace Aaru.Devices.Remote { + /// + /// Header for any Aaru remote packet + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketHeader { + /// + /// Unique Aaru packet identifier (primary) + /// public uint remote_id; + /// + /// Unique Aaru packet identifier (secondary) + /// public uint packet_id; - + /// + /// Packet length + /// public uint len; + /// + /// Packet version + /// public byte version; + /// + /// Unique Aaru packet type identifier + /// public AaruPacketType packetType; - + /// + /// Spare for expansion (or alignment) + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public readonly byte[] spare; } + /// + /// Hello packet, identifies a remote initiator with a responder + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketHello { + /// Packet header public AaruPacketHeader hdr; - +/// +/// Application name +/// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string application; - +/// +/// Application version +/// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string version; - +/// +/// Maximum supported protocol version +/// public byte maxProtocol; - +/// +/// Spare for expansion (or alignment) +/// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] spare; - +/// +/// Operating system name +/// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string sysname; - +/// +/// Operating system version / release +/// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string release; - +/// +/// Operating system machine / architecture +/// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string machine; } + /// + /// Request a list of device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCommandListDevices { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns the requested list of devices + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public readonly struct AaruPacketResponseListDevices { + /// Packet header public readonly AaruPacketHeader hdr; + /// + /// How many device descriptors follows this structure in the packet + /// public readonly ushort devices; } + /// + /// Sends a request or returns a response that requires no intervention or further processing + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketNop { + /// Packet header public AaruPacketHeader hdr; + /// + /// Reason code + /// public AaruNopReason reasonCode; - + /// + /// Spare for expansion (or alignment) + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] spare; - +/// +/// Reason name +/// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string reason; - +/// +/// Operating system error number +/// public int errno; } + /// + /// Requests to open a device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCommandOpenDevice { + /// Packet header public AaruPacketHeader hdr; - + /// + /// Device path + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string device_path; } + /// + /// Requests remote to send a command to a SCSI device. This header is followed by the CDB and after it comes the buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdScsi { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the CDB that follows this structure + /// public uint cdb_len; + /// + /// Length in bytes of the buffer that follows the CDB + /// public uint buf_len; + /// + /// Direction of SCSI data transfer + /// public int direction; + /// + /// Timeout waiting for device to respond to command + /// public uint timeout; } + /// + /// Returns the response from a command sent to a SCSI device. This structure is followed by the buffer containing the REQUEST SENSE response and this is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResScsi { + /// Packet header public AaruPacketHeader hdr; + /// + /// Size the REQUEST SENSE buffer that follows this structure + /// public uint sense_len; + /// + /// Length in bytes of the data buffer that follows the sense buffer + /// public uint buf_len; + /// + /// Time in milliseconds it took for the device to execute the command + /// public uint duration; + /// + /// Set to anything different of zero if there was a SENSE returned + /// public uint sense; + /// + /// Set to the remote operating system error number + /// public uint error_no; } + /// + /// Requests remote to send a command to an ATA device using the CHS command set. This header is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdAtaChs { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Registers to set in the ATA device + /// public AtaRegistersChs registers; + /// + /// ATA protocol code + /// public byte protocol; + /// + /// ATA transfer register indicator + /// public byte transferRegister; + /// + /// Set to true to transfer blocks, false to transfer bytes + /// [MarshalAs(UnmanagedType.U1)] public bool transferBlocks; + /// + /// Spare for expansion (or alignment) + /// public byte spare; + /// + /// Timeout waiting for device to respond to command + /// public uint timeout; } + /// + /// Returns the response from a command sent to an ATA device using the CHS command set. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResAtaChs { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Registers as set back by the ATA device + /// public AtaErrorRegistersChs registers; + /// + /// Time in milliseconds it took for the device to execute the command + /// public uint duration; + /// + /// Set to anything different of zero if the device set an error condition + /// public uint sense; + /// + /// Set to the remote operating system error number + /// public uint error_no; } + /// + /// Requests remote to send a command to an ATA device using the 28-bit command set. This header is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdAtaLba28 { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Registers to set in the ATA device + /// public AtaRegistersLba28 registers; + /// + /// ATA protocol code + /// public byte protocol; + /// + /// ATA transfer register indicator + /// public byte transferRegister; + /// + /// Set to true to transfer blocks, false to transfer bytes + /// [MarshalAs(UnmanagedType.U1)] public bool transferBlocks; + /// + /// Spare for expansion (or alignment) + /// public byte spare; + /// + /// Timeout waiting for device to respond to command + /// public uint timeout; } + /// + /// Returns the response from a command sent to an ATA device using the 28-bit LBA command set. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResAtaLba28 { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Registers as set back by the ATA device + /// public AtaErrorRegistersLba28 registers; + /// + /// Time in milliseconds it took for the device to execute the command + /// public uint duration; + /// + /// Set to anything different of zero if the device set an error condition + /// public uint sense; + /// + /// Set to the remote operating system error number + /// public uint error_no; } + /// + /// Requests remote to send a command to an ATA device using the 48-bit command set. This header is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdAtaLba48 { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Registers to set in the ATA device + /// public AtaRegistersLba48 registers; + /// + /// ATA protocol code + /// public byte protocol; + /// + /// ATA transfer register indicator + /// public byte transferRegister; + /// + /// Set to true to transfer blocks, false to transfer bytes + /// [MarshalAs(UnmanagedType.U1)] public bool transferBlocks; + /// + /// Spare for expansion (or alignment) + /// public byte spare; + /// + /// Timeout waiting for device to respond to command + /// public uint timeout; } + /// + /// Returns the response from a command sent to an ATA device using the 48-bit LBA command set. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResAtaLba48 { + /// Packet header public AaruPacketHeader hdr; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Registers as set back by the ATA device + /// public AtaErrorRegistersLba48 registers; + /// + /// Time in milliseconds it took for the device to execute the command + /// public uint duration; + /// + /// Set to anything different of zero if the device set an error condition + /// public uint sense; + /// + /// Set to the remote operating system error number + /// public uint error_no; } + /// + /// SecureDigital or MultiMediaCard command description + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruCmdSdhci { + /// + /// Command + /// public MmcCommands command; + /// + /// Set to true if the command writes to the device, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool write; + /// + /// Set to true if it is an application command, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool application; + /// + /// Flags + /// public MmcFlags flags; + /// + /// Argument + /// public uint argument; + /// + /// Block size + /// public uint block_size; + /// + /// Number of blocks to transfer + /// public uint blocks; + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Timeout waiting for device to respond to command + /// public uint timeout; } + /// + /// Requests remote to send a command to a SecureDigital or MultiMediaCard device attached using a SDHCI controller. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdSdhci { + /// Packet header public AaruPacketHeader hdr; + /// + /// SecureDigital or MultiMediaCard command description + /// public AaruCmdSdhci command; } + /// + /// Returns the response from a command sent to a SecureDigital or MultiMediaCard device attached to a SDHCI controller. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruResSdhci { + /// + /// Length in bytes of the data buffer + /// public uint buf_len; + /// + /// Response registers + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] response; + /// + /// Time in milliseconds it took for the device to execute the command + /// public uint duration; + /// + /// Set to anything different of zero if the device set an error condition + /// public uint sense; + /// + /// Set to the remote operating system error number + /// public uint error_no; } + /// + /// Returns the response from a command sent to a SecureDigital or MultiMediaCard device attached to a SDHCI controller. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResSdhci { + /// Packet header public AaruPacketHeader hdr; + /// + /// Response + /// public AaruResSdhci res; } + /// + /// Requests the Aaru device type for the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdGetDeviceType { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns the Aaru device type for the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResGetDeviceType { + /// Packet header public AaruPacketHeader hdr; + /// + /// Aaru's device type + /// public DeviceType device_type; } + /// + /// Requests the registers of a SecureDigital or MultiMediaCard attached to an SDHCI controller + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdGetSdhciRegisters { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns the registers of a SecureDigital or MultiMediaCard attached to an SDHCI controller + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResGetSdhciRegisters { + /// Packet header public AaruPacketHeader hdr; + /// + /// true if the device is attached to an SDHCI controller and the rest of the fields on this packet are valid, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool isSdhci; - + /// + /// CSD registers + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] csd; - + /// + /// CID registers + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] cid; - + /// + /// OCR registers + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] ocr; - + /// + /// SCR registers + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] scr; - + /// + /// Length of the CSD registers + /// public uint csd_len; + /// + /// Length of the CID registers + /// public uint cid_len; + /// + /// Length of the OCR registers + /// public uint ocr_len; + /// + /// Length of the SCR registers + /// public uint scr_len; } + /// + /// Requests information about the USB connection of the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdGetUsbData { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns information about the USB connection of the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResGetUsbData { + /// Packet header public AaruPacketHeader hdr; + /// + /// true if the device is attached using USB and the rest of the fields on this packet are valid, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool isUsb; + /// + /// Length of the descriptors + /// public ushort descLen; - + /// + /// Raw USB descriptors + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 65536)] public byte[] descriptors; - + /// + /// USB vendor ID + /// public ushort idVendor; + /// + /// USB product ID + /// public ushort idProduct; - + /// + /// USB manufacturer string + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string manufacturer; - + /// + /// USB product string + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string product; - + /// + /// USB serial number string + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string serial; } + /// + /// Requests information about the FireWire connection of the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdGetFireWireData { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns information about the FireWire connection of the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResGetFireWireData { + /// Packet header public AaruPacketHeader hdr; + /// + /// true if the device is attached using FireWire and the rest of the fields on this packet are valid, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool isFireWire; + /// + /// FireWire model ID + /// public uint idModel; + /// + /// FireWire vendor ID + /// public uint idVendor; + /// + /// FireWire's device GUID + /// public ulong guid; - + /// + /// FireWire vendor string + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string vendor; - + /// + /// FireWire model string + /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string model; } + /// + /// Requests information about the PCMCIA or CardBus connection of the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdGetPcmciaData { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns information about the PCMCIA or CardBus connection of the opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResGetPcmciaData { + /// Packet header public AaruPacketHeader hdr; + /// + /// true if the device is a PCMCIA or CardBus device and the rest of the fields on this packet are valid, false otherwise + /// [MarshalAs(UnmanagedType.U1)] public bool isPcmcia; + /// + /// CIS buffer length + /// public ushort cis_len; - + /// + /// CIS buffer + /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 65536)] public byte[] cis; } + /// + /// Requests to close the currently opened device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdClose { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Requests to know if the remote is running with administrative (aka root) privileges + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdAmIRoot { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Returns if the remote is running with administrative (aka root) privileges + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResAmIRoot { + /// Packet header public AaruPacketHeader hdr; + /// + /// Set to any value different of 0 to indicate the remote is running with administrative (aka root) privileges + /// public uint am_i_root; } + /// + /// Initiates a multiple command block with the SDHCI controller the SecureDigital or MultiMediaCard is attached + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketMultiCmdSdhci { + /// Packet header public AaruPacketHeader hdr; + /// + /// How many commands to queue + /// public ulong cmd_count; } + /// + /// Closes and then re-opens the same device + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdReOpen { + /// Packet header public AaruPacketHeader hdr; } + /// + /// Reads data using operating system buffers + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketCmdOsRead { + /// Packet header public AaruPacketHeader hdr; + /// + /// Device offset where to read + /// public ulong offset; + /// + /// Number of bytes to read + /// public uint length; } + /// + /// Returns data read using operating system buffers. This structure is followed by the data buffer. + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct AaruPacketResOsRead { + /// Packet header public AaruPacketHeader hdr; + /// + /// Set to the remote operating system error number + /// public int errno; + /// + /// Time in milliseconds it took for the device to execute the command + /// public uint duration; } } \ No newline at end of file diff --git a/Aaru.Dto b/Aaru.Dto index 3b6c6aca7..033842d8a 160000 --- a/Aaru.Dto +++ b/Aaru.Dto @@ -1 +1 @@ -Subproject commit 3b6c6aca706b391ea6efa15da2afc0a5059dc890 +Subproject commit 033842d8a1d7da92d780553328cb2f21d525422e diff --git a/Aaru.Filesystems/AODOS.cs b/Aaru.Filesystems/AODOS.cs index cd24b7771..dab05ecb6 100644 --- a/Aaru.Filesystems/AODOS.cs +++ b/Aaru.Filesystems/AODOS.cs @@ -44,18 +44,27 @@ namespace Aaru.Filesystems { // Information has been extracted looking at available disk images // This may be missing fields, or not, I don't know russian so any help is appreciated + /// + /// Implements detection of the AO-DOS filesystem + /// public sealed class AODOS : IFilesystem { readonly byte[] _identifier = { 0x20, 0x41, 0x4F, 0x2D, 0x44, 0x4F, 0x53, 0x20 }; + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "Alexander Osipov DOS file system"; + /// public Guid Id => new Guid("668E5039-9DDD-442A-BE1B-A315D6E38E26"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { // Does AO-DOS support hard disks? @@ -77,6 +86,7 @@ namespace Aaru.Filesystems return bb.identifier.SequenceEqual(_identifier); } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/APFS.cs b/Aaru.Filesystems/APFS.cs index e41e3e2a9..06d906e3a 100644 --- a/Aaru.Filesystems/APFS.cs +++ b/Aaru.Filesystems/APFS.cs @@ -41,18 +41,27 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Apple File System (APFS) + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class APFS : IFilesystem { const uint APFS_CONTAINER_MAGIC = 0x4253584E; // "NXSB" const uint APFS_VOLUME_MAGIC = 0x42535041; // "APSB" + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Apple File System"; + /// public Guid Id => new Guid("A4060F9D-2909-42E2-9D95-DB31FA7EA797"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -73,6 +82,7 @@ namespace Aaru.Filesystems return nxSb.magic == APFS_CONTAINER_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Acorn.cs b/Aaru.Filesystems/Acorn.cs index 1616a3457..0c466d197 100644 --- a/Aaru.Filesystems/Acorn.cs +++ b/Aaru.Filesystems/Acorn.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of Acorn's Advanced Data Filing System (ADFS) + /// public sealed class AcornADFS : IFilesystem { /// Location for boot block, in bytes @@ -63,13 +66,19 @@ namespace Aaru.Filesystems /// Old directory format magic number, "Hugo" const uint OLD_DIR_MAGIC = 0x6F677548; + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "Acorn Advanced Disc Filing System"; + /// public Guid Id => new Guid("BAFC1E50-9C64-4CD3-8400-80628CC27AFA"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; // TODO: BBC Master hard disks are untested... + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -261,6 +270,7 @@ namespace Aaru.Filesystems // TODO: Find root directory on volumes with DiscRecord // TODO: Support big directories (ADFS-G?) // TODO: Find the real freemap on volumes with DiscRecord, as DiscRecord's discid may be empty but this one isn't + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/AmigaDOS.cs b/Aaru.Filesystems/AmigaDOS.cs index 6a4c12383..d0e8f53a0 100644 --- a/Aaru.Filesystems/AmigaDOS.cs +++ b/Aaru.Filesystems/AmigaDOS.cs @@ -44,6 +44,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of Amiga Fast File System (AFFS) + /// public sealed class AmigaDOSPlugin : IFilesystem { const uint FFS_MASK = 0x444F5300; @@ -52,12 +55,18 @@ namespace Aaru.Filesystems const uint TYPE_HEADER = 2; const uint SUBTYPE_ROOT = 1; + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "Amiga DOS filesystem"; + /// public Guid Id => new Guid("3c882400-208c-427d-a086-9119852a1bc7"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start + 4 >= partition.End) @@ -164,6 +173,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/AppleDOS/AppleDOS.cs b/Aaru.Filesystems/AppleDOS/AppleDOS.cs index c0135e381..fb64ab081 100644 --- a/Aaru.Filesystems/AppleDOS/AppleDOS.cs +++ b/Aaru.Filesystems/AppleDOS/AppleDOS.cs @@ -38,6 +38,9 @@ using Schemas; namespace Aaru.Filesystems { + /// + /// Implements the Apple DOS 3 filesystem + /// public sealed partial class AppleDOS : IReadOnlyFilesystem { bool _debug; @@ -51,16 +54,23 @@ namespace Aaru.Filesystems uint _usedSectors; Vtoc _vtoc; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Apple DOS File System"; + /// public Guid Id => new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n"); + /// public string Author => "Natalia Portillo"; + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => null; static Dictionary GetDefaultOptions() => new Dictionary diff --git a/Aaru.Filesystems/AppleDOS/Dir.cs b/Aaru.Filesystems/AppleDOS/Dir.cs index 44a217356..32cd462bb 100644 --- a/Aaru.Filesystems/AppleDOS/Dir.cs +++ b/Aaru.Filesystems/AppleDOS/Dir.cs @@ -42,9 +42,6 @@ namespace Aaru.Filesystems public sealed partial class AppleDOS { /// - /// Solves a symbolic link. - /// Link path. - /// Link destination. public Errno ReadLink(string path, out string dest) { dest = null; @@ -53,9 +50,6 @@ namespace Aaru.Filesystems } /// - /// Lists contents from a directory. - /// Directory path. - /// Directory contents. public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/AppleDOS/File.cs b/Aaru.Filesystems/AppleDOS/File.cs index c84b6e3b2..3918c79f1 100644 --- a/Aaru.Filesystems/AppleDOS/File.cs +++ b/Aaru.Filesystems/AppleDOS/File.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems { public sealed partial class AppleDOS { + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -76,6 +77,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(!_mounted) @@ -131,6 +133,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; @@ -185,6 +188,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; diff --git a/Aaru.Filesystems/AppleDOS/Info.cs b/Aaru.Filesystems/AppleDOS/Info.cs index 383e1cdf1..e98cf67ed 100644 --- a/Aaru.Filesystems/AppleDOS/Info.cs +++ b/Aaru.Filesystems/AppleDOS/Info.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems { public sealed partial class AppleDOS { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.Sectors != 455 && @@ -61,6 +62,7 @@ namespace Aaru.Filesystems _vtoc.sectorsPerTrack == spt && _vtoc.bytesPerSector == 256; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/AppleDOS/Super.cs b/Aaru.Filesystems/AppleDOS/Super.cs index aa9cf7b2b..3a8fe5cde 100644 --- a/Aaru.Filesystems/AppleDOS/Super.cs +++ b/Aaru.Filesystems/AppleDOS/Super.cs @@ -45,7 +45,6 @@ namespace Aaru.Filesystems public sealed partial class AppleDOS { /// - /// Mounts an Apple DOS filesystem public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -128,7 +127,6 @@ namespace Aaru.Filesystems } /// - /// Unmounts this DOS filesystem public Errno Unmount() { _mounted = false; @@ -141,8 +139,6 @@ namespace Aaru.Filesystems } /// - /// Gets information about the mounted volume. - /// Information about the mounted volume. public Errno StatFs(out FileSystemInfo stat) { stat = new FileSystemInfo diff --git a/Aaru.Filesystems/AppleDOS/Xattr.cs b/Aaru.Filesystems/AppleDOS/Xattr.cs index 5f4bbddcf..be6f26f6b 100644 --- a/Aaru.Filesystems/AppleDOS/Xattr.cs +++ b/Aaru.Filesystems/AppleDOS/Xattr.cs @@ -39,10 +39,6 @@ namespace Aaru.Filesystems public sealed partial class AppleDOS { /// - /// Lists all extended attributes, alternate data streams and forks of the given file. - /// Error number. - /// Path. - /// List of extended attributes, alternate data streams and forks. public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -83,11 +79,6 @@ namespace Aaru.Filesystems } /// - /// Reads an extended attribute, alternate data stream or fork from the given file. - /// Error number. - /// File path. - /// Extended attribute, alternate data stream or fork name. - /// Buffer. public Errno GetXattr(string path, string xattr, ref byte[] buf) { if(!_mounted) diff --git a/Aaru.Filesystems/AppleHFS/AppleHFS.cs b/Aaru.Filesystems/AppleHFS/AppleHFS.cs index 047358530..b52b5671d 100644 --- a/Aaru.Filesystems/AppleHFS/AppleHFS.cs +++ b/Aaru.Filesystems/AppleHFS/AppleHFS.cs @@ -40,12 +40,20 @@ namespace Aaru.Filesystems { // Information from Inside Macintosh // https://developer.apple.com/legacy/library/documentation/mac/pdf/Files/File_Manager.pdf + /// + /// Implements detection of the Apple Hierarchical File System (HFS) + /// public sealed partial class AppleHFS : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Apple Hierarchical File System"; + /// public Guid Id => new Guid("36405F8D-0D26-6ECC-0BBB-1D5225FF404F"); + /// public string Author => "Natalia Portillo"; } } \ No newline at end of file diff --git a/Aaru.Filesystems/AppleHFS/Info.cs b/Aaru.Filesystems/AppleHFS/Info.cs index b66f3e987..b98f03ee6 100644 --- a/Aaru.Filesystems/AppleHFS/Info.cs +++ b/Aaru.Filesystems/AppleHFS/Info.cs @@ -43,6 +43,7 @@ namespace Aaru.Filesystems // https://developer.apple.com/legacy/library/documentation/mac/pdf/Files/File_Manager.pdf public sealed partial class AppleHFS { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -96,6 +97,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/AppleHFSPlus.cs b/Aaru.Filesystems/AppleHFSPlus.cs index dae04601a..da5ba135b 100644 --- a/Aaru.Filesystems/AppleHFSPlus.cs +++ b/Aaru.Filesystems/AppleHFSPlus.cs @@ -42,14 +42,23 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from Apple TechNote 1150: https://developer.apple.com/legacy/library/technotes/tn/tn1150.html + /// + /// Implements detection of Apple Hierarchical File System Plus (HFS+) + /// public sealed class AppleHFSPlus : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Apple HFS+ filesystem"; + /// public Guid Id => new Guid("36405F8D-0D26-6EBE-436F-62F0586B4F08"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -96,6 +105,7 @@ namespace Aaru.Filesystems return drSigWord == AppleCommon.HFSP_MAGIC || drSigWord == AppleCommon.HFSX_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/AppleMFS/AppleMFS.cs b/Aaru.Filesystems/AppleMFS/AppleMFS.cs index 0bf85715d..86280143a 100644 --- a/Aaru.Filesystems/AppleMFS/AppleMFS.cs +++ b/Aaru.Filesystems/AppleMFS/AppleMFS.cs @@ -39,6 +39,9 @@ using Schemas; namespace Aaru.Filesystems { // Information from Inside Macintosh Volume II + /// + /// Implements the Apple Macintosh File System + /// public sealed partial class AppleMFS : IReadOnlyFilesystem { bool _mounted; @@ -60,17 +63,24 @@ namespace Aaru.Filesystems byte[] _directoryTags; byte[] _bitmapTags; + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "Apple Macintosh File System"; + /// public Guid Id => new Guid("36405F8D-0D26-4066-6538-5DBF5D065C3A"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; // TODO: Implement Finder namespace (requires decoding Desktop database) + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => null; static Dictionary GetDefaultOptions() => new Dictionary diff --git a/Aaru.Filesystems/AppleMFS/Dir.cs b/Aaru.Filesystems/AppleMFS/Dir.cs index 1b45f1077..15b1aa509 100644 --- a/Aaru.Filesystems/AppleMFS/Dir.cs +++ b/Aaru.Filesystems/AppleMFS/Dir.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems // Information from Inside Macintosh Volume II public sealed partial class AppleMFS { + /// public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/AppleMFS/File.cs b/Aaru.Filesystems/AppleMFS/File.cs index 1126006fb..f989c78b4 100644 --- a/Aaru.Filesystems/AppleMFS/File.cs +++ b/Aaru.Filesystems/AppleMFS/File.cs @@ -43,6 +43,7 @@ namespace Aaru.Filesystems // Information from Inside Macintosh Volume II public sealed partial class AppleMFS { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = new long(); @@ -92,6 +93,7 @@ namespace Aaru.Filesystems return Errno.InOutError; } + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -155,6 +157,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(!_mounted) @@ -199,6 +202,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; @@ -287,6 +291,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno ReadLink(string path, out string dest) { dest = null; diff --git a/Aaru.Filesystems/AppleMFS/Info.cs b/Aaru.Filesystems/AppleMFS/Info.cs index 9e0031d81..7982da97f 100644 --- a/Aaru.Filesystems/AppleMFS/Info.cs +++ b/Aaru.Filesystems/AppleMFS/Info.cs @@ -44,6 +44,7 @@ namespace Aaru.Filesystems // Information from Inside Macintosh Volume II public sealed partial class AppleMFS { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -56,6 +57,7 @@ namespace Aaru.Filesystems return drSigWord == MFS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/AppleMFS/Super.cs b/Aaru.Filesystems/AppleMFS/Super.cs index 28291b067..c970936c9 100644 --- a/Aaru.Filesystems/AppleMFS/Super.cs +++ b/Aaru.Filesystems/AppleMFS/Super.cs @@ -47,6 +47,7 @@ namespace Aaru.Filesystems { const int BYTES_BEFORE_BLOCK_MAP = 64; + /// public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -194,6 +195,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Unmount() { _mounted = false; @@ -205,6 +207,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno StatFs(out FileSystemInfo stat) { stat = new FileSystemInfo diff --git a/Aaru.Filesystems/AppleMFS/Xattr.cs b/Aaru.Filesystems/AppleMFS/Xattr.cs index 2a2ed9efe..35e7524e8 100644 --- a/Aaru.Filesystems/AppleMFS/Xattr.cs +++ b/Aaru.Filesystems/AppleMFS/Xattr.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems // Information from Inside Macintosh Volume II public sealed partial class AppleMFS { + /// public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -99,6 +100,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno GetXattr(string path, string xattr, ref byte[] buf) { if(!_mounted) diff --git a/Aaru.Filesystems/AtheOS.cs b/Aaru.Filesystems/AtheOS.cs index 1d7dfceec..942c82b17 100644 --- a/Aaru.Filesystems/AtheOS.cs +++ b/Aaru.Filesystems/AtheOS.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection for the AtheOS filesystem + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class AtheOS : IFilesystem { @@ -54,12 +57,18 @@ namespace Aaru.Filesystems const uint AFS_SUPERBLOCK_SIZE = 1024; const uint AFS_BOOTBLOCK_SIZE = AFS_SUPERBLOCK_SIZE; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "AtheOS Filesystem"; + /// public Guid Id => new Guid("AAB2C4F1-DC07-49EE-A948-576CC51B58C5"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { ulong sector = AFS_BOOTBLOCK_SIZE / imagePlugin.Info.SectorSize; @@ -85,6 +94,7 @@ namespace Aaru.Filesystems return magic == AFS_MAGIC1; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/BFS.cs b/Aaru.Filesystems/BFS.cs index 8e83a5f73..670086b69 100644 --- a/Aaru.Filesystems/BFS.cs +++ b/Aaru.Filesystems/BFS.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from Practical Filesystem Design, ISBN 1-55860-497-9 + /// + /// Implements detection of the Be (new) filesystem + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class BeFS : IFilesystem { @@ -60,12 +63,18 @@ namespace Aaru.Filesystems const uint BEFS_CLEAN = 0x434C454E; const uint BEFS_DIRTY = 0x44495254; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Be Filesystem"; + /// public Guid Id => new Guid("dc8572b3-b6ad-46e4-8de9-cbe123ff6672"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -98,6 +107,7 @@ namespace Aaru.Filesystems return magic == BEFS_MAGIC1 || magicBe == BEFS_MAGIC1; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/BTRFS.cs b/Aaru.Filesystems/BTRFS.cs index a7c86d751..65dc162ad 100644 --- a/Aaru.Filesystems/BTRFS.cs +++ b/Aaru.Filesystems/BTRFS.cs @@ -41,17 +41,26 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the b-tree filesystem (btrfs) + /// public sealed class BTRFS : IFilesystem { /// BTRFS magic "_BHRfS_M" const ulong BTRFS_MAGIC = 0x4D5F53665248425F; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "B-tree file system"; + /// public Guid Id => new Guid("C904CF15-5222-446B-B7DB-02EAC5D781B3"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -83,6 +92,7 @@ namespace Aaru.Filesystems return btrfsSb.magic == BTRFS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/CBM.cs b/Aaru.Filesystems/CBM.cs index 769b85416..2abf2c342 100644 --- a/Aaru.Filesystems/CBM.cs +++ b/Aaru.Filesystems/CBM.cs @@ -43,14 +43,23 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the filesystem used in 8-bit Commodore microcomputers + /// public sealed class CBM : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "Commodore file system"; + /// public Guid Id => new Guid("D104744E-A376-450C-BAC0-1347C93F983B"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start > 0) @@ -92,6 +101,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/CPM/CPM.cs b/Aaru.Filesystems/CPM/CPM.cs index 094726bff..aca9b866d 100644 --- a/Aaru.Filesystems/CPM/CPM.cs +++ b/Aaru.Filesystems/CPM/CPM.cs @@ -39,6 +39,9 @@ using Schemas; namespace Aaru.Filesystems { + /// + /// Implements the CP/M filesystem + /// public sealed partial class CPM : IReadOnlyFilesystem { /// True if thinks this is a CP/M filesystem @@ -80,16 +83,23 @@ namespace Aaru.Filesystems /// If thinks this is a CP/M filesystem, this is the definition for it CpmDefinition _workingDefinition; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "CP/M File System"; + /// public Guid Id => new Guid("AA2B8585-41DF-4E3B-8A35-D1A935E2F8A1"); + /// public string Author => "Natalia Portillo"; + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => null; static Dictionary GetDefaultOptions() => new Dictionary diff --git a/Aaru.Filesystems/CPM/Dir.cs b/Aaru.Filesystems/CPM/Dir.cs index b13b85e44..2cca2bcf1 100644 --- a/Aaru.Filesystems/CPM/Dir.cs +++ b/Aaru.Filesystems/CPM/Dir.cs @@ -40,6 +40,7 @@ namespace Aaru.Filesystems { public sealed partial class CPM { + /// public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/CPM/File.cs b/Aaru.Filesystems/CPM/File.cs index cde616765..89983bb64 100644 --- a/Aaru.Filesystems/CPM/File.cs +++ b/Aaru.Filesystems/CPM/File.cs @@ -38,6 +38,7 @@ namespace Aaru.Filesystems { public sealed partial class CPM { + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -71,6 +72,7 @@ namespace Aaru.Filesystems } // TODO: Implementing this would require storing the interleaving + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; @@ -78,6 +80,7 @@ namespace Aaru.Filesystems return !_mounted ? Errno.AccessDenied : Errno.NotImplemented; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(!_mounted) @@ -116,6 +119,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno ReadLink(string path, out string dest) { dest = null; @@ -123,6 +127,7 @@ namespace Aaru.Filesystems return !_mounted ? Errno.AccessDenied : Errno.NotSupported; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; diff --git a/Aaru.Filesystems/CPM/Info.cs b/Aaru.Filesystems/CPM/Info.cs index c64856f62..db3ec921f 100644 --- a/Aaru.Filesystems/CPM/Info.cs +++ b/Aaru.Filesystems/CPM/Info.cs @@ -44,6 +44,7 @@ namespace Aaru.Filesystems { public sealed partial class CPM { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { // This will only continue on devices with a chance to have ever been used by CP/M while failing on all others @@ -1125,6 +1126,7 @@ namespace Aaru.Filesystems } } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/CPM/Super.cs b/Aaru.Filesystems/CPM/Super.cs index fd723615a..2fff62ef9 100644 --- a/Aaru.Filesystems/CPM/Super.cs +++ b/Aaru.Filesystems/CPM/Super.cs @@ -50,6 +50,7 @@ namespace Aaru.Filesystems { public sealed partial class CPM { + /// public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -806,8 +807,6 @@ namespace Aaru.Filesystems } /// - /// Gets information about the mounted volume. - /// Information about the mounted volume. public Errno StatFs(out FileSystemInfo stat) { stat = null; @@ -820,6 +819,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Unmount() { _mounted = false; diff --git a/Aaru.Filesystems/CPM/Xattr.cs b/Aaru.Filesystems/CPM/Xattr.cs index 8468d405b..feddb0e28 100644 --- a/Aaru.Filesystems/CPM/Xattr.cs +++ b/Aaru.Filesystems/CPM/Xattr.cs @@ -39,11 +39,6 @@ namespace Aaru.Filesystems public sealed partial class CPM { /// - /// Reads an extended attribute, alternate data stream or fork from the given file. - /// Error number. - /// File path. - /// Extended attribute, alternate data stream or fork name. - /// Buffer. public Errno GetXattr(string path, string xattr, ref byte[] buf) { if(!_mounted) @@ -72,10 +67,6 @@ namespace Aaru.Filesystems } /// - /// Lists all extended attributes, alternate data streams and forks of the given file. - /// Error number. - /// Path. - /// List of extended attributes, alternate data streams and forks. public Errno ListXAttr(string path, out List xattrs) { xattrs = null; diff --git a/Aaru.Filesystems/Cram.cs b/Aaru.Filesystems/Cram.cs index 7e50cf3db..b1fc192cb 100644 --- a/Aaru.Filesystems/Cram.cs +++ b/Aaru.Filesystems/Cram.cs @@ -44,6 +44,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the CRAM filesystem + /// [SuppressMessage("ReSharper", "UnusedType.Local")] public sealed class Cram : IFilesystem { @@ -51,12 +54,18 @@ namespace Aaru.Filesystems const uint CRAM_MAGIC = 0x28CD3D45; const uint CRAM_CIGAM = 0x453DCD28; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Cram filesystem"; + /// public Guid Id => new Guid("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -69,6 +78,7 @@ namespace Aaru.Filesystems return magic == CRAM_MAGIC || magic == CRAM_CIGAM; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ECMA67.cs b/Aaru.Filesystems/ECMA67.cs index 03240813a..0f0530a0c 100644 --- a/Aaru.Filesystems/ECMA67.cs +++ b/Aaru.Filesystems/ECMA67.cs @@ -41,6 +41,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the filesystem described in ECMA-67 + /// public sealed class ECMA67 : IFilesystem { readonly byte[] _magic = @@ -48,12 +51,18 @@ namespace Aaru.Filesystems 0x56, 0x4F, 0x4C }; + /// public Encoding Encoding { get; private set; } + /// public string Name => "ECMA-67"; + /// public Guid Id => new Guid("62A2D44A-CBC1-4377-B4B6-28C5C92034A1"); + /// public FileSystemType XmlFsType { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start > 0) @@ -72,6 +81,7 @@ namespace Aaru.Filesystems return _magic.SequenceEqual(vol.labelIdentifier) && vol.labelNumber == 1 && vol.recordLength == 0x31; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/EFS.cs b/Aaru.Filesystems/EFS.cs index 8ab368a10..a7e9ae618 100644 --- a/Aaru.Filesystems/EFS.cs +++ b/Aaru.Filesystems/EFS.cs @@ -44,17 +44,26 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements identification for the SGI Extent FileSystem + /// public sealed class EFS : IFilesystem { const uint EFS_MAGIC = 0x00072959; const uint EFS_MAGIC_NEW = 0x0007295A; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Extent File System Plugin"; + /// public Guid Id => new Guid("52A43F90-9AF3-4391-ADFE-65598DEEABAB"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -111,6 +120,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/F2FS.cs b/Aaru.Filesystems/F2FS.cs index a38ba830a..e578e2459 100644 --- a/Aaru.Filesystems/F2FS.cs +++ b/Aaru.Filesystems/F2FS.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Flash-Friendly File System (F2FS) + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class F2FS : IFilesystem { @@ -51,12 +54,18 @@ namespace Aaru.Filesystems const uint F2FS_MAX_SECTOR = 4096; const uint F2FS_BLOCK_SIZE = 4096; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "F2FS Plugin"; + /// public Guid Id => new Guid("82B0920F-5F0D-4063-9F57-ADE0AE02ECE5"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < F2FS_MIN_SECTOR || @@ -86,6 +95,7 @@ namespace Aaru.Filesystems return sb.magic == F2FS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/FAT/FAT.cs b/Aaru.Filesystems/FAT/FAT.cs index 1761d62d5..b77da744b 100644 --- a/Aaru.Filesystems/FAT/FAT.cs +++ b/Aaru.Filesystems/FAT/FAT.cs @@ -42,6 +42,9 @@ namespace Aaru.Filesystems { // TODO: Differentiate between Atari and X68k FAT, as this one uses a standard BPB. // X68K uses cdate/adate from direntry for extending filename + /// + /// Implements the File Allocation Table, aka FAT, filesystem (FAT12, FAT16 and FAT32 variants). + /// public sealed partial class FAT : IReadOnlyFilesystem { uint _bytesPerCluster; @@ -65,17 +68,23 @@ namespace Aaru.Filesystems FileSystemInfo _statfs; bool _useFirstFat; + /// public FileSystemType XmlFsType { get; private set; } - + /// public Encoding Encoding { get; private set; } + /// public string Name => "Microsoft File Allocation Table"; + /// public Guid Id => new Guid("33513B2C-0D26-0D2D-32C3-79D8611158E0"); + /// public string Author => "Natalia Portillo"; + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => new Dictionary { { diff --git a/Aaru.Filesystems/FAT/File.cs b/Aaru.Filesystems/FAT/File.cs index c545ae83c..1401101ed 100644 --- a/Aaru.Filesystems/FAT/File.cs +++ b/Aaru.Filesystems/FAT/File.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems { public sealed partial class FAT { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; @@ -68,6 +69,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -85,6 +87,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(!_mounted) @@ -145,6 +148,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; diff --git a/Aaru.Filesystems/FAT/Info.cs b/Aaru.Filesystems/FAT/Info.cs index d98837d41..bfad4d4a2 100644 --- a/Aaru.Filesystems/FAT/Info.cs +++ b/Aaru.Filesystems/FAT/Info.cs @@ -49,6 +49,7 @@ namespace Aaru.Filesystems { public sealed partial class FAT { + /// [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] public bool Identify(IMediaImage imagePlugin, Partition partition) { @@ -406,6 +407,7 @@ namespace Aaru.Filesystems return fatId == fat2Sector[0]; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/FATX/Dir.cs b/Aaru.Filesystems/FATX/Dir.cs index 70c1e6e54..e38bae17c 100644 --- a/Aaru.Filesystems/FATX/Dir.cs +++ b/Aaru.Filesystems/FATX/Dir.cs @@ -40,6 +40,7 @@ namespace Aaru.Filesystems { public sealed partial class XboxFatPlugin { + /// public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/FATX/FATX.cs b/Aaru.Filesystems/FATX/FATX.cs index 6c62fe90b..376fccaab 100644 --- a/Aaru.Filesystems/FATX/FATX.cs +++ b/Aaru.Filesystems/FATX/FATX.cs @@ -40,6 +40,9 @@ using Schemas; namespace Aaru.Filesystems { + /// + /// Implements the Xbox File Allocation Table (FATX or XTAF) filesystem. + /// public sealed partial class XboxFatPlugin : IReadOnlyFilesystem { uint _bytesPerCluster; @@ -58,12 +61,18 @@ namespace Aaru.Filesystems FileSystemInfo _statfs; Superblock _superblock; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "FATX Filesystem Plugin"; + /// public Guid Id => new Guid("ED27A721-4A17-4649-89FD-33633B46E228"); + /// public string Author => "Natalia Portillo"; + /// public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -71,8 +80,10 @@ namespace Aaru.Filesystems return Errno.NotSupported; } + /// public Errno GetXattr(string path, string xattr, ref byte[] buf) => Errno.NotSupported; + /// public Errno ReadLink(string path, out string dest) { dest = null; @@ -80,10 +91,12 @@ namespace Aaru.Filesystems return Errno.NotSupported; } + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => null; static Dictionary GetDefaultOptions() => new Dictionary diff --git a/Aaru.Filesystems/FATX/File.cs b/Aaru.Filesystems/FATX/File.cs index 1a84bfac0..430f5c58a 100644 --- a/Aaru.Filesystems/FATX/File.cs +++ b/Aaru.Filesystems/FATX/File.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems { public sealed partial class XboxFatPlugin { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; @@ -68,6 +69,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -85,6 +87,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(!_mounted) @@ -136,6 +139,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; diff --git a/Aaru.Filesystems/FATX/Info.cs b/Aaru.Filesystems/FATX/Info.cs index b477107a7..d4c6d16bd 100644 --- a/Aaru.Filesystems/FATX/Info.cs +++ b/Aaru.Filesystems/FATX/Info.cs @@ -40,6 +40,7 @@ namespace Aaru.Filesystems { public sealed partial class XboxFatPlugin { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -52,6 +53,7 @@ namespace Aaru.Filesystems return sb.magic == FATX_MAGIC || sb.magic == FATX_CIGAM; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/FATX/Super.cs b/Aaru.Filesystems/FATX/Super.cs index 84fecefcc..aeaa5554e 100644 --- a/Aaru.Filesystems/FATX/Super.cs +++ b/Aaru.Filesystems/FATX/Super.cs @@ -47,6 +47,7 @@ namespace Aaru.Filesystems { public sealed partial class XboxFatPlugin { + /// public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -257,6 +258,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Unmount() { if(!_mounted) @@ -270,6 +272,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno StatFs(out FileSystemInfo stat) { stat = null; diff --git a/Aaru.Filesystems/FFS.cs b/Aaru.Filesystems/FFS.cs index f757ee13a..f8c1a08fb 100644 --- a/Aaru.Filesystems/FFS.cs +++ b/Aaru.Filesystems/FFS.cs @@ -47,6 +47,9 @@ using ufs_daddr_t = System.Int32; namespace Aaru.Filesystems { // Using information from Linux kernel headers + /// + /// Implements detection of BSD Fast File System (FFS, aka UNIX File System) + /// [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed class FFSPlugin : IFilesystem { @@ -93,12 +96,18 @@ namespace Aaru.Filesystems // Big-endian incomplete newfs const uint UFS_BAD_CIGAM = 0x08049619; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "BSD Fast File System (aka UNIX File System, UFS)"; + /// public Guid Id => new Guid("CC90D342-05DB-48A8-988C-C1FE000034A3"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -135,6 +144,7 @@ namespace Aaru.Filesystems } } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Fossil.cs b/Aaru.Filesystems/Fossil.cs index c58e024de..53348f2c3 100644 --- a/Aaru.Filesystems/Fossil.cs +++ b/Aaru.Filesystems/Fossil.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection for the Plan-9 Fossil on-disk filesystem + /// public sealed class Fossil : IFilesystem { const uint FOSSIL_HDR_MAGIC = 0x3776AE89; @@ -50,12 +53,18 @@ namespace Aaru.Filesystems // Fossil header starts at 128KiB const ulong HEADER_POS = 128 * 1024; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Fossil Filesystem Plugin"; + /// public Guid Id => new Guid("932BF104-43F6-494F-973C-45EF58A51DA9"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { ulong hdrSector = HEADER_POS / imagePlugin.Info.SectorSize; @@ -72,6 +81,7 @@ namespace Aaru.Filesystems return hdr.magic == FOSSIL_HDR_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/HAMMER.cs b/Aaru.Filesystems/HAMMER.cs index 01e8aef08..c307e44a0 100644 --- a/Aaru.Filesystems/HAMMER.cs +++ b/Aaru.Filesystems/HAMMER.cs @@ -47,6 +47,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection for the HAMMER filesystem + /// public sealed class HAMMER : IFilesystem { const ulong HAMMER_FSBUF_VOLUME = 0xC8414D4DC5523031; @@ -54,12 +57,18 @@ namespace Aaru.Filesystems const uint HAMMER_VOLHDR_SIZE = 1928; const int HAMMER_BIGBLOCK_SIZE = 8192 * 1024; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "HAMMER Filesystem"; + /// public Guid Id => new Guid("91A188BF-5FD7-4677-BBD3-F59EBA9C864D"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { uint run = HAMMER_VOLHDR_SIZE / imagePlugin.Info.SectorSize; @@ -77,6 +86,7 @@ namespace Aaru.Filesystems return magic == HAMMER_FSBUF_VOLUME || magic == HAMMER_FSBUF_VOLUME_REV; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/HPFS.cs b/Aaru.Filesystems/HPFS.cs index 69615e766..44a529f1c 100644 --- a/Aaru.Filesystems/HPFS.cs +++ b/Aaru.Filesystems/HPFS.cs @@ -43,14 +43,23 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from an old unnamed document + /// + /// Implements detection of IBM's High Performance File System (HPFS) + /// public sealed class HPFS : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "OS/2 High Performance File System"; + /// public Guid Id => new Guid("33513B2C-f590-4acb-8bf2-0b1d5e19dec5"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(16 + partition.Start >= partition.End) @@ -65,6 +74,7 @@ namespace Aaru.Filesystems return magic1 == 0xF995E849 && magic2 == 0xFA53E9C5; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/HPOFS/HPOFS.cs b/Aaru.Filesystems/HPOFS/HPOFS.cs index 6e9991e2e..fbbd7124d 100644 --- a/Aaru.Filesystems/HPOFS/HPOFS.cs +++ b/Aaru.Filesystems/HPOFS/HPOFS.cs @@ -39,12 +39,20 @@ namespace Aaru.Filesystems { // Information from test floppy images created with OS/2 HPOFS 2.0 // Need to get IBM document GA32-0224 -> IBM 3995 Optical Library Dataserver Products: Optical Disk Format + /// + /// Implements identification of IBM's High Performance Optical File System + /// public sealed partial class HPOFS : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "High Performance Optical File System"; + /// public Guid Id => new Guid("1b72dcd5-d031-4757-8a9f-8d2fb18c59e2"); + /// public string Author => "Natalia Portillo"; } } \ No newline at end of file diff --git a/Aaru.Filesystems/HPOFS/Info.cs b/Aaru.Filesystems/HPOFS/Info.cs index 9b9dad9c7..479f23da4 100644 --- a/Aaru.Filesystems/HPOFS/Info.cs +++ b/Aaru.Filesystems/HPOFS/Info.cs @@ -43,6 +43,7 @@ namespace Aaru.Filesystems { public sealed partial class HPOFS { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(16 + partition.Start >= partition.End) @@ -59,6 +60,7 @@ namespace Aaru.Filesystems return bpb.fs_type.SequenceEqual(_type); } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ISO9660/Dir.cs b/Aaru.Filesystems/ISO9660/Dir.cs index 6acf80feb..06b05bfde 100644 --- a/Aaru.Filesystems/ISO9660/Dir.cs +++ b/Aaru.Filesystems/ISO9660/Dir.cs @@ -46,6 +46,7 @@ namespace Aaru.Filesystems { Dictionary> _directoryCache; + /// public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs index 174956fce..b7c96f779 100644 --- a/Aaru.Filesystems/ISO9660/File.cs +++ b/Aaru.Filesystems/ISO9660/File.cs @@ -47,6 +47,7 @@ namespace Aaru.Filesystems { public sealed partial class ISO9660 { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; @@ -72,6 +73,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -90,6 +92,7 @@ namespace Aaru.Filesystems } // TODO: Resolve symbolic link + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { buf = null; @@ -161,6 +164,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; @@ -412,6 +416,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno ReadLink(string path, out string dest) { dest = null; diff --git a/Aaru.Filesystems/ISO9660/ISO9660.cs b/Aaru.Filesystems/ISO9660/ISO9660.cs index 7951d5d89..29494689f 100644 --- a/Aaru.Filesystems/ISO9660/ISO9660.cs +++ b/Aaru.Filesystems/ISO9660/ISO9660.cs @@ -42,6 +42,9 @@ using Schemas; namespace Aaru.Filesystems { // This is coded following ECMA-119. + /// + /// Implements the High Sierra, ISO9660 and CD-i filesystems + /// [SuppressMessage("ReSharper", "UnusedType.Local")] public sealed partial class ISO9660 : IReadOnlyFilesystem { @@ -60,12 +63,18 @@ namespace Aaru.Filesystems bool _useTransTbl; ushort _blockSize; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "ISO9660 Filesystem"; + /// public Guid Id => new Guid("d812f4d3-c357-400d-90fd-3b22ef786aa8"); + /// public string Author => "Natalia Portillo"; + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] { @@ -75,6 +84,7 @@ namespace Aaru.Filesystems "If present, use Enhanced Volume Descriptor with specified encoding (overrides namespace)") }; + /// public Dictionary Namespaces => new Dictionary { { diff --git a/Aaru.Filesystems/ISO9660/Info.cs b/Aaru.Filesystems/ISO9660/Info.cs index 88582e462..cd845b4b5 100644 --- a/Aaru.Filesystems/ISO9660/Info.cs +++ b/Aaru.Filesystems/ISO9660/Info.cs @@ -46,6 +46,7 @@ namespace Aaru.Filesystems { public sealed partial class ISO9660 { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { // ISO9660 is designed for 2048 bytes/sector devices @@ -83,6 +84,7 @@ namespace Aaru.Filesystems Encoding.ASCII.GetString(vdMagic) == CDI_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ISO9660/Super.cs b/Aaru.Filesystems/ISO9660/Super.cs index 942d7c411..7b4cbfe76 100644 --- a/Aaru.Filesystems/ISO9660/Super.cs +++ b/Aaru.Filesystems/ISO9660/Super.cs @@ -46,6 +46,7 @@ namespace Aaru.Filesystems { public sealed partial class ISO9660 { + /// public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -753,6 +754,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Unmount() { if(!_mounted) @@ -765,6 +767,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno StatFs(out FileSystemInfo stat) { stat = null; diff --git a/Aaru.Filesystems/ISO9660/Xattr.cs b/Aaru.Filesystems/ISO9660/Xattr.cs index 2fedfeb3a..e584fdee2 100644 --- a/Aaru.Filesystems/ISO9660/Xattr.cs +++ b/Aaru.Filesystems/ISO9660/Xattr.cs @@ -40,6 +40,7 @@ namespace Aaru.Filesystems { public sealed partial class ISO9660 { + /// public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -102,6 +103,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno GetXattr(string path, string xattr, ref byte[] buf) { buf = null; diff --git a/Aaru.Filesystems/JFS.cs b/Aaru.Filesystems/JFS.cs index 290e71ec4..fb563e368 100644 --- a/Aaru.Filesystems/JFS.cs +++ b/Aaru.Filesystems/JFS.cs @@ -43,17 +43,26 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of IBM's Journaled File System + /// public sealed class JFS : IFilesystem { const uint JFS_BOOT_BLOCKS_SIZE = 0x8000; const uint JFS_MAGIC = 0x3153464A; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "JFS Plugin"; + /// public Guid Id => new Guid("D3BE2A41-8F28-4055-94DC-BB6C72A0E9C4"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.Info.SectorSize; @@ -71,6 +80,7 @@ namespace Aaru.Filesystems return jfsSb.s_magic == JFS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/LIF.cs b/Aaru.Filesystems/LIF.cs index 2939b78bc..c2a57fcf5 100644 --- a/Aaru.Filesystems/LIF.cs +++ b/Aaru.Filesystems/LIF.cs @@ -43,16 +43,25 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from http://www.hp9845.net/9845/projects/hpdir/#lif_filesystem + /// + /// Implements detection of the LIF filesystem + /// public sealed class LIF : IFilesystem { const uint LIF_MAGIC = 0x8000; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "HP Logical Interchange Format Plugin"; + /// public Guid Id => new Guid("41535647-77A5-477B-9206-DA727ACDC704"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 256) @@ -65,6 +74,7 @@ namespace Aaru.Filesystems return lifSb.magic == LIF_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/LisaFS/Dir.cs b/Aaru.Filesystems/LisaFS/Dir.cs index 6dd0d7a65..39e97da4c 100644 --- a/Aaru.Filesystems/LisaFS/Dir.cs +++ b/Aaru.Filesystems/LisaFS/Dir.cs @@ -43,9 +43,6 @@ namespace Aaru.Filesystems.LisaFS public sealed partial class LisaFS { /// - /// Solves a symbolic link. - /// Link path. - /// Link destination. public Errno ReadLink(string path, out string dest) { dest = null; @@ -55,9 +52,6 @@ namespace Aaru.Filesystems.LisaFS } /// - /// Lists contents from a directory. - /// Directory path. - /// Directory contents. public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/LisaFS/Extent.cs b/Aaru.Filesystems/LisaFS/Extent.cs index fbd40f590..6a090c637 100644 --- a/Aaru.Filesystems/LisaFS/Extent.cs +++ b/Aaru.Filesystems/LisaFS/Extent.cs @@ -41,6 +41,7 @@ namespace Aaru.Filesystems.LisaFS { public sealed partial class LisaFS { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; diff --git a/Aaru.Filesystems/LisaFS/File.cs b/Aaru.Filesystems/LisaFS/File.cs index d9d6d8ac2..ab5d856a6 100644 --- a/Aaru.Filesystems/LisaFS/File.cs +++ b/Aaru.Filesystems/LisaFS/File.cs @@ -41,6 +41,7 @@ namespace Aaru.Filesystems.LisaFS { public sealed partial class LisaFS { + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -58,6 +59,7 @@ namespace Aaru.Filesystems.LisaFS return Errno.NoError; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(size == 0) @@ -112,6 +114,7 @@ namespace Aaru.Filesystems.LisaFS return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; diff --git a/Aaru.Filesystems/LisaFS/Info.cs b/Aaru.Filesystems/LisaFS/Info.cs index bea97c560..ad30394c2 100644 --- a/Aaru.Filesystems/LisaFS/Info.cs +++ b/Aaru.Filesystems/LisaFS/Info.cs @@ -46,6 +46,7 @@ namespace Aaru.Filesystems.LisaFS { public sealed partial class LisaFS { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { try @@ -130,6 +131,7 @@ namespace Aaru.Filesystems.LisaFS } } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/LisaFS/LisaFS.cs b/Aaru.Filesystems/LisaFS/LisaFS.cs index 6f9ce31b4..51b6a66a4 100644 --- a/Aaru.Filesystems/LisaFS/LisaFS.cs +++ b/Aaru.Filesystems/LisaFS/LisaFS.cs @@ -40,6 +40,9 @@ namespace Aaru.Filesystems.LisaFS { // All information by Natalia Portillo // Variable names from Lisa API + /// + /// Implements the Apple Lisa File System + /// public sealed partial class LisaFS : IReadOnlyFilesystem { bool _debug; @@ -50,17 +53,24 @@ namespace Aaru.Filesystems.LisaFS SRecord[] _srecords; ulong _volumePrefix; + /// public string Name => "Apple Lisa File System"; + /// public Guid Id => new Guid("7E6034D1-D823-4248-A54D-239742B28391"); + /// public Encoding Encoding { get; private set; } + /// public FileSystemType XmlFsType { get; private set; } + /// public string Author => "Natalia Portillo"; // TODO: Implement Lisa 7/7 namespace (needs decoding {!CATALOG} file) + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => new Dictionary { { diff --git a/Aaru.Filesystems/LisaFS/Super.cs b/Aaru.Filesystems/LisaFS/Super.cs index 75743b47b..a7e171f13 100644 --- a/Aaru.Filesystems/LisaFS/Super.cs +++ b/Aaru.Filesystems/LisaFS/Super.cs @@ -48,7 +48,6 @@ namespace Aaru.Filesystems.LisaFS public sealed partial class LisaFS { /// - /// Mounts an Apple Lisa filesystem public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -358,7 +357,6 @@ namespace Aaru.Filesystems.LisaFS } /// - /// Unmounts this Lisa filesystem public Errno Unmount() { _mounted = false; @@ -377,8 +375,6 @@ namespace Aaru.Filesystems.LisaFS } /// - /// Gets information about the mounted volume. - /// Information about the mounted volume. public Errno StatFs(out FileSystemInfo stat) { stat = null; diff --git a/Aaru.Filesystems/LisaFS/Xattr.cs b/Aaru.Filesystems/LisaFS/Xattr.cs index 4e429a1e0..febb11820 100644 --- a/Aaru.Filesystems/LisaFS/Xattr.cs +++ b/Aaru.Filesystems/LisaFS/Xattr.cs @@ -43,10 +43,6 @@ namespace Aaru.Filesystems.LisaFS public sealed partial class LisaFS { /// - /// Lists all extended attributes, alternate data streams and forks of the given file. - /// Error number. - /// Path. - /// List of extended attributes, alternate data streams and forks. public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -59,11 +55,6 @@ namespace Aaru.Filesystems.LisaFS } /// - /// Reads an extended attribute, alternate data stream or fork from the given file. - /// Error number. - /// File path. - /// Extended attribute, alternate data stream or fork name. - /// Buffer. public Errno GetXattr(string path, string xattr, ref byte[] buf) { Errno error = LookupFileId(path, out short fileId, out bool isDir); diff --git a/Aaru.Filesystems/Locus.cs b/Aaru.Filesystems/Locus.cs index c610c0a95..416bb8d57 100644 --- a/Aaru.Filesystems/Locus.cs +++ b/Aaru.Filesystems/Locus.cs @@ -67,6 +67,9 @@ using time_t = System.Int32; namespace Aaru.Filesystems { + /// + /// Implements detection of the Locus filesystem + /// public sealed class Locus : IFilesystem { const int NICINOD = 325; @@ -79,12 +82,18 @@ namespace Aaru.Filesystems const uint LOCUS_MAGIC_OLD = 0xFFEEDDCC; const uint LOCUS_CIGAM_OLD = 0xCCDDEEFF; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Locus Filesystem Plugin"; + /// public Guid Id => new Guid("1A70B30A-437D-479A-88E1-D0C9C1797FF4"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -119,6 +128,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/MicroDOS.cs b/Aaru.Filesystems/MicroDOS.cs index 3106e29cc..150429cd7 100644 --- a/Aaru.Filesystems/MicroDOS.cs +++ b/Aaru.Filesystems/MicroDOS.cs @@ -43,19 +43,29 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { - // Information from http://www.owg.ru/mkt/BK/MKDOS.TXT - // Thanks to tarlabnor for translating it + /// + /// Implements detection for the MicroDOS filesystem. + /// + /// Information from http://www.owg.ru/mkt/BK/MKDOS.TXT + /// Thanks to tarlabnor for translating it + /// public sealed class MicroDOS : IFilesystem { const ushort MAGIC = 0xA72E; const ushort MAGIC2 = 0x530C; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "MicroDOS file system"; + /// public Guid Id => new Guid("9F9A364A-1A27-48A3-B730-7A7122000324"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(1 + partition.Start >= partition.End) @@ -71,6 +81,7 @@ namespace Aaru.Filesystems return block0.label == MAGIC && block0.mklabel == MAGIC2; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/MinixFS.cs b/Aaru.Filesystems/MinixFS.cs index 65a767c38..d6ccd58b0 100644 --- a/Aaru.Filesystems/MinixFS.cs +++ b/Aaru.Filesystems/MinixFS.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from the Linux kernel + /// + /// Implements detection of the MINIX filesystem + /// public sealed class MinixFS : IFilesystem { /// Minix v1, 14 char filenames @@ -67,12 +70,18 @@ namespace Aaru.Filesystems /// Minix v3, 60 char filenames const ushort MINIX3_CIGAM = 0x5A4D; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Minix Filesystem"; + /// public Guid Id => new Guid("FE248C3B-B727-4AE5-A39F-79EA9A07D4B3"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { uint sector = 2; @@ -115,6 +124,7 @@ namespace Aaru.Filesystems magic == MINIX2_CIGAM || magic == MINIX3_CIGAM; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/NILFS2.cs b/Aaru.Filesystems/NILFS2.cs index d21956331..f143c3907 100644 --- a/Aaru.Filesystems/NILFS2.cs +++ b/Aaru.Filesystems/NILFS2.cs @@ -43,17 +43,26 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the New Implementation of a Log-structured File System v2 + /// public sealed class NILFS2 : IFilesystem { const ushort NILFS2_MAGIC = 0x3434; const uint NILFS2_SUPER_OFFSET = 1024; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "NILFS2 Plugin"; + /// public Guid Id => new Guid("35224226-C5CC-48B5-8FFD-3781E91E86B6"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -82,6 +91,7 @@ namespace Aaru.Filesystems return nilfsSb.magic == NILFS2_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/NTFS.cs b/Aaru.Filesystems/NTFS.cs index 1f6c70120..8e4f6487b 100644 --- a/Aaru.Filesystems/NTFS.cs +++ b/Aaru.Filesystems/NTFS.cs @@ -43,14 +43,23 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from Inside Windows NT + /// + /// Implements detection of the New Technology File System (NTFS) + /// public sealed class NTFS : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "New Technology File System (NTFS)"; + /// public Guid Id => new Guid("33513B2C-1e6d-4d21-a660-0bbc789c3871"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -79,6 +88,7 @@ namespace Aaru.Filesystems return signature == 0xAA55; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Nintendo.cs b/Aaru.Filesystems/Nintendo.cs index 38eafa807..e6ad57f0d 100644 --- a/Aaru.Filesystems/Nintendo.cs +++ b/Aaru.Filesystems/Nintendo.cs @@ -40,14 +40,23 @@ using Schemas; namespace Aaru.Filesystems { + /// + /// Implements detection of the filesystem used by Nintendo Gamecube and Wii discs + /// public sealed class NintendoPlugin : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Nintendo optical filesystems"; + /// public Guid Id => new Guid("4675fcb4-4418-4288-9e4a-33d6a4ac1126"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start != 0) @@ -64,6 +73,7 @@ namespace Aaru.Filesystems return magicGc == 0xC2339F3D || magicWii == 0x5D1C9EA3; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ODS.cs b/Aaru.Filesystems/ODS.cs index 236a36fb5..9382c1b72 100644 --- a/Aaru.Filesystems/ODS.cs +++ b/Aaru.Filesystems/ODS.cs @@ -52,14 +52,23 @@ namespace Aaru.Filesystems // There is an ODS with signature "DECFILES11A", yet to be seen // Time is a 64 bit unsigned integer, tenths of microseconds since 1858/11/17 00:00:00. // TODO: Implement checksum + /// + /// Implements detection of DEC's On-Disk Structure, aka the ODS filesystem + /// public sealed class ODS : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Files-11 On-Disk Structure"; + /// public Guid Id => new Guid("de20633c-8021-4384-aeb0-83b0df14491f"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -97,6 +106,7 @@ namespace Aaru.Filesystems return magic == "DECFILE11A " || magic == "DECFILE11B "; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Opera/Dir.cs b/Aaru.Filesystems/Opera/Dir.cs index edefbc4fc..29905a46e 100644 --- a/Aaru.Filesystems/Opera/Dir.cs +++ b/Aaru.Filesystems/Opera/Dir.cs @@ -41,6 +41,7 @@ namespace Aaru.Filesystems { public sealed partial class OperaFS { + /// public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/Opera/File.cs b/Aaru.Filesystems/Opera/File.cs index b7ed36650..a48d07c14 100644 --- a/Aaru.Filesystems/Opera/File.cs +++ b/Aaru.Filesystems/Opera/File.cs @@ -40,6 +40,7 @@ namespace Aaru.Filesystems { public sealed partial class OperaFS { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; @@ -61,6 +62,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -78,6 +80,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { buf = null; @@ -135,6 +138,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; diff --git a/Aaru.Filesystems/Opera/Info.cs b/Aaru.Filesystems/Opera/Info.cs index 67584f687..15691d10a 100644 --- a/Aaru.Filesystems/Opera/Info.cs +++ b/Aaru.Filesystems/Opera/Info.cs @@ -41,6 +41,7 @@ namespace Aaru.Filesystems { public sealed partial class OperaFS { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -61,6 +62,7 @@ namespace Aaru.Filesystems return Encoding.ASCII.GetString(syncBytes) == SYNC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Opera/Opera.cs b/Aaru.Filesystems/Opera/Opera.cs index db7281ae8..0129f38a8 100644 --- a/Aaru.Filesystems/Opera/Opera.cs +++ b/Aaru.Filesystems/Opera/Opera.cs @@ -39,6 +39,9 @@ using Schemas; namespace Aaru.Filesystems { + /// + /// Implements the 3DO Opera filesystem + /// public sealed partial class OperaFS : IReadOnlyFilesystem { bool _debug; @@ -49,12 +52,18 @@ namespace Aaru.Filesystems FileSystemInfo _statfs; uint _volumeBlockSizeRatio; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Opera Filesystem Plugin"; + /// public Guid Id => new Guid("0ec84ec7-eae6-4196-83fe-943b3fe46dbd"); + /// public string Author => "Natalia Portillo"; + /// public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -62,8 +71,10 @@ namespace Aaru.Filesystems return Errno.NotSupported; } + /// public Errno GetXattr(string path, string xattr, ref byte[] buf) => Errno.NotSupported; + /// public Errno ReadLink(string path, out string dest) { dest = null; @@ -71,10 +82,12 @@ namespace Aaru.Filesystems return Errno.NotSupported; } + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => null; static Dictionary GetDefaultOptions() => new Dictionary diff --git a/Aaru.Filesystems/Opera/Super.cs b/Aaru.Filesystems/Opera/Super.cs index 4a7e36abe..4b6b6c70f 100644 --- a/Aaru.Filesystems/Opera/Super.cs +++ b/Aaru.Filesystems/Opera/Super.cs @@ -42,6 +42,7 @@ namespace Aaru.Filesystems { public sealed partial class OperaFS { + /// public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -104,6 +105,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno Unmount() { if(!_mounted) @@ -114,6 +116,7 @@ namespace Aaru.Filesystems return Errno.NoError; } + /// public Errno StatFs(out FileSystemInfo stat) { stat = null; diff --git a/Aaru.Filesystems/PCEngine.cs b/Aaru.Filesystems/PCEngine.cs index 991822558..e0dbb5864 100644 --- a/Aaru.Filesystems/PCEngine.cs +++ b/Aaru.Filesystems/PCEngine.cs @@ -38,14 +38,23 @@ using Schemas; namespace Aaru.Filesystems { + /// + /// Implements detection of the PC-Engine CD file headers + /// public sealed class PCEnginePlugin : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "PC Engine CD Plugin"; + /// public Guid Id => new Guid("e5ee6d7c-90fa-49bd-ac89-14ef750b8af3"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -59,6 +68,7 @@ namespace Aaru.Filesystems return Encoding.ASCII.GetString(systemDescriptor) == "PC Engine CD-ROM SYSTEM"; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/PCFX.cs b/Aaru.Filesystems/PCFX.cs index 64b91fd77..6ac57c49b 100644 --- a/Aaru.Filesystems/PCFX.cs +++ b/Aaru.Filesystems/PCFX.cs @@ -43,15 +43,24 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Not a filesystem, more like an executable header + /// + /// Implements detection of NEC PC-FX headers + /// public sealed class PCFX : IFilesystem { const string IDENTIFIER = "PC-FX:Hu_CD-ROM "; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "PC-FX Plugin"; + /// public Guid Id => new Guid("8BC27CCE-D9E9-48F8-BA93-C66A86EB565A"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End || @@ -65,6 +74,7 @@ namespace Aaru.Filesystems return encoding.GetString(sector, 0, 16) == IDENTIFIER; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/PFS.cs b/Aaru.Filesystems/PFS.cs index 75ade6abd..27847df57 100644 --- a/Aaru.Filesystems/PFS.cs +++ b/Aaru.Filesystems/PFS.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Professional File System + /// public sealed class PFS : IFilesystem { /// Identifier for AFS (PFS v1) @@ -56,12 +59,18 @@ namespace Aaru.Filesystems /// Identifier for multi-user PFS const uint MUPFS_DISK = 0x6D755046; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Professional File System"; + /// public Guid Id => new Guid("68DE769E-D957-406A-8AE4-3781CA8CDA77"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Length < 3) @@ -75,6 +84,7 @@ namespace Aaru.Filesystems magic == MUPFS_DISK; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ProDOS.cs b/Aaru.Filesystems/ProDOS.cs index 974630e29..2fd55d08c 100644 --- a/Aaru.Filesystems/ProDOS.cs +++ b/Aaru.Filesystems/ProDOS.cs @@ -46,6 +46,9 @@ using Encoding = System.Text.Encoding; namespace Aaru.Filesystems { // Information from Apple ProDOS 8 Technical Reference + /// + /// Implements detection of Apple ProDOS filesystem + /// [SuppressMessage("ReSharper", "UnusedMember.Local"), SuppressMessage("ReSharper", "UnusedType.Local")] public sealed class ProDOSPlugin : IFilesystem { @@ -81,12 +84,18 @@ namespace Aaru.Filesystems const byte ENTRY_LENGTH = 0x27; const byte ENTRIES_PER_BLOCK = 0x0D; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Apple ProDOS filesystem"; + /// public Guid Id => new Guid("43874265-7B8A-4739-BCF7-07F80D5932BF"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Length < 3) @@ -159,6 +168,7 @@ namespace Aaru.Filesystems return totalBlocks <= partition.End - partition.Start + 1; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/QNX4.cs b/Aaru.Filesystems/QNX4.cs index 4685b3271..69cb1cccb 100644 --- a/Aaru.Filesystems/QNX4.cs +++ b/Aaru.Filesystems/QNX4.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of QNX 4 filesystem + /// [SuppressMessage("ReSharper", "UnusedType.Local")] public sealed class QNX4 : IFilesystem { @@ -51,12 +54,18 @@ namespace Aaru.Filesystems 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "QNX4 Plugin"; + /// public Guid Id => new Guid("E73A63FA-B5B0-48BF-BF82-DA5F0A8170D2"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start + 1 >= imagePlugin.Info.Sectors) @@ -97,6 +106,7 @@ namespace Aaru.Filesystems return true; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/QNX6.cs b/Aaru.Filesystems/QNX6.cs index 62e988592..ade2378ae 100644 --- a/Aaru.Filesystems/QNX6.cs +++ b/Aaru.Filesystems/QNX6.cs @@ -41,18 +41,27 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of QNX 6 filesystem + /// public sealed class QNX6 : IFilesystem { const uint QNX6_SUPER_BLOCK_SIZE = 0x1000; const uint QNX6_BOOT_BLOCKS_SIZE = 0x2000; const uint QNX6_MAGIC = 0x68191122; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "QNX6 Plugin"; + /// public Guid Id => new Guid("3E610EA2-4D08-4D70-8947-830CD4C74FC0"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.Info.SectorSize; @@ -74,6 +83,7 @@ namespace Aaru.Filesystems return qnxSb.magic == QNX6_MAGIC || audiSb.magic == QNX6_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/RBF.cs b/Aaru.Filesystems/RBF.cs index 4416950bc..5bc533d87 100644 --- a/Aaru.Filesystems/RBF.cs +++ b/Aaru.Filesystems/RBF.cs @@ -42,18 +42,27 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Locus filesystem + /// public sealed class RBF : IFilesystem { /// Magic number for OS-9. Same for OS-9000? const uint RBF_SYNC = 0x4372757A; const uint RBF_CNYS = 0x7A757243; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "OS-9 Random Block File Plugin"; + /// public Guid Id => new Guid("E864E45B-0B52-4D29-A858-7BDFA9199FB2"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 256) @@ -98,6 +107,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/RT11.cs b/Aaru.Filesystems/RT11.cs index ad0e24c83..4109ebad8 100644 --- a/Aaru.Filesystems/RT11.cs +++ b/Aaru.Filesystems/RT11.cs @@ -44,15 +44,23 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from http://www.trailing-edge.com/~shoppa/rt11fs/ - // TODO: Implement Radix-50 + /// + /// Implements detection of the DEC RT-11 filesystem + /// public sealed class RT11 : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "RT-11 file system"; + /// public Guid Id => new Guid("DB3E2F98-8F98-463C-8126-E937843DA024"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(1 + partition.Start >= partition.End) @@ -70,6 +78,7 @@ namespace Aaru.Filesystems return magic == "DECRT11A "; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ReFS.cs b/Aaru.Filesystems/ReFS.cs index 08841d3e2..2e8d5643e 100644 --- a/Aaru.Filesystems/ReFS.cs +++ b/Aaru.Filesystems/ReFS.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of Microsoft's Resilient filesystem (ReFS) + /// public sealed class ReFS : IFilesystem { const uint FSRS = 0x53525346; @@ -50,12 +53,18 @@ namespace Aaru.Filesystems { 0x52, 0x65, 0x46, 0x53, 0x00, 0x00, 0x00, 0x00 }; + /// public string Name => "Resilient File System plugin"; + /// public Guid Id => new Guid("37766C4E-EBF5-4113-A712-B758B756ABD6"); + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { uint sbSize = (uint)(Marshal.SizeOf() / imagePlugin.Info.SectorSize); @@ -77,6 +86,7 @@ namespace Aaru.Filesystems vhdr.signature.SequenceEqual(_signature); } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Register.cs b/Aaru.Filesystems/Register.cs index e0a8ccc41..c2a124103 100644 --- a/Aaru.Filesystems/Register.cs +++ b/Aaru.Filesystems/Register.cs @@ -44,33 +44,44 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.Filesystems { + /// public sealed class Register : IPluginRegister { + /// public List GetAllChecksumPlugins() => null; + /// public List GetAllFilesystemPlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IFilesystem))). Where(t => t.IsClass).ToList(); + /// public List GetAllFilterPlugins() => null; + /// public List GetAllFloppyImagePlugins() => null; + /// public List GetAllMediaImagePlugins() => null; + /// public List GetAllPartitionPlugins() => null; + /// public List GetAllReadOnlyFilesystemPlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IReadOnlyFilesystem ))).Where(t => t.IsClass). ToList(); + /// public List GetAllWritableFloppyImagePlugins() => null; + /// public List GetAllWritableImagePlugins() => null; + /// public List GetAllArchivePlugins() => null; } } diff --git a/Aaru.Filesystems/Reiser.cs b/Aaru.Filesystems/Reiser.cs index 8244dfc8b..2b915361a 100644 --- a/Aaru.Filesystems/Reiser.cs +++ b/Aaru.Filesystems/Reiser.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Reiser v3 filesystem + /// public sealed class Reiser : IFilesystem { const uint REISER_SUPER_OFFSET = 0x10000; @@ -59,12 +62,18 @@ namespace Aaru.Filesystems 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x33, 0x46, 0x73, 0x00 }; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Reiser Filesystem Plugin"; + /// public Guid Id => new Guid("1D8CD8B8-27E6-410F-9973-D16409225FBA"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -94,6 +103,7 @@ namespace Aaru.Filesystems _magicJr.SequenceEqual(reiserSb.magic); } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Reiser4.cs b/Aaru.Filesystems/Reiser4.cs index 6987b38a1..8f59778cb 100644 --- a/Aaru.Filesystems/Reiser4.cs +++ b/Aaru.Filesystems/Reiser4.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Reiser v4 filesystem + /// public sealed class Reiser4 : IFilesystem { const uint REISER4_SUPER_OFFSET = 0x10000; @@ -51,12 +54,18 @@ namespace Aaru.Filesystems 0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Reiser4 Filesystem Plugin"; + /// public Guid Id => new Guid("301F2D00-E8D5-4F04-934E-81DFB21D15BA"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -85,6 +94,7 @@ namespace Aaru.Filesystems return _magic.SequenceEqual(reiserSb.magic); } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/SFS.cs b/Aaru.Filesystems/SFS.cs index c744837bd..1f2192ee2 100644 --- a/Aaru.Filesystems/SFS.cs +++ b/Aaru.Filesystems/SFS.cs @@ -41,6 +41,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Smart File System + /// public sealed class SFS : IFilesystem { /// Identifier for SFS v1 @@ -48,12 +51,18 @@ namespace Aaru.Filesystems /// Identifier for SFS v2 const uint SFS2_MAGIC = 0x53465302; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "SmartFileSystem"; + /// public Guid Id => new Guid("26550C19-3671-4A2D-BC2F-F20CEB7F48DC"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -66,6 +75,7 @@ namespace Aaru.Filesystems return magic == SFS_MAGIC || magic == SFS2_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/SolarFS.cs b/Aaru.Filesystems/SolarFS.cs index de1e55e1d..f720805bb 100644 --- a/Aaru.Filesystems/SolarFS.cs +++ b/Aaru.Filesystems/SolarFS.cs @@ -41,14 +41,23 @@ using Schemas; namespace Aaru.Filesystems { // Based on FAT's BPB, cannot find a FAT or directory + /// + /// Implements detection of the Solar OS filesystem + /// public sealed class SolarFS : IFilesystem { + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Solar_OS filesystem"; + /// public Guid Id => new Guid("EA3101C1-E777-4B4F-B5A3-8C57F50F6E65"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -65,6 +74,7 @@ namespace Aaru.Filesystems return signature == 0x29 && fsType == "SOL_FS "; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Squash.cs b/Aaru.Filesystems/Squash.cs index ee51799d2..fe7e06562 100644 --- a/Aaru.Filesystems/Squash.cs +++ b/Aaru.Filesystems/Squash.cs @@ -41,18 +41,27 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the squash filesystem + /// public sealed class Squash : IFilesystem { /// Identifier for Squash const uint SQUASH_MAGIC = 0x73717368; const uint SQUASH_CIGAM = 0x68737173; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Squash filesystem"; + /// public Guid Id => new Guid("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -65,6 +74,7 @@ namespace Aaru.Filesystems return magic == SQUASH_MAGIC || magic == SQUASH_CIGAM; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/SysV.cs b/Aaru.Filesystems/SysV.cs index 2b0637644..25b2014b3 100644 --- a/Aaru.Filesystems/SysV.cs +++ b/Aaru.Filesystems/SysV.cs @@ -44,6 +44,9 @@ using Schemas; namespace Aaru.Filesystems { // Information from the Linux kernel + /// + /// Implements detection of the UNIX System V filesystem + /// [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "UnusedMember.Local"), SuppressMessage("ReSharper", "UnusedType.Local")] public sealed class SysVfs : IFilesystem @@ -69,12 +72,18 @@ namespace Aaru.Filesystems const ushort V7_NICFREE = 100; const uint V7_MAXSIZE = 0x00FFFFFF; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "UNIX System V filesystem"; + /// public Guid Id => new Guid("9B8D016A-8561-400E-A12A-A198283C211D"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -188,6 +197,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/UCSDPascal/Dir.cs b/Aaru.Filesystems/UCSDPascal/Dir.cs index 469b332a0..0337a2416 100644 --- a/Aaru.Filesystems/UCSDPascal/Dir.cs +++ b/Aaru.Filesystems/UCSDPascal/Dir.cs @@ -41,6 +41,7 @@ namespace Aaru.Filesystems.UCSDPascal // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure public sealed partial class PascalPlugin { + /// public Errno ReadDir(string path, out List contents) { contents = null; diff --git a/Aaru.Filesystems/UCSDPascal/File.cs b/Aaru.Filesystems/UCSDPascal/File.cs index d1ace5bbc..937a3e799 100644 --- a/Aaru.Filesystems/UCSDPascal/File.cs +++ b/Aaru.Filesystems/UCSDPascal/File.cs @@ -40,6 +40,7 @@ namespace Aaru.Filesystems.UCSDPascal // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure public sealed partial class PascalPlugin { + /// public Errno MapBlock(string path, long fileBlock, out long deviceBlock) { deviceBlock = 0; @@ -47,6 +48,7 @@ namespace Aaru.Filesystems.UCSDPascal return !_mounted ? Errno.AccessDenied : Errno.NotImplemented; } + /// public Errno GetAttributes(string path, out FileAttributes attributes) { attributes = new FileAttributes(); @@ -72,6 +74,7 @@ namespace Aaru.Filesystems.UCSDPascal return error; } + /// public Errno Read(string path, long offset, long size, ref byte[] buf) { if(!_mounted) @@ -119,6 +122,7 @@ namespace Aaru.Filesystems.UCSDPascal return Errno.NoError; } + /// public Errno Stat(string path, out FileEntryInfo stat) { stat = null; diff --git a/Aaru.Filesystems/UCSDPascal/Info.cs b/Aaru.Filesystems/UCSDPascal/Info.cs index c57bd06f0..8650772ca 100644 --- a/Aaru.Filesystems/UCSDPascal/Info.cs +++ b/Aaru.Filesystems/UCSDPascal/Info.cs @@ -45,6 +45,7 @@ namespace Aaru.Filesystems.UCSDPascal // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure public sealed partial class PascalPlugin { + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Length < 3) @@ -112,6 +113,7 @@ namespace Aaru.Filesystems.UCSDPascal return volEntry.Files >= 0; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/UCSDPascal/Super.cs b/Aaru.Filesystems/UCSDPascal/Super.cs index a2827cccd..8f92795a9 100644 --- a/Aaru.Filesystems/UCSDPascal/Super.cs +++ b/Aaru.Filesystems/UCSDPascal/Super.cs @@ -45,6 +45,7 @@ namespace Aaru.Filesystems.UCSDPascal // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure public sealed partial class PascalPlugin { + /// public Errno Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, Dictionary options, string @namespace) { @@ -138,6 +139,7 @@ namespace Aaru.Filesystems.UCSDPascal return Errno.NoError; } + /// public Errno Unmount() { _mounted = false; @@ -146,6 +148,7 @@ namespace Aaru.Filesystems.UCSDPascal return Errno.NoError; } + /// public Errno StatFs(out FileSystemInfo stat) { stat = new FileSystemInfo diff --git a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs index ee2fa11d8..c05121f47 100644 --- a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs +++ b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs @@ -40,6 +40,9 @@ using Schemas; namespace Aaru.Filesystems.UCSDPascal { // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure + /// + /// Implements the U.C.S.D. Pascal filesystem + /// public sealed partial class PascalPlugin : IReadOnlyFilesystem { byte[] _bootBlocks; @@ -52,12 +55,18 @@ namespace Aaru.Filesystems.UCSDPascal /// Apple II disks use 256 bytes / sector, but filesystem assumes it's 512 bytes / sector uint _multiplier; + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "U.C.S.D. Pascal filesystem"; + /// public Guid Id => new Guid("B0AC2CB5-72AA-473A-9200-270B5A2C2D53"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public Errno ListXAttr(string path, out List xattrs) { xattrs = null; @@ -65,8 +74,10 @@ namespace Aaru.Filesystems.UCSDPascal return Errno.NotSupported; } + /// public Errno GetXattr(string path, string xattr, ref byte[] buf) => Errno.NotSupported; + /// public Errno ReadLink(string path, out string dest) { dest = null; @@ -74,10 +85,12 @@ namespace Aaru.Filesystems.UCSDPascal return Errno.NotSupported; } + /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => new (string name, Type type, string description)[] {}; + /// public Dictionary Namespaces => null; static Dictionary GetDefaultOptions() => new Dictionary diff --git a/Aaru.Filesystems/UDF.cs b/Aaru.Filesystems/UDF.cs index 64155b4e7..1e25dbb98 100644 --- a/Aaru.Filesystems/UDF.cs +++ b/Aaru.Filesystems/UDF.cs @@ -45,6 +45,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // TODO: Detect bootable + /// + /// Implements detection of the Universal Disk Format filesystem + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class UDF : IFilesystem { @@ -54,12 +57,18 @@ namespace Aaru.Filesystems 0x74, 0x00, 0x00, 0x00, 0x00 }; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Universal Disk Format"; + /// public Guid Id => new Guid("83976FEC-A91B-464B-9293-56C719461BAB"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { // UDF needs at least that @@ -199,6 +208,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/UNICOS.cs b/Aaru.Filesystems/UNICOS.cs index 49589dc3f..b68196679 100644 --- a/Aaru.Filesystems/UNICOS.cs +++ b/Aaru.Filesystems/UNICOS.cs @@ -51,6 +51,9 @@ using time_t = System.Int64; namespace Aaru.Filesystems { + /// + /// Implements detection for the Cray UNICOS filesystem + /// public sealed class UNICOS : IFilesystem { const int NC1_MAXPART = 64; @@ -59,12 +62,18 @@ namespace Aaru.Filesystems const ulong UNICOS_MAGIC = 0x6e6331667331636e; const ulong UNICOS_SECURE = 0xcd076d1771d670cd; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "UNICOS Filesystem Plugin"; + /// public Guid Id => new Guid("61712F04-066C-44D5-A2A0-1E44C66B33F0"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -91,6 +100,7 @@ namespace Aaru.Filesystems return unicosSb.s_magic == UNICOS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/UNIXBFS.cs b/Aaru.Filesystems/UNIXBFS.cs index b9e16b1e3..86131ac31 100644 --- a/Aaru.Filesystems/UNIXBFS.cs +++ b/Aaru.Filesystems/UNIXBFS.cs @@ -41,16 +41,25 @@ using Schemas; namespace Aaru.Filesystems { // Information from the Linux kernel + /// + /// Implements detection of the UNIX boot filesystem + /// public sealed class BFS : IFilesystem { const uint BFS_MAGIC = 0x1BADFACE; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "UNIX Boot filesystem"; + /// public Guid Id => new Guid("1E6E0DA6-F7E4-494C-80C6-CB5929E96155"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) @@ -61,6 +70,7 @@ namespace Aaru.Filesystems return magic == BFS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/VMfs.cs b/Aaru.Filesystems/VMfs.cs index 7e25aed41..397e6c434 100644 --- a/Aaru.Filesystems/VMfs.cs +++ b/Aaru.Filesystems/VMfs.cs @@ -42,6 +42,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the VMware filesystem + /// [SuppressMessage("ReSharper", "UnusedType.Local"), SuppressMessage("ReSharper", "IdentifierTypo"), SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class VMfs : IFilesystem @@ -50,12 +53,18 @@ namespace Aaru.Filesystems const uint VMFS_MAGIC = 0xC001D00D; const uint VMFS_BASE = 0x00100000; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "VMware filesystem"; + /// public Guid Id => new Guid("EE52BDB8-B49C-4122-A3DA-AD21CBE79843"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(partition.Start >= partition.End) @@ -73,6 +82,7 @@ namespace Aaru.Filesystems return magic == VMFS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/VxFS.cs b/Aaru.Filesystems/VxFS.cs index 17c7bd188..fca45bf20 100644 --- a/Aaru.Filesystems/VxFS.cs +++ b/Aaru.Filesystems/VxFS.cs @@ -41,18 +41,27 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of the Veritas filesystem + /// public sealed class VxFS : IFilesystem { /// Identifier for VxFS const uint VXFS_MAGIC = 0xA501FCF5; const uint VXFS_BASE = 0x400; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Veritas filesystem"; + /// public Guid Id => new Guid("EC372605-7687-453C-8BEA-7E0DFF79CB03"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { ulong vmfsSuperOff = VXFS_BASE / imagePlugin.Info.SectorSize; @@ -67,6 +76,7 @@ namespace Aaru.Filesystems return magic == VXFS_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/XFS.cs b/Aaru.Filesystems/XFS.cs index 99437bd67..36022e37a 100644 --- a/Aaru.Filesystems/XFS.cs +++ b/Aaru.Filesystems/XFS.cs @@ -43,16 +43,25 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { + /// + /// Implements detection of SGI's XFS + /// public sealed class XFS : IFilesystem { const uint XFS_MAGIC = 0x58465342; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "XFS Filesystem Plugin"; + /// public Guid Id => new Guid("1D8CD8B8-27E6-410F-9973-D16409225FBA"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -119,6 +128,7 @@ namespace Aaru.Filesystems return false; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/Xia.cs b/Aaru.Filesystems/Xia.cs index 8bce8c79b..1d0c2cde4 100644 --- a/Aaru.Filesystems/Xia.cs +++ b/Aaru.Filesystems/Xia.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from the Linux kernel + /// + /// Implements detection for the Xia filesystem + /// [SuppressMessage("ReSharper", "UnusedMember.Local"), SuppressMessage("ReSharper", "UnusedType.Local")] public sealed class Xia : IFilesystem { @@ -54,12 +57,18 @@ namespace Aaru.Filesystems const int XIAFS_NUM_BLOCK_POINTERS = 10; const int XIAFS_NAME_LEN = 248; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Xia filesystem"; + /// public Guid Id => new Guid("169E1DE5-24F2-4EF6-A04D-A4B2CA66DE9D"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { int sbSizeInBytes = Marshal.SizeOf(); @@ -77,6 +86,7 @@ namespace Aaru.Filesystems return supblk.s_magic == XIAFS_SUPER_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ZFS.cs b/Aaru.Filesystems/ZFS.cs index 84a20a583..fce3574a5 100644 --- a/Aaru.Filesystems/ZFS.cs +++ b/Aaru.Filesystems/ZFS.cs @@ -61,6 +61,9 @@ namespace Aaru.Filesystems * It can also be encoded little or big endian. * Because of this variations, ZFS stored a header indicating the used encoding and endianess before the encoded nvlist. */ + /// + /// Implements detection for the Zettabyte File System (ZFS) + /// [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "UnusedType.Local"), SuppressMessage("ReSharper", "UnusedMember.Local"), SuppressMessage("ReSharper", "NotAccessedField.Local")] public sealed class ZFS : IFilesystem @@ -78,12 +81,18 @@ namespace Aaru.Filesystems const uint ZFS_MAGIC = 0x58465342; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "ZFS Filesystem Plugin"; + /// public Guid Id => new Guid("0750014F-A714-4692-A369-E23F6EC3659C"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -111,6 +120,7 @@ namespace Aaru.Filesystems return magic == ZEC_MAGIC || magic == ZEC_CIGAM; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/dump.cs b/Aaru.Filesystems/dump.cs index 3db35dc02..781216b2e 100644 --- a/Aaru.Filesystems/dump.cs +++ b/Aaru.Filesystems/dump.cs @@ -44,6 +44,9 @@ using ufs_daddr_t = System.Int32; namespace Aaru.Filesystems { + /// + /// Implements identification of a dump(8) image (virtual filesystem on a file) + /// [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class dump : IFilesystem { @@ -88,12 +91,18 @@ namespace Aaru.Filesystems const int NDADDR = 12; const int NIADDR = 3; + /// public Encoding Encoding { get; private set; } + /// public string Name => "dump(8) Plugin"; + /// public Guid Id => new Guid("E53B4D28-C858-4800-B092-DDAE80D361B9"); + /// public FileSystemType XmlFsType { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -126,6 +135,7 @@ namespace Aaru.Filesystems newHdr.c_magic == NFS_CIGAM || newHdr.c_magic == UFS2_MAGIC || newHdr.c_magic == UFS2_CIGAM; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/exFAT.cs b/Aaru.Filesystems/exFAT.cs index eb26ad3d0..b536da063 100644 --- a/Aaru.Filesystems/exFAT.cs +++ b/Aaru.Filesystems/exFAT.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from https://www.sans.org/reading-room/whitepapers/forensics/reverse-engineering-microsoft-exfat-file-system-33274 + /// + /// Implements detection of the exFAT filesystem + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class exFAT : IFilesystem { @@ -53,12 +56,18 @@ namespace Aaru.Filesystems 0x45, 0x58, 0x46, 0x41, 0x54, 0x20, 0x20, 0x20 }; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Microsoft Extended File Allocation Table"; + /// public Guid Id => new Guid("8271D088-1533-4CB3-AC28-D802B68BB95C"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(12 + partition.Start >= partition.End) @@ -74,6 +83,7 @@ namespace Aaru.Filesystems return _signature.SequenceEqual(vbr.signature); } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/ext2FS.cs b/Aaru.Filesystems/ext2FS.cs index 3c4832864..3002a048e 100644 --- a/Aaru.Filesystems/ext2FS.cs +++ b/Aaru.Filesystems/ext2FS.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Filesystems { // Information from the Linux kernel + /// + /// Implements detection of the Linux extended filesystem v2, v3 and v4 + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class ext2FS : IFilesystem { @@ -162,12 +165,18 @@ namespace Aaru.Filesystems /// Testing development code const uint EXT2_FLAGS_TEST_FILESYS = 0x00000004; + /// public FileSystemType XmlFsType { get; private set; } + /// public Encoding Encoding { get; private set; } + /// public string Name => "Linux extended Filesystem 2, 3 and 4"; + /// public Guid Id => new Guid("6AA91B88-150B-4A7B-AD56-F84FB2DF4184"); + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { ulong sbSectorOff = SB_POS / imagePlugin.Info.SectorSize; @@ -195,6 +204,7 @@ namespace Aaru.Filesystems return magic == EXT2_MAGIC || magic == EXT2_MAGIC_OLD; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filesystems/extFS.cs b/Aaru.Filesystems/extFS.cs index f0440ea77..0518516ec 100644 --- a/Aaru.Filesystems/extFS.cs +++ b/Aaru.Filesystems/extFS.cs @@ -40,6 +40,9 @@ using Schemas; namespace Aaru.Filesystems { // Information from the Linux kernel + /// + /// Implements detection of the Linux extended filesystem + /// public sealed class extFS : IFilesystem { const int SB_POS = 0x400; @@ -47,12 +50,18 @@ namespace Aaru.Filesystems /// ext superblock magic const ushort EXT_MAGIC = 0x137D; + /// public FileSystemType XmlFsType { get; private set; } + /// public string Name => "Linux extended Filesystem"; + /// public Guid Id => new Guid("076CB3A2-08C2-4D69-BC8A-FCAA2E502BE2"); + /// public Encoding Encoding { get; private set; } + /// public string Author => "Natalia Portillo"; + /// public bool Identify(IMediaImage imagePlugin, Partition partition) { if(imagePlugin.Info.SectorSize < 512) @@ -77,6 +86,7 @@ namespace Aaru.Filesystems return magic == EXT_MAGIC; } + /// public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { diff --git a/Aaru.Filters/AppleDouble.cs b/Aaru.Filters/AppleDouble.cs index b62729259..b96b4a347 100644 --- a/Aaru.Filters/AppleDouble.cs +++ b/Aaru.Filters/AppleDouble.cs @@ -82,32 +82,47 @@ namespace Aaru.Filters bool _opened; Entry _rsrcFork; + /// public string Name => "AppleDouble"; + /// public Guid Id => new Guid("1B2165EE-C9DF-4B21-BBBB-9E5892B2DF4D"); + /// public string Author => "Natalia Portillo"; + /// public void Close() => _opened = false; + /// public string GetBasePath() => _basePath; + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _dataFork.length; + /// public Stream GetDataForkStream() => new FileStream(_basePath, FileMode.Open, FileAccess.Read); + /// public string GetFilename() => Path.GetFileName(_basePath); + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _dataFork.length + _rsrcFork.length; + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public string GetPath() => _basePath; + /// public long GetResourceForkLength() => _rsrcFork.length; + /// public Stream GetResourceForkStream() { if(_rsrcFork.length == 0) @@ -117,12 +132,16 @@ namespace Aaru.Filters (_rsrcFork.offset + _rsrcFork.length) - 1); } + /// public bool HasResourceFork() => _rsrcFork.length > 0; + /// public bool Identify(byte[] buffer) => false; + /// public bool Identify(Stream stream) => false; + /// public bool Identify(string path) { string filename = Path.GetFileName(path); @@ -302,14 +321,18 @@ namespace Aaru.Filters return _header.magic == MAGIC && (_header.version == VERSION || _header.version == VERSION2); } + /// public bool IsOpened() => _opened; // Now way to have two files in a single byte array + /// public void Open(byte[] buffer) => throw new NotSupportedException(); // Now way to have two files in a single stream + /// public void Open(Stream stream) => throw new NotSupportedException(); + /// public void Open(string path) { string filename = Path.GetFileName(path); diff --git a/Aaru.Filters/AppleSingle.cs b/Aaru.Filters/AppleSingle.cs index 4b6b16c89..ee878c295 100644 --- a/Aaru.Filters/AppleSingle.cs +++ b/Aaru.Filters/AppleSingle.cs @@ -83,10 +83,14 @@ namespace Aaru.Filters Entry _rsrcFork; Stream _stream; + /// public string Name => "AppleSingle"; + /// public Guid Id => new Guid("A69B20E8-F4D3-42BB-BD2B-4A7263394A05"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _bytes = null; @@ -97,12 +101,16 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _dataFork.length; + /// public Stream GetDataForkStream() { if(_dataFork.length == 0) @@ -121,18 +129,25 @@ namespace Aaru.Filters return null; } + /// public string GetFilename() => Path.GetFileName(_basePath); + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _dataFork.length + _rsrcFork.length; + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public string GetPath() => _basePath; + /// public long GetResourceForkLength() => _rsrcFork.length; + /// public Stream GetResourceForkStream() { if(_rsrcFork.length == 0) @@ -151,8 +166,10 @@ namespace Aaru.Filters return null; } + /// public bool HasResourceFork() => _rsrcFork.length > 0; + /// public bool Identify(byte[] buffer) { if(buffer == null || @@ -166,6 +183,7 @@ namespace Aaru.Filters return _header.magic == MAGIC && (_header.version == VERSION || _header.version == VERSION2); } + /// public bool Identify(Stream stream) { if(stream == null || @@ -180,6 +198,7 @@ namespace Aaru.Filters return _header.magic == MAGIC && (_header.version == VERSION || _header.version == VERSION2); } + /// public bool Identify(string path) { if(!File.Exists(path)) @@ -199,8 +218,10 @@ namespace Aaru.Filters return _header.magic == MAGIC && (_header.version == VERSION || _header.version == VERSION2); } + /// public bool IsOpened() => _opened; + /// public void Open(byte[] buffer) { var ms = new MemoryStream(buffer); @@ -287,6 +308,7 @@ namespace Aaru.Filters _bytes = buffer; } + /// public void Open(Stream stream) { stream.Seek(0, SeekOrigin.Begin); @@ -372,6 +394,7 @@ namespace Aaru.Filters _stream = stream; } + /// public void Open(string path) { var fs = new FileStream(path, FileMode.Open, FileAccess.Read); diff --git a/Aaru.Filters/BZip2.cs b/Aaru.Filters/BZip2.cs index 14d4dd2c2..cea83996a 100644 --- a/Aaru.Filters/BZip2.cs +++ b/Aaru.Filters/BZip2.cs @@ -49,10 +49,14 @@ namespace Aaru.Filters DateTime _lastWriteTime; bool _opened; + /// public string Name => "BZip2"; + /// public Guid Id => new Guid("FCCFB0C3-32EF-40D8-9714-2333F6AC72A9"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _dataStream?.Close(); @@ -61,16 +65,22 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public Stream GetDataForkStream() => _innerStream; + /// public string GetPath() => _basePath; + /// public Stream GetResourceForkStream() => null; + /// public bool HasResourceFork() => false; + /// public bool Identify(byte[] buffer) { if(buffer[0] != 0x42 || @@ -86,6 +96,7 @@ namespace Aaru.Filters return buffer[^512] != 0x6B || buffer[^511] != 0x6F || buffer[^510] != 0x6C || buffer[^509] != 0x79; } + /// public bool Identify(Stream stream) { byte[] buffer = new byte[4]; @@ -112,6 +123,7 @@ namespace Aaru.Filters return buffer[0] != 0x6B || buffer[1] != 0x6F || buffer[2] != 0x6C || buffer[3] != 0x79; } + /// public bool Identify(string path) { if(!File.Exists(path)) @@ -142,6 +154,7 @@ namespace Aaru.Filters return buffer[0] != 0x6B || buffer[1] != 0x6F || buffer[2] != 0x6C || buffer[3] != 0x79; } + /// public void Open(byte[] buffer) { _dataStream = new MemoryStream(buffer); @@ -153,6 +166,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(Stream stream) { _dataStream = stream; @@ -164,6 +178,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(string path) { _dataStream = new FileStream(path, FileMode.Open, FileAccess.Read); @@ -177,16 +192,22 @@ namespace Aaru.Filters _opened = true; } + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _decompressedSize; + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _decompressedSize; + /// public long GetResourceForkLength() => 0; + /// public string GetFilename() { if(_basePath?.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase) == true) @@ -196,8 +217,10 @@ namespace Aaru.Filters ? _basePath.Substring(0, _basePath.Length - 6) : _basePath; } + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public bool IsOpened() => _opened; } } \ No newline at end of file diff --git a/Aaru.Filters/ForcedSeekStream.cs b/Aaru.Filters/ForcedSeekStream.cs index fcd6bb90d..bc77119e2 100644 --- a/Aaru.Filters/ForcedSeekStream.cs +++ b/Aaru.Filters/ForcedSeekStream.cs @@ -39,6 +39,7 @@ namespace Aaru.Filters /// ForcedSeekStream allows to seek a forward-readable stream (like System.IO.Compression streams) by doing the /// slow and known trick of rewinding and forward reading until arriving the desired position. /// + /// public sealed class ForcedSeekStream : Stream where T : Stream { const int BUFFER_LEN = 1048576; @@ -50,6 +51,7 @@ namespace Aaru.Filters /// Initializes a new instance of the class. /// The real (uncompressed) length of the stream. /// Parameters that are used to create the base stream. + /// public ForcedSeekStream(long length, params object[] args) { _streamLength = length; @@ -63,6 +65,7 @@ namespace Aaru.Filters /// Initializes a new instance of the class. /// Parameters that are used to create the base stream. + /// public ForcedSeekStream(params object[] args) { _baseStream = (T)Activator.CreateInstance(typeof(T), args); @@ -71,14 +74,19 @@ namespace Aaru.Filters CalculateLength(); } + /// public override bool CanRead => _baseStream.CanRead; + /// public override bool CanSeek => true; + /// public override bool CanWrite => false; + /// public override long Length => _streamLength; + /// public override long Position { get => _backStream.Position; @@ -139,12 +147,14 @@ namespace Aaru.Filters _backStream.Write(buffer, 0, restToRead); } + /// public override void Flush() { _baseStream.Flush(); _backStream.Flush(); } + /// public override int Read(byte[] buffer, int offset, int count) { if(_backStream.Position + count > _streamLength) @@ -159,6 +169,7 @@ namespace Aaru.Filters return _backStream.Read(buffer, offset, count); } + /// public override int ReadByte() { if(_backStream.Position + 1 > _streamLength) @@ -173,6 +184,7 @@ namespace Aaru.Filters return _backStream.ReadByte(); } + /// public override long Seek(long offset, SeekOrigin origin) { switch(origin) @@ -203,10 +215,13 @@ namespace Aaru.Filters return _backStream.Position; } + /// public override void SetLength(long value) => throw new NotSupportedException(); + /// public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + /// public override void Close() { _backStream?.Close(); diff --git a/Aaru.Filters/GZip.cs b/Aaru.Filters/GZip.cs index 08b7b4a18..87314d1c0 100644 --- a/Aaru.Filters/GZip.cs +++ b/Aaru.Filters/GZip.cs @@ -49,10 +49,14 @@ namespace Aaru.Filters bool _opened; Stream _zStream; + /// public string Name => "GZip"; + /// public Guid Id => new Guid("F4996661-4A29-42C9-A2C7-3904EF40F3B0"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _dataStream?.Close(); @@ -61,18 +65,25 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public Stream GetDataForkStream() => _zStream; + /// public string GetPath() => _basePath; + /// public Stream GetResourceForkStream() => null; + /// public bool HasResourceFork() => false; + /// public bool Identify(byte[] buffer) => buffer[0] == 0x1F && buffer[1] == 0x8B && buffer[2] == 0x08; + /// public bool Identify(Stream stream) { byte[] buffer = new byte[3]; @@ -84,6 +95,7 @@ namespace Aaru.Filters return buffer[0] == 0x1F && buffer[1] == 0x8B && buffer[2] == 0x08; } + /// public bool Identify(string path) { if(!File.Exists(path)) @@ -99,6 +111,7 @@ namespace Aaru.Filters return buffer[0] == 0x1F && buffer[1] == 0x8B && buffer[2] == 0x08; } + /// public void Open(byte[] buffer) { byte[] mtimeB = new byte[4]; @@ -125,6 +138,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(Stream stream) { byte[] mtimeB = new byte[4]; @@ -151,6 +165,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(string path) { byte[] mtimeB = new byte[4]; @@ -176,16 +191,22 @@ namespace Aaru.Filters _opened = true; } + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _decompressedSize; + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _decompressedSize; + /// public long GetResourceForkLength() => 0; + /// public string GetFilename() { if(_basePath?.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase) == true) @@ -195,8 +216,10 @@ namespace Aaru.Filters ? _basePath.Substring(0, _basePath.Length - 5) : _basePath; } + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public bool IsOpened() => _opened; } } \ No newline at end of file diff --git a/Aaru.Filters/LZip.cs b/Aaru.Filters/LZip.cs index d13d06b33..ef4079f94 100644 --- a/Aaru.Filters/LZip.cs +++ b/Aaru.Filters/LZip.cs @@ -49,10 +49,14 @@ namespace Aaru.Filters DateTime _lastWriteTime; bool _opened; + /// public string Name => "LZip"; + /// public Guid Id => new Guid("09D715E9-20C0-48B1-A8D9-D8897CEC57C9"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _dataStream?.Close(); @@ -61,19 +65,26 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public Stream GetDataForkStream() => _innerStream; + /// public string GetPath() => _basePath; + /// public Stream GetResourceForkStream() => null; + /// public bool HasResourceFork() => false; + /// public bool Identify(byte[] buffer) => buffer[0] == 0x4C && buffer[1] == 0x5A && buffer[2] == 0x49 && buffer[3] == 0x50 && buffer[4] == 0x01; + /// public bool Identify(Stream stream) { byte[] buffer = new byte[5]; @@ -86,6 +97,7 @@ namespace Aaru.Filters buffer[4] == 0x01; } + /// public bool Identify(string path) { if(!File.Exists(path)) @@ -102,6 +114,7 @@ namespace Aaru.Filters buffer[4] == 0x01; } + /// public void Open(byte[] buffer) { _dataStream = new MemoryStream(buffer); @@ -115,6 +128,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(Stream stream) { _dataStream = stream; @@ -130,6 +144,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(string path) { _dataStream = new FileStream(path, FileMode.Open, FileAccess.Read); @@ -147,16 +162,22 @@ namespace Aaru.Filters _opened = true; } + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _decompressedSize; + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _decompressedSize; + /// public long GetResourceForkLength() => 0; + /// public string GetFilename() { if(_basePath?.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase) == true) @@ -166,8 +187,10 @@ namespace Aaru.Filters ? _basePath.Substring(0, _basePath.Length - 5) : _basePath; } + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public bool IsOpened() => _opened; } } \ No newline at end of file diff --git a/Aaru.Filters/MacBinary.cs b/Aaru.Filters/MacBinary.cs index ebca2aef4..2a9542673 100644 --- a/Aaru.Filters/MacBinary.cs +++ b/Aaru.Filters/MacBinary.cs @@ -56,10 +56,14 @@ namespace Aaru.Filters long _rsrcForkOff; Stream _stream; + /// public string Name => "MacBinary"; + /// public Guid Id => new Guid("D7C321D3-E51F-45DF-A150-F6BFDF0D7704"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _bytes = null; @@ -70,12 +74,16 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _header.dataLength; + /// public Stream GetDataForkStream() { if(_header.dataLength == 0) @@ -94,18 +102,25 @@ namespace Aaru.Filters return null; } + /// public string GetFilename() => _filename; + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _header.dataLength + _header.resourceLength; + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public string GetPath() => _basePath; + /// public long GetResourceForkLength() => _header.resourceLength; + /// public Stream GetResourceForkStream() { if(_header.resourceLength == 0) @@ -124,8 +139,10 @@ namespace Aaru.Filters return null; } + /// public bool HasResourceFork() => _header.resourceLength > 0; + /// public bool Identify(byte[] buffer) { if(buffer == null || @@ -142,6 +159,7 @@ namespace Aaru.Filters (_header.dataLength > 0 || _header.resourceLength > 0)); } + /// public bool Identify(Stream stream) { if(stream == null || @@ -159,6 +177,7 @@ namespace Aaru.Filters (_header.dataLength > 0 || _header.resourceLength > 0)); } + /// public bool Identify(string path) { if(!File.Exists(path)) @@ -181,8 +200,10 @@ namespace Aaru.Filters (_header.dataLength > 0 || _header.resourceLength > 0)); } + /// public bool IsOpened() => _opened; + /// public void Open(byte[] buffer) { var ms = new MemoryStream(buffer); @@ -216,6 +237,7 @@ namespace Aaru.Filters _bytes = buffer; } + /// public void Open(Stream stream) { stream.Seek(0, SeekOrigin.Begin); @@ -248,6 +270,7 @@ namespace Aaru.Filters _stream = stream; } + /// public void Open(string path) { var fs = new FileStream(path, FileMode.Open, FileAccess.Read); diff --git a/Aaru.Filters/OffsetStream.cs b/Aaru.Filters/OffsetStream.cs index c2f194c32..a9bb2b1bd 100644 --- a/Aaru.Filters/OffsetStream.cs +++ b/Aaru.Filters/OffsetStream.cs @@ -41,12 +41,20 @@ using Microsoft.Win32.SafeHandles; namespace Aaru.Filters { /// Creates a stream that is a subset of another stream. + /// public sealed class OffsetStream : Stream { readonly Stream _baseStream; readonly long _streamEnd; readonly long _streamStart; + /// + /// Initializes a stream that only allows reading from to of the specified stream, both inclusive. + /// + /// Base stream + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(Stream stream, long start, long end) { if(start < 0) @@ -66,6 +74,18 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// A bitwise combination of the enumeration values that specifies additional file options. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, long start, long end) { @@ -86,6 +106,14 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A file handle for the file that the stream will encapsulate. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(SafeFileHandle handle, FileAccess access, long start, long end) { if(start < 0) @@ -105,6 +133,15 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A file handle for the file that the stream will encapsulate. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(SafeFileHandle handle, FileAccess access, int bufferSize, long start, long end) { if(start < 0) @@ -124,6 +161,16 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A file handle for the file that the stream will encapsulate. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// Specifies whether to use asynchronous I/O or synchronous I/O. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync, long start, long end) { @@ -144,6 +191,18 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// Specifies whether to use asynchronous I/O or synchronous I/O. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync, long start, long end) { @@ -164,6 +223,17 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, long start, long end) { @@ -184,6 +254,16 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(string path, FileMode mode, FileAccess access, FileShare share, long start, long end) { if(start < 0) @@ -203,6 +283,15 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(string path, FileMode mode, FileAccess access, long start, long end) { if(start < 0) @@ -222,6 +311,14 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified file, both inclusive. + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(string path, FileMode mode, long start, long end) { if(start < 0) @@ -241,6 +338,17 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified byte array, both inclusive. + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The index into at which the stream begins. + /// The length in bytes to add to the end of the current stream. + /// The setting of the CanWrite property, currently ignored. + /// Currently ignored. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible, long start, long end) { @@ -261,6 +369,16 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified byte array, both inclusive. + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The index into at which the stream begins. + /// The length in bytes to add to the end of the current stream. + /// The setting of the CanWrite property, currently ignored. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(byte[] buffer, int index, int count, bool writable, long start, long end) { if(start < 0) @@ -280,6 +398,15 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified byte array, both inclusive. + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The index into at which the stream begins. + /// The length in bytes to add to the end of the current stream. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(byte[] buffer, int index, int count, long start, long end) { if(start < 0) @@ -299,6 +426,14 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified byte array, both inclusive. + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The setting of the CanWrite property, currently ignored. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(byte[] buffer, bool writable, long start, long end) { if(start < 0) @@ -318,6 +453,13 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// + /// Initializes a stream that only allows reading from to of the specified byte array, both inclusive. + /// + /// The array of unsigned bytes to add at the end of this stream. + /// Start position + /// Last readable position + /// Invalid range public OffsetStream(byte[] buffer, long start, long end) { if(start < 0) @@ -337,14 +479,19 @@ namespace Aaru.Filters _baseStream.Position = start; } + /// public override bool CanRead => _baseStream.CanRead; + /// public override bool CanSeek => _baseStream.CanSeek; + /// public override bool CanWrite => _baseStream.CanWrite; + /// public override long Length => _streamEnd - _streamStart + 1; + /// public override long Position { get => _baseStream.Position - _streamStart; @@ -364,6 +511,7 @@ namespace Aaru.Filters _baseStream.Dispose(); } + /// public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { @@ -373,6 +521,7 @@ namespace Aaru.Filters return _baseStream.BeginRead(buffer, offset, count, callback, state); } + /// public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { @@ -382,6 +531,7 @@ namespace Aaru.Filters return _baseStream.BeginWrite(buffer, offset, count, callback, state); } + /// public override void Close() => _baseStream.Close(); new void Dispose() @@ -390,12 +540,16 @@ namespace Aaru.Filters base.Dispose(); } + /// public override int EndRead(IAsyncResult asyncResult) => _baseStream.EndRead(asyncResult); + /// public override void EndWrite(IAsyncResult asyncResult) => _baseStream.EndWrite(asyncResult); + /// public override int ReadByte() => _baseStream.Position == _streamEnd + 1 ? -1 : _baseStream.ReadByte(); + /// public override void WriteByte(byte value) { if(_baseStream.Position + 1 > _streamEnd) @@ -404,8 +558,10 @@ namespace Aaru.Filters _baseStream.WriteByte(value); } + /// public override void Flush() => _baseStream.Flush(); + /// public override int Read(byte[] buffer, int offset, int count) { if(_baseStream.Position + count > _streamEnd + 1) @@ -414,6 +570,7 @@ namespace Aaru.Filters return _baseStream.Read(buffer, offset, count); } + /// public override long Seek(long offset, SeekOrigin origin) { switch(origin) @@ -436,9 +593,11 @@ namespace Aaru.Filters } } + /// public override void SetLength(long value) => throw new NotSupportedException("Growing OffsetStream is not supported."); + /// public override void Write(byte[] buffer, int offset, int count) { if(_baseStream.Position + count > _streamEnd) diff --git a/Aaru.Filters/PCExchange.cs b/Aaru.Filters/PCExchange.cs index c974669af..6c56c9d78 100644 --- a/Aaru.Filters/PCExchange.cs +++ b/Aaru.Filters/PCExchange.cs @@ -59,40 +59,59 @@ namespace Aaru.Filters long _rsrcLen; string _rsrcPath; + /// public string Name => "PCExchange"; + /// public Guid Id => new Guid("9264EB9F-D634-4F9B-BE12-C24CD44988C6"); + /// public string Author => "Natalia Portillo"; + /// public void Close() => _opened = false; + /// public string GetBasePath() => _basePath; + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _dataLen; + /// public Stream GetDataForkStream() => new FileStream(_dataPath, FileMode.Open, FileAccess.Read); + /// public string GetFilename() => Path.GetFileName(_basePath); + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _dataLen + _rsrcLen; + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public string GetPath() => _basePath; + /// public long GetResourceForkLength() => _rsrcLen; + /// public Stream GetResourceForkStream() => new FileStream(_rsrcPath, FileMode.Open, FileAccess.Read); + /// public bool HasResourceFork() => _rsrcPath != null; + /// public bool Identify(byte[] buffer) => false; + /// public bool Identify(Stream stream) => false; + /// public bool Identify(string path) { string parentFolder = Path.GetDirectoryName(path); @@ -154,12 +173,16 @@ namespace Aaru.Filters return dataFound && rsrcFound; } + /// public bool IsOpened() => _opened; + /// public void Open(byte[] buffer) => throw new NotSupportedException(); + /// public void Open(Stream stream) => throw new NotSupportedException(); + /// public void Open(string path) { string parentFolder = Path.GetDirectoryName(path); diff --git a/Aaru.Filters/Register.cs b/Aaru.Filters/Register.cs index 474c4c885..003abb74b 100644 --- a/Aaru.Filters/Register.cs +++ b/Aaru.Filters/Register.cs @@ -44,28 +44,39 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.Filters { + /// public class Register : IPluginRegister { + /// public List GetAllChecksumPlugins() => null; + /// public List GetAllFilesystemPlugins() => null; + /// public List GetAllFilterPlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces().Contains(typeof(IFilter))). Where(t => t.IsClass).ToList(); + /// public List GetAllFloppyImagePlugins() => null; + /// public List GetAllMediaImagePlugins() => null; + /// public List GetAllPartitionPlugins() => null; + /// public List GetAllReadOnlyFilesystemPlugins() => null; + /// public List GetAllWritableFloppyImagePlugins() => null; + /// public List GetAllWritableImagePlugins() => null; + /// public List GetAllArchivePlugins() => null; } } diff --git a/Aaru.Filters/SplitJoinStream.cs b/Aaru.Filters/SplitJoinStream.cs index 2ec783d54..0a47779f3 100644 --- a/Aaru.Filters/SplitJoinStream.cs +++ b/Aaru.Filters/SplitJoinStream.cs @@ -8,12 +8,16 @@ using Microsoft.Win32.SafeHandles; namespace Aaru.Filters { + /// + /// Implements a stream that joins two or more files (sequentially) as a single stream + /// public class SplitJoinStream : Stream { readonly Dictionary _baseStreams; long _position; long _streamLength; + /// public SplitJoinStream() { _baseStreams = new Dictionary(); @@ -23,14 +27,19 @@ namespace Aaru.Filters Filter.Open(this); } + /// public override bool CanRead => true; + /// public override bool CanSeek => true; + /// public override bool CanWrite => false; + /// public override long Length => _streamLength; + /// public override long Position { get => _position; @@ -44,8 +53,16 @@ namespace Aaru.Filters } } + /// + /// Gets a filter from this stream + /// public IFilter Filter { get; } + /// + /// Adds a stream at the end of the current stream + /// + /// Stream to add + /// The specified stream is non-readable or non-seekable public void Add(Stream stream) { if(!stream.CanSeek) @@ -58,44 +75,146 @@ namespace Aaru.Filters _streamLength += stream.Length; } + + /// + /// Adds the specified file to the end of the current stream + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// A bitwise combination of the enumeration values that specifies additional file options. public void Add(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options) => Add(new FileStream(path, mode, access, share, bufferSize, options)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A file handle for the file that the stream will encapsulate. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. public void Add(SafeFileHandle handle, FileAccess access) => Add(new FileStream(handle, access)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A file handle for the file that the stream will encapsulate. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. public void Add(SafeFileHandle handle, FileAccess access, int bufferSize) => Add(new FileStream(handle, access, bufferSize)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A file handle for the file that the stream will encapsulate. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. public void Add(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync) => Add(new FileStream(handle, access, bufferSize, isAsync)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. + /// Specifies whether to use asynchronous I/O or synchronous I/O. public void Add(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync) => Add(new FileStream(path, mode, access, share, bufferSize, useAsync)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// A positive Int32 value greater than 0 indicating the buffer size. The default buffer size is 4096. public void Add(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize) => Add(new FileStream(path, mode, access, share, bufferSize)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. public void Add(string path, FileMode mode, FileAccess access, FileShare share) => Add(new FileStream(path, mode, access, share)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by a object. public void Add(string path, FileMode mode, FileAccess access) => Add(new FileStream(path, mode, access)); + /// + /// Adds the specified file to the end of the current stream + /// + /// A relative or absolute path for the file that the stream will encapsulate. + /// One of the enumeration values that determines how to open or create the file. public void Add(string path, FileMode mode) => Add(new FileStream(path, mode)); + /// + /// Adds the specified byte array to the end of the current stream + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The index into at which the stream begins. + /// The length in bytes to add to the end of the current stream. + /// The setting of the CanWrite property, currently ignored. + /// Currently ignored. public void Add(byte[] buffer, int index, int count, bool writable, bool publiclyVisible) => Add(new MemoryStream(buffer, index, count, writable, publiclyVisible)); + /// + /// Adds the specified byte array to the end of the current stream + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The index into at which the stream begins. + /// The length in bytes to add to the end of the current stream. + /// The setting of the CanWrite property, currently ignored. public void Add(byte[] buffer, int index, int count, bool writable, long start, long end) => Add(new MemoryStream(buffer, index, count, writable)); + /// + /// Adds the specified byte array to the end of the current stream + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The index into at which the stream begins. + /// The length in bytes to add to the end of the current stream. public void Add(byte[] buffer, int index, int count) => Add(new MemoryStream(buffer, index, count)); + /// + /// Adds the specified byte array to the end of the current stream + /// + /// The array of unsigned bytes to add at the end of this stream. + /// The setting of the CanWrite property, currently ignored. public void Add(byte[] buffer, bool writable) => Add(new MemoryStream(buffer, writable)); + /// + /// Adds the specified byte array to the end of the current stream + /// + /// The array of unsigned bytes to add at the end of this stream. public void Add(byte[] buffer) => Add(new MemoryStream(buffer)); + /// + /// Adds the data fork of the specified filter to the end of the current stream + /// + /// Filter public void Add(IFilter filter) => Add(filter.GetDataForkStream()); + /// + /// Adds a range of files to the end of the current stream, alphabetically sorted + /// + /// Base file path, directory path only + /// Counter format, includes filename and a formatting string + /// Counter start, defaults to 0 public void AddRange(string basePath, string counterFormat = "{0:D3}", int counterStart = 0) { while(true) @@ -123,14 +242,17 @@ namespace Aaru.Filters _position = 0; } + /// public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => throw new NotSupportedException("Asynchronous I/O is not supported."); + /// public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) => throw new NotSupportedException("Asynchronous I/O is not supported."); + /// public override void Close() { foreach(Stream stream in _baseStreams.Values) @@ -151,12 +273,15 @@ namespace Aaru.Filters base.Dispose(); } + /// public override int EndRead(IAsyncResult asyncResult) => throw new NotSupportedException("Asynchronous I/O is not supported."); + /// public override void EndWrite(IAsyncResult asyncResult) => throw new NotSupportedException("Asynchronous I/O is not supported."); + /// public override int ReadByte() { if(_position >= _streamLength) @@ -173,10 +298,13 @@ namespace Aaru.Filters return baseStream.Value.ReadByte(); } + /// public override void WriteByte(byte value) => throw new ReadOnlyException("This stream is read-only"); + /// public override void Flush() {} + /// public override int Read(byte[] buffer, int offset, int count) { int read = 0; @@ -204,6 +332,7 @@ namespace Aaru.Filters return read; } + /// public override long Seek(long offset, SeekOrigin origin) { switch(origin) @@ -234,8 +363,10 @@ namespace Aaru.Filters return _position; } + /// public override void SetLength(long value) => throw new ReadOnlyException("This stream is read-only"); + /// public override void Write(byte[] buffer, int offset, int count) => throw new ReadOnlyException("This stream is read-only"); } diff --git a/Aaru.Filters/XZ.cs b/Aaru.Filters/XZ.cs index cffda0de0..973800988 100644 --- a/Aaru.Filters/XZ.cs +++ b/Aaru.Filters/XZ.cs @@ -48,10 +48,14 @@ namespace Aaru.Filters DateTime _lastWriteTime; bool _opened; + /// public string Name => "XZ"; + /// public Guid Id => new Guid("666A8617-0444-4C05-9F4F-DF0FD758D0D2"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _dataStream?.Close(); @@ -60,20 +64,27 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public Stream GetDataForkStream() => _innerStream; + /// public string GetPath() => _basePath; + /// public Stream GetResourceForkStream() => null; + /// public bool HasResourceFork() => false; + /// public bool Identify(byte[] buffer) => buffer[0] == 0xFD && buffer[1] == 0x37 && buffer[2] == 0x7A && buffer[3] == 0x58 && buffer[4] == 0x5A && buffer[5] == 0x00 && buffer[^2] == 0x59 && buffer[^1] == 0x5A; + /// public bool Identify(Stream stream) { byte[] buffer = new byte[6]; @@ -92,6 +103,7 @@ namespace Aaru.Filters buffer[4] == 0x5A && buffer[5] == 0x00 && footer[0] == 0x59 && footer[1] == 0x5A; } + /// public bool Identify(string path) { if(!File.Exists(path)) @@ -114,6 +126,7 @@ namespace Aaru.Filters buffer[4] == 0x5A && buffer[5] == 0x00 && footer[0] == 0x59 && footer[1] == 0x5A; } + /// public void Open(byte[] buffer) { _dataStream = new MemoryStream(buffer); @@ -125,6 +138,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(Stream stream) { _dataStream = stream; @@ -136,6 +150,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(string path) { _dataStream = new FileStream(path, FileMode.Open, FileAccess.Read); @@ -149,16 +164,22 @@ namespace Aaru.Filters _opened = true; } + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _decompressedSize; + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _decompressedSize; + /// public long GetResourceForkLength() => 0; + /// public string GetFilename() { if(_basePath?.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase) == true) @@ -168,8 +189,10 @@ namespace Aaru.Filters ? _basePath.Substring(0, _basePath.Length - 5) : _basePath; } + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public bool IsOpened() => _opened; void GuessSize() diff --git a/Aaru.Filters/ZZZNoFilter.cs b/Aaru.Filters/ZZZNoFilter.cs index 6141d23b8..e1f13b0e5 100644 --- a/Aaru.Filters/ZZZNoFilter.cs +++ b/Aaru.Filters/ZZZNoFilter.cs @@ -45,10 +45,14 @@ namespace Aaru.Filters DateTime _lastWriteTime; bool _opened; + /// public string Name => "No filter"; + /// public Guid Id => new Guid("12345678-AAAA-BBBB-CCCC-123456789000"); + /// public string Author => "Natalia Portillo"; + /// public void Close() { _dataStream?.Close(); @@ -57,22 +61,31 @@ namespace Aaru.Filters _opened = false; } + /// public string GetBasePath() => _basePath; + /// public Stream GetDataForkStream() => _dataStream; + /// public string GetPath() => _basePath; + /// public Stream GetResourceForkStream() => null; + /// public bool HasResourceFork() => false; + /// public bool Identify(byte[] buffer) => buffer != null && buffer.Length > 0; + /// public bool Identify(Stream stream) => stream != null && stream.Length > 0; + /// public bool Identify(string path) => File.Exists(path); + /// public void Open(byte[] buffer) { _dataStream = new MemoryStream(buffer); @@ -82,6 +95,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(Stream stream) { _dataStream = stream; @@ -91,6 +105,7 @@ namespace Aaru.Filters _opened = true; } + /// public void Open(string path) { _dataStream = new FileStream(path, FileMode.Open, FileAccess.Read); @@ -101,20 +116,28 @@ namespace Aaru.Filters _opened = true; } + /// public DateTime GetCreationTime() => _creationTime; + /// public long GetDataForkLength() => _dataStream.Length; + /// public DateTime GetLastWriteTime() => _lastWriteTime; + /// public long GetLength() => _dataStream.Length; + /// public long GetResourceForkLength() => 0; + /// public string GetFilename() => Path.GetFileName(_basePath); + /// public string GetParentFolder() => Path.GetDirectoryName(_basePath); + /// public bool IsOpened() => _opened; } } \ No newline at end of file diff --git a/Aaru.Helpers b/Aaru.Helpers index d7db55d5f..138c6c1f4 160000 --- a/Aaru.Helpers +++ b/Aaru.Helpers @@ -1 +1 @@ -Subproject commit d7db55d5f229eec69e05bde6ac91202e6cbcfec0 +Subproject commit 138c6c1f4585d6c6a971aeffa691ec99e5629ef1 diff --git a/Aaru.Images/AaruFormat/AaruFormat.cs b/Aaru.Images/AaruFormat/AaruFormat.cs index 1d5b4799a..b55f4f47a 100644 --- a/Aaru.Images/AaruFormat/AaruFormat.cs +++ b/Aaru.Images/AaruFormat/AaruFormat.cs @@ -82,6 +82,9 @@ using SharpCompress.Compressors.LZMA; namespace Aaru.DiscImages { + /// + /// Implements reading and writing AaruFormat media images + /// public sealed partial class AaruFormat : IWritableOpticalImage, IVerifiableImage, IWritableTapeImage { bool _alreadyWrittenZero; diff --git a/Aaru.Images/AaruFormat/Identify.cs b/Aaru.Images/AaruFormat/Identify.cs index 29434843c..c70abaa24 100644 --- a/Aaru.Images/AaruFormat/Identify.cs +++ b/Aaru.Images/AaruFormat/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class AaruFormat { + /// public bool Identify(IFilter imageFilter) { _imageStream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/AaruFormat/Properties.cs b/Aaru.Images/AaruFormat/Properties.cs index d536a8c4f..193cdd6f7 100644 --- a/Aaru.Images/AaruFormat/Properties.cs +++ b/Aaru.Images/AaruFormat/Properties.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class AaruFormat { + /// public OpticalImageCapabilities OpticalCapabilities => OpticalImageCapabilities.CanStoreAudioTracks | OpticalImageCapabilities.CanStoreDataTracks | OpticalImageCapabilities.CanStorePregaps | @@ -56,21 +57,35 @@ namespace Aaru.DiscImages OpticalImageCapabilities.CanStoreNotCdSessions | OpticalImageCapabilities.CanStoreNotCdTracks | OpticalImageCapabilities.CanStoreIndexes; + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Aaru Format"; + /// public Guid Id => new Guid("49360069-1784-4A2F-B723-0C844D610B0A"); + /// public string Format => "Aaru"; + /// public string Author => "Natalia Portillo"; + /// public List Partitions { get; private set; } + /// public List Tracks { get; private set; } + /// public List Sessions { get; private set; } + /// public List DumpHardware { get; private set; } + /// public CICMMetadataType CicmMetadata { get; private set; } + /// public IEnumerable SupportedMediaTags => Enum.GetValues(typeof(MediaTagType)).Cast(); + /// public IEnumerable SupportedSectorTags => Enum.GetValues(typeof(SectorTagType)).Cast(); + /// public IEnumerable SupportedMediaTypes => Enum.GetValues(typeof(MediaType)).Cast(); + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { ("sectors_per_block", typeof(uint), @@ -88,11 +103,14 @@ namespace Aaru.DiscImages ("compress", typeof(bool), "Compress user data blocks. Other blocks will always be compressed", (object)true) }; + /// public IEnumerable KnownExtensions => new[] { ".dicf", ".aaru", ".aaruformat", ".aaruf", ".aif" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/AaruFormat/Read.cs b/Aaru.Images/AaruFormat/Read.cs index 72cb6950f..f7ca5b3e3 100644 --- a/Aaru.Images/AaruFormat/Read.cs +++ b/Aaru.Images/AaruFormat/Read.cs @@ -59,6 +59,7 @@ namespace Aaru.DiscImages { public sealed partial class AaruFormat { + /// public bool Open(IFilter imageFilter) { AaruConsole.DebugWriteLine("Aaru Format plugin", "Memory snapshot: {0} bytes", GC.GetTotalMemory(false)); @@ -1472,6 +1473,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadDiskTag(MediaTagType tag) { if(_mediaTags.TryGetValue(tag, out byte[] data)) @@ -1480,6 +1482,7 @@ namespace Aaru.DiscImages throw new FeatureNotPresentImageException("Requested tag is not present in image"); } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -1584,8 +1587,10 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1599,6 +1604,7 @@ namespace Aaru.DiscImages return ReadSector(trk.TrackStartSector + sectorAddress); } + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1612,6 +1618,7 @@ namespace Aaru.DiscImages return ReadSectorTag(trk.TrackStartSector + sectorAddress, tag); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -1632,6 +1639,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { uint sectorOffset; @@ -1910,6 +1918,7 @@ namespace Aaru.DiscImages return data; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1927,6 +1936,7 @@ namespace Aaru.DiscImages return ReadSectors(trk.TrackStartSector + sectorAddress, length); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1944,6 +1954,7 @@ namespace Aaru.DiscImages return ReadSectorsTag(trk.TrackStartSector + sectorAddress, length, tag); } + /// public byte[] ReadSectorLong(ulong sectorAddress) { switch(_imageInfo.XmlMediaType) @@ -2145,6 +2156,7 @@ namespace Aaru.DiscImages throw new FeatureNotPresentImageException("Feature not present in image"); } + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -2158,6 +2170,7 @@ namespace Aaru.DiscImages return ReadSectorLong(trk.TrackStartSector + sectorAddress); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { byte[] sectors; @@ -2319,6 +2332,7 @@ namespace Aaru.DiscImages throw new FeatureNotPresentImageException("Feature not present in image"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -2336,9 +2350,11 @@ namespace Aaru.DiscImages return ReadSectorsLong(trk.TrackStartSector + sectorAddress, length); } + /// public List GetSessionTracks(Session session) => Tracks.Where(t => t.TrackSequence == session.SessionSequence).ToList(); + /// public List GetSessionTracks(ushort session) => Tracks.Where(t => t.TrackSequence == session).ToList(); } } \ No newline at end of file diff --git a/Aaru.Images/AaruFormat/Tape.cs b/Aaru.Images/AaruFormat/Tape.cs index 928a1529f..a4b320c65 100644 --- a/Aaru.Images/AaruFormat/Tape.cs +++ b/Aaru.Images/AaruFormat/Tape.cs @@ -38,10 +38,14 @@ namespace Aaru.DiscImages { public sealed partial class AaruFormat { + /// public List Files { get; private set; } + /// public List TapePartitions { get; private set; } + /// public bool IsTape { get; private set; } + /// public bool AddFile(TapeFile file) { if(Files.Any(f => f.File == file.File)) @@ -55,6 +59,7 @@ namespace Aaru.DiscImages return true; } + /// public bool AddPartition(TapePartition partition) { if(TapePartitions.Any(f => f.Number == partition.Number)) @@ -68,6 +73,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetTape() { Files = new List(); diff --git a/Aaru.Images/AaruFormat/Verify.cs b/Aaru.Images/AaruFormat/Verify.cs index 18ae3ba3b..d8975fb4c 100644 --- a/Aaru.Images/AaruFormat/Verify.cs +++ b/Aaru.Images/AaruFormat/Verify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class AaruFormat { + /// public bool? VerifyMediaImage() { // This will traverse all blocks and check their CRC64 without uncompressing them @@ -205,6 +206,7 @@ namespace Aaru.DiscImages return true; } + /// public bool? VerifySector(ulong sectorAddress) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -215,6 +217,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -260,6 +263,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/AaruFormat/Write.cs b/Aaru.Images/AaruFormat/Write.cs index 8eb09ef0e..e4f4e247d 100644 --- a/Aaru.Images/AaruFormat/Write.cs +++ b/Aaru.Images/AaruFormat/Write.cs @@ -61,6 +61,7 @@ namespace Aaru.DiscImages { public sealed partial class AaruFormat { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -1649,6 +1650,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(!IsWriting) @@ -1668,6 +1670,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -1919,6 +1922,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -1951,6 +1955,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -2382,6 +2387,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { byte[] sector; @@ -2457,6 +2463,7 @@ namespace Aaru.DiscImages return false; } + /// public bool SetTracks(List tracks) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -2479,6 +2486,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -4377,6 +4385,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Creator = metadata.Creator; @@ -4397,6 +4406,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(!IsWriting) @@ -4426,6 +4436,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { if(!IsWriting) @@ -4579,6 +4590,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { if(!IsWriting) @@ -4629,6 +4641,7 @@ namespace Aaru.DiscImages } } + /// public bool SetDumpHardware(List dumpHardware) { DumpHardware = dumpHardware; @@ -4636,6 +4649,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetCicmMetadata(CICMMetadataType metadata) { CicmMetadata = metadata; diff --git a/Aaru.Images/Alcohol120/Alcohol120.cs b/Aaru.Images/Alcohol120/Alcohol120.cs index 8438fb29b..3299bab85 100644 --- a/Aaru.Images/Alcohol120/Alcohol120.cs +++ b/Aaru.Images/Alcohol120/Alcohol120.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing Alcohol 120% disk images + /// public sealed partial class Alcohol120 : IWritableOpticalImage { Footer _alcFooter; diff --git a/Aaru.Images/Alcohol120/Identify.cs b/Aaru.Images/Alcohol120/Identify.cs index 9bfc981e5..b5d0b54c3 100644 --- a/Aaru.Images/Alcohol120/Identify.cs +++ b/Aaru.Images/Alcohol120/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Alcohol120 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Alcohol120/Properties.cs b/Aaru.Images/Alcohol120/Properties.cs index ffb55b0cd..8a5b2a142 100644 --- a/Aaru.Images/Alcohol120/Properties.cs +++ b/Aaru.Images/Alcohol120/Properties.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class Alcohol120 { + /// public OpticalImageCapabilities OpticalCapabilities => OpticalImageCapabilities.CanStoreAudioTracks | OpticalImageCapabilities.CanStoreDataTracks | OpticalImageCapabilities.CanStoreSubchannelRw | @@ -54,15 +55,22 @@ namespace Aaru.DiscImages OpticalImageCapabilities.CanStoreRawData | OpticalImageCapabilities.CanStoreCookedData | OpticalImageCapabilities.CanStoreMultipleTracks; + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Alcohol 120% Media Descriptor Structure"; + /// public Guid Id => new Guid("A78FBEBA-0307-4915-BDE3-B8A3B57F843F"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Alcohol 120% Media Descriptor Structure"; + /// public List Partitions { get; private set; } + /// public List Tracks { get @@ -139,21 +147,27 @@ namespace Aaru.DiscImages } } + /// public List Sessions { get; private set; } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new[] { MediaTagType.CD_FullTOC, MediaTagType.DVD_BCA, MediaTagType.DVD_DMI, MediaTagType.DVD_PFI }; + /// public IEnumerable SupportedSectorTags => new[] { SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdSectorSubchannel }; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.BDR, MediaType.BDRE, MediaType.BDREXL, MediaType.BDROM, MediaType.UHDBD, MediaType.BDRXL, @@ -171,14 +185,18 @@ namespace Aaru.DiscImages MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".mds" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/Alcohol120/Read.cs b/Aaru.Images/Alcohol120/Read.cs index 902912393..77de0eef0 100644 --- a/Aaru.Images/Alcohol120/Read.cs +++ b/Aaru.Images/Alcohol120/Read.cs @@ -49,6 +49,7 @@ namespace Aaru.DiscImages { public sealed partial class Alcohol120 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -744,6 +745,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -785,15 +787,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in _offsetMap) @@ -811,6 +818,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in _offsetMap) @@ -828,6 +836,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { if(!_alcTracks.TryGetValue((int)track, out Track alcTrack) || @@ -958,6 +967,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags) @@ -1362,10 +1372,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in _offsetMap) @@ -1383,6 +1396,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(!_alcTracks.TryGetValue((int)track, out Track alcTrack) || @@ -1462,6 +1476,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(CommonTypes.Structs.Session session) { if(Sessions.Contains(session)) @@ -1470,6 +1485,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) { List tracks = new List(); diff --git a/Aaru.Images/Alcohol120/Verify.cs b/Aaru.Images/Alcohol120/Verify.cs index da45ae46d..6f218ad31 100644 --- a/Aaru.Images/Alcohol120/Verify.cs +++ b/Aaru.Images/Alcohol120/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Alcohol120 { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/Alcohol120/Write.cs b/Aaru.Images/Alcohol120/Write.cs index 027e70bf5..0521f2773 100644 --- a/Aaru.Images/Alcohol120/Write.cs +++ b/Aaru.Images/Alcohol120/Write.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class Alcohol120 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -138,6 +139,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(!IsWriting) @@ -200,6 +202,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -250,6 +253,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -332,6 +336,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -370,6 +375,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -418,6 +424,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetTracks(List tracks) { ulong currentDataOffset = 0; @@ -485,6 +492,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -1027,8 +1035,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { ErrorMessage = "Unsupported feature"; @@ -1036,6 +1046,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { if(!IsWriting) @@ -1103,6 +1114,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { if(!IsWriting) @@ -1161,8 +1173,10 @@ namespace Aaru.DiscImages } } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/Anex86/Anex86.cs b/Aaru.Images/Anex86/Anex86.cs index 6eb4c1060..e6637387f 100644 --- a/Aaru.Images/Anex86/Anex86.cs +++ b/Aaru.Images/Anex86/Anex86.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing Anex-86 disk images + /// public sealed partial class Anex86 : IWritableImage { IFilter _anexImageFilter; diff --git a/Aaru.Images/Anex86/Identify.cs b/Aaru.Images/Anex86/Identify.cs index c5570b558..c2020ed4d 100644 --- a/Aaru.Images/Anex86/Identify.cs +++ b/Aaru.Images/Anex86/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Anex86 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Anex86/Properties.cs b/Aaru.Images/Anex86/Properties.cs index 9a01f07ac..48d0beb1e 100644 --- a/Aaru.Images/Anex86/Properties.cs +++ b/Aaru.Images/Anex86/Properties.cs @@ -41,22 +41,32 @@ namespace Aaru.DiscImages { public sealed partial class Anex86 { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Anex86 Disk Image"; + /// public Guid Id => new Guid("0410003E-6E7B-40E6-9328-BA5651ADF6B7"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Anex86 disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.IBM23FD, MediaType.ECMA_66, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, @@ -72,15 +82,19 @@ namespace Aaru.DiscImages MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".fdi", ".hdi" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/Anex86/Read.cs b/Aaru.Images/Anex86/Read.cs index d6611de88..b25cc9153 100644 --- a/Aaru.Images/Anex86/Read.cs +++ b/Aaru.Images/Anex86/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class Anex86 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -80,8 +81,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/Anex86/Unsupported.cs b/Aaru.Images/Anex86/Unsupported.cs index 5501e91b0..26bec53a5 100644 --- a/Aaru.Images/Anex86/Unsupported.cs +++ b/Aaru.Images/Anex86/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Anex86 { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Anex86/Write.cs b/Aaru.Images/Anex86/Write.cs index 75aaef6a2..d54d09cbd 100644 --- a/Aaru.Images/Anex86/Write.cs +++ b/Aaru.Images/Anex86/Write.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class Anex86 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -100,6 +101,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -107,6 +109,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -138,6 +141,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -169,6 +173,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -176,6 +181,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -183,6 +189,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -237,8 +244,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > int.MaxValue) @@ -269,6 +278,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -276,6 +286,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -283,8 +294,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/Apple2MG/Apple2MG.cs b/Aaru.Images/Apple2MG/Apple2MG.cs index 93c2637c0..0854819eb 100644 --- a/Aaru.Images/Apple2MG/Apple2MG.cs +++ b/Aaru.Images/Apple2MG/Apple2MG.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing XGD emulator disk images + /// public sealed partial class Apple2Mg : IWritableImage { IFilter _a2MgImageFilter; diff --git a/Aaru.Images/Apple2MG/Identify.cs b/Aaru.Images/Apple2MG/Identify.cs index 4e8b035cd..f7b99d640 100644 --- a/Aaru.Images/Apple2MG/Identify.cs +++ b/Aaru.Images/Apple2MG/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Apple2Mg { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Apple2MG/Properties.cs b/Aaru.Images/Apple2MG/Properties.cs index cdcd01713..5dbb1d450 100644 --- a/Aaru.Images/Apple2MG/Properties.cs +++ b/Aaru.Images/Apple2MG/Properties.cs @@ -41,20 +41,30 @@ namespace Aaru.DiscImages { public sealed partial class Apple2Mg { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Apple 2IMG"; + /// public Guid Id => new Guid("CBAF8824-BA5F-415F-953A-19A03519B2D1"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Apple 2IMG"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Apple32SS, MediaType.Apple33SS, MediaType.AppleSonySS, MediaType.AppleSonyDS, MediaType.DOS_35_HD, @@ -62,14 +72,18 @@ namespace Aaru.DiscImages MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".2mg" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/Apple2MG/Read.cs b/Aaru.Images/Apple2MG/Read.cs index e19e432a6..760d25e3b 100644 --- a/Aaru.Images/Apple2MG/Read.cs +++ b/Aaru.Images/Apple2MG/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class Apple2Mg { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -300,8 +301,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/Apple2MG/Unsupported.cs b/Aaru.Images/Apple2MG/Unsupported.cs index 961c4e4c4..e27abde21 100644 --- a/Aaru.Images/Apple2MG/Unsupported.cs +++ b/Aaru.Images/Apple2MG/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Apple2Mg { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Apple2MG/Write.cs b/Aaru.Images/Apple2MG/Write.cs index 11a0f7287..f111ed01f 100644 --- a/Aaru.Images/Apple2MG/Write.cs +++ b/Aaru.Images/Apple2MG/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Apple2Mg { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -95,6 +96,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Unsupported feature"; @@ -102,6 +104,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -133,6 +136,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -164,6 +168,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -171,6 +176,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -178,6 +184,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -236,6 +243,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Comments = metadata.Comments; @@ -245,8 +253,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -254,6 +264,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -261,8 +272,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/AppleDOS/AppleDOS.cs b/Aaru.Images/AppleDOS/AppleDOS.cs index 669f43c3b..59c01561e 100644 --- a/Aaru.Images/AppleDOS/AppleDOS.cs +++ b/Aaru.Images/AppleDOS/AppleDOS.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing interleaved Apple DOS disk images + /// public sealed partial class AppleDos : IWritableImage { byte[] _deinterleaved; diff --git a/Aaru.Images/AppleDOS/Identify.cs b/Aaru.Images/AppleDOS/Identify.cs index c61e7fbf5..4e8ff48e8 100644 --- a/Aaru.Images/AppleDOS/Identify.cs +++ b/Aaru.Images/AppleDOS/Identify.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class AppleDos { + /// public bool Identify(IFilter imageFilter) { _extension = Path.GetExtension(imageFilter.GetFilename())?.ToLower(); diff --git a/Aaru.Images/AppleDOS/Properties.cs b/Aaru.Images/AppleDOS/Properties.cs index 48c1d16a6..a9a0b29f0 100644 --- a/Aaru.Images/AppleDOS/Properties.cs +++ b/Aaru.Images/AppleDOS/Properties.cs @@ -41,32 +41,46 @@ namespace Aaru.DiscImages { public sealed partial class AppleDos { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Apple ][ Interleaved Disk Image"; + /// public Guid Id => new Guid("A5828AC0-62C9-4304-81D4-EFD4AAE47360"); + /// public string Author => "Natalia Portillo"; + /// public string Format => _extension == ".po" ? "Apple ][ Interleaved Disk Image (ProDOS order)" : "Apple ][ Interleaved Disk Image (DOS order)"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Apple33SS }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".do", ".po" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/AppleDOS/Read.cs b/Aaru.Images/AppleDOS/Read.cs index ff60283ce..8ff8ef1f1 100644 --- a/Aaru.Images/AppleDOS/Read.cs +++ b/Aaru.Images/AppleDOS/Read.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class AppleDos { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -94,8 +95,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/AppleDOS/Unsupported.cs b/Aaru.Images/AppleDOS/Unsupported.cs index 274157c9f..15c5c9fa2 100644 --- a/Aaru.Images/AppleDOS/Unsupported.cs +++ b/Aaru.Images/AppleDOS/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class AppleDos { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/AppleDOS/Write.cs b/Aaru.Images/AppleDOS/Write.cs index 940688dc4..d9f734f5b 100644 --- a/Aaru.Images/AppleDOS/Write.cs +++ b/Aaru.Images/AppleDOS/Write.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class AppleDos { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -102,6 +103,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Unsupported feature"; @@ -109,8 +111,10 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) => WriteSectors(data, sectorAddress, 1); + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -141,6 +145,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -148,6 +153,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -155,6 +161,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -203,10 +210,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -214,6 +224,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -221,8 +232,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/AppleNIB/AppleNIB.cs b/Aaru.Images/AppleNIB/AppleNIB.cs index d886fcc5f..342491fd1 100644 --- a/Aaru.Images/AppleNIB/AppleNIB.cs +++ b/Aaru.Images/AppleNIB/AppleNIB.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // TODO: Checksum sectors + /// + /// Implements reading nibbelized Apple II disk images + /// public sealed partial class AppleNib : IMediaImage { Dictionary _addressFields; diff --git a/Aaru.Images/AppleNIB/Identify.cs b/Aaru.Images/AppleNIB/Identify.cs index 5631fdfbb..75542f967 100644 --- a/Aaru.Images/AppleNIB/Identify.cs +++ b/Aaru.Images/AppleNIB/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class AppleNib { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/AppleNIB/Properties.cs b/Aaru.Images/AppleNIB/Properties.cs index 3ef5cfcea..39e4c3909 100644 --- a/Aaru.Images/AppleNIB/Properties.cs +++ b/Aaru.Images/AppleNIB/Properties.cs @@ -39,13 +39,20 @@ namespace Aaru.DiscImages { public sealed partial class AppleNib { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Apple NIB"; + /// public Guid Id => new Guid("AE171AE8-6747-49CC-B861-9D450B7CD42E"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Apple nibbles"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/AppleNIB/Read.cs b/Aaru.Images/AppleNIB/Read.cs index 89af28907..4007aa923 100644 --- a/Aaru.Images/AppleNIB/Read.cs +++ b/Aaru.Images/AppleNIB/Read.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class AppleNib { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -172,6 +173,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -183,6 +185,7 @@ namespace Aaru.DiscImages return temp; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -203,6 +206,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -217,6 +221,7 @@ namespace Aaru.DiscImages return temp; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -240,6 +245,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadSectorLong(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -251,6 +257,7 @@ namespace Aaru.DiscImages return temp; } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/AppleNIB/Unsupported.cs b/Aaru.Images/AppleNIB/Unsupported.cs index f96713bc0..14141a062 100644 --- a/Aaru.Images/AppleNIB/Unsupported.cs +++ b/Aaru.Images/AppleNIB/Unsupported.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class AppleNib { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Apridisk/Apridisk.cs b/Aaru.Images/Apridisk/Apridisk.cs index 13def3eb1..1beb7e0b4 100644 --- a/Aaru.Images/Apridisk/Apridisk.cs +++ b/Aaru.Images/Apridisk/Apridisk.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // TODO: Check writing + /// + /// Implements reading and writing Apridisk disk images + /// public sealed partial class Apridisk : IWritableImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/Apridisk/Identify.cs b/Aaru.Images/Apridisk/Identify.cs index ae46d2c1b..b8168f740 100644 --- a/Aaru.Images/Apridisk/Identify.cs +++ b/Aaru.Images/Apridisk/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Apridisk { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Apridisk/Properties.cs b/Aaru.Images/Apridisk/Properties.cs index 6134ae904..7862cd6c5 100644 --- a/Aaru.Images/Apridisk/Properties.cs +++ b/Aaru.Images/Apridisk/Properties.cs @@ -41,22 +41,32 @@ namespace Aaru.DiscImages { public sealed partial class Apridisk { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "ACT Apricot Disk Image"; + /// public Guid Id => new Guid("43408CF3-6DB3-449F-A779-2B0E497C5B14"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "ACT Apricot disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.ACORN_35_DS_DD, MediaType.ACORN_35_DS_HD, MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, @@ -67,15 +77,19 @@ namespace Aaru.DiscImages MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { ("compress", typeof(bool), "Enable Apridisk compression.", (object)false) }; + /// public IEnumerable KnownExtensions => new[] { ".dsk" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/Apridisk/Read.cs b/Aaru.Images/Apridisk/Read.cs index bf255a74e..62bcb39ff 100644 --- a/Aaru.Images/Apridisk/Read.cs +++ b/Aaru.Images/Apridisk/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class Apridisk { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -229,6 +230,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { (ushort cylinder, byte head, byte sector) = LbaToChs(sectorAddress); @@ -245,6 +247,7 @@ namespace Aaru.DiscImages return _sectorsData[cylinder][head][sector]; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/Apridisk/Unsupported.cs b/Aaru.Images/Apridisk/Unsupported.cs index a75b45ff3..5e45dd617 100644 --- a/Aaru.Images/Apridisk/Unsupported.cs +++ b/Aaru.Images/Apridisk/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Apridisk { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Apridisk/Write.cs b/Aaru.Images/Apridisk/Write.cs index accc9266c..d1571dc26 100644 --- a/Aaru.Images/Apridisk/Write.cs +++ b/Aaru.Images/Apridisk/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Apridisk { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -79,6 +80,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -86,6 +88,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { (ushort cylinder, byte head, byte sector) = LbaToChs(sectorAddress); @@ -116,6 +119,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { for(uint i = 0; i < length; i++) @@ -149,6 +153,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -156,6 +161,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -164,6 +170,7 @@ namespace Aaru.DiscImages } // TODO: Try if apridisk software supports finding other chunks, to extend metadata support + /// public bool Close() { _writingStream.Seek(0, SeekOrigin.Begin); @@ -253,6 +260,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Comments = metadata.Comments; @@ -261,6 +269,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > ushort.MaxValue) @@ -301,6 +310,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -308,6 +318,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -315,8 +326,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/BLU/BLU.cs b/Aaru.Images/BLU/BLU.cs index 0b52df2a6..c5e67705d 100644 --- a/Aaru.Images/BLU/BLU.cs +++ b/Aaru.Images/BLU/BLU.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading Basic Lisa Utility disk images + /// public sealed partial class Blu : IWritableImage, IVerifiableSectorsImage { IFilter _bluImageFilter; diff --git a/Aaru.Images/BLU/Identify.cs b/Aaru.Images/BLU/Identify.cs index 10678b480..8ed037a50 100644 --- a/Aaru.Images/BLU/Identify.cs +++ b/Aaru.Images/BLU/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Blu { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/BLU/Properties.cs b/Aaru.Images/BLU/Properties.cs index 80c07d480..cc90e4ae8 100644 --- a/Aaru.Images/BLU/Properties.cs +++ b/Aaru.Images/BLU/Properties.cs @@ -41,33 +41,47 @@ namespace Aaru.DiscImages { public sealed partial class Blu { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Basic Lisa Utility"; + /// public Guid Id => new Guid("A153E2F8-4235-432D-9A7F-20807B0BCD74"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Basic Lisa Utility"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new[] { SectorTagType.AppleSectorTag }; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.AppleProfile, MediaType.AppleWidget, MediaType.PriamDataTower, MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".blu" }; // Just invented + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/BLU/Read.cs b/Aaru.Images/BLU/Read.cs index fab8a93d3..f7f15fc03 100644 --- a/Aaru.Images/BLU/Read.cs +++ b/Aaru.Images/BLU/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class Blu { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -151,10 +152,13 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -183,6 +187,7 @@ namespace Aaru.DiscImages return buffer.ToArray(); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(tag != SectorTagType.AppleSectorTag) @@ -217,8 +222,10 @@ namespace Aaru.DiscImages return buffer.ToArray(); } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/BLU/Unsupported.cs b/Aaru.Images/BLU/Unsupported.cs index 5f52a8464..fbc8b241b 100644 --- a/Aaru.Images/BLU/Unsupported.cs +++ b/Aaru.Images/BLU/Unsupported.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class Blu { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/BLU/Verify.cs b/Aaru.Images/BLU/Verify.cs index 532bc7915..b4c3faf4e 100644 --- a/Aaru.Images/BLU/Verify.cs +++ b/Aaru.Images/BLU/Verify.cs @@ -37,8 +37,10 @@ namespace Aaru.DiscImages public sealed partial class Blu { // TODO: Check tag checksums + /// public bool? VerifySector(ulong sectorAddress) => null; + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/BLU/Write.cs b/Aaru.Images/BLU/Write.cs index ef544d950..ae0ae7cf3 100644 --- a/Aaru.Images/BLU/Write.cs +++ b/Aaru.Images/BLU/Write.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class Blu { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -95,6 +96,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -102,6 +104,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { int longSectorSize = _imageInfo.MediaType == MediaType.PriamDataTower ? 536 : 532; @@ -135,6 +138,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { int longSectorSize = _imageInfo.MediaType == MediaType.PriamDataTower ? 536 : 532; @@ -168,6 +172,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -257,6 +262,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -362,6 +368,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -422,10 +429,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -433,6 +443,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -440,8 +451,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/BlindWrite4/BlindWrite4.cs b/Aaru.Images/BlindWrite4/BlindWrite4.cs index 7470fa1c7..7689be7c1 100644 --- a/Aaru.Images/BlindWrite4/BlindWrite4.cs +++ b/Aaru.Images/BlindWrite4/BlindWrite4.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // TODO: Too many unknowns, plus a completely unknown footer, to make this writable + /// + /// Implements reading BlindWrite 4 disc images + /// public sealed partial class BlindWrite4 : IOpticalMediaImage { List _bwTracks; diff --git a/Aaru.Images/BlindWrite4/Identify.cs b/Aaru.Images/BlindWrite4/Identify.cs index 81d91c0a9..13a8acb9c 100644 --- a/Aaru.Images/BlindWrite4/Identify.cs +++ b/Aaru.Images/BlindWrite4/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite4 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/BlindWrite4/Properties.cs b/Aaru.Images/BlindWrite4/Properties.cs index dcbf2ea21..2d79cfd89 100644 --- a/Aaru.Images/BlindWrite4/Properties.cs +++ b/Aaru.Images/BlindWrite4/Properties.cs @@ -40,19 +40,29 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite4 { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "BlindWrite 4"; + /// public Guid Id => new Guid("664568B2-15D4-4E64-8A7A-20BDA8B8386F"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "BlindWrite 4 TOC file"; + /// public List Partitions { get; set; } + /// public List Tracks { get; set; } + /// public List Sessions { get; set; } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/BlindWrite4/Read.cs b/Aaru.Images/BlindWrite4/Read.cs index 7e8329239..1809caa36 100644 --- a/Aaru.Images/BlindWrite4/Read.cs +++ b/Aaru.Images/BlindWrite4/Read.cs @@ -50,6 +50,7 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite4 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -809,6 +810,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -825,15 +827,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -845,6 +852,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -856,6 +864,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { var aaruTrack = new Track @@ -961,6 +970,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { var aaruTrack = new Track @@ -1162,10 +1172,13 @@ namespace Aaru.DiscImages return tag == SectorTagType.CdSectorSubchannel ? Subchannel.Interleave(buffer) : buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -1177,6 +1190,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { var aaruTrack = new Track @@ -1230,6 +1244,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(Sessions.Contains(session)) @@ -1238,6 +1253,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) => Tracks.Where(track => track.TrackSession == session).ToList(); } diff --git a/Aaru.Images/BlindWrite4/Verify.cs b/Aaru.Images/BlindWrite4/Verify.cs index 579b8fa94..e6c9d8838 100644 --- a/Aaru.Images/BlindWrite4/Verify.cs +++ b/Aaru.Images/BlindWrite4/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite4 { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/BlindWrite5/BlindWrite5.cs b/Aaru.Images/BlindWrite5/BlindWrite5.cs index e801944f7..952004f17 100644 --- a/Aaru.Images/BlindWrite5/BlindWrite5.cs +++ b/Aaru.Images/BlindWrite5/BlindWrite5.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // TODO: Too many unknowns to make this writable + /// + /// Implements reading BlindWrite 5/6/7 disc images + /// public sealed partial class BlindWrite5 : IOpticalMediaImage { byte[] _atip; diff --git a/Aaru.Images/BlindWrite5/Identify.cs b/Aaru.Images/BlindWrite5/Identify.cs index a54359702..a510f27cb 100644 --- a/Aaru.Images/BlindWrite5/Identify.cs +++ b/Aaru.Images/BlindWrite5/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite5 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/BlindWrite5/Properties.cs b/Aaru.Images/BlindWrite5/Properties.cs index e6ee684e9..ae330cc02 100644 --- a/Aaru.Images/BlindWrite5/Properties.cs +++ b/Aaru.Images/BlindWrite5/Properties.cs @@ -40,20 +40,30 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite5 { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "BlindWrite 5"; + /// public Guid Id => new Guid("9CB7A381-0509-4F9F-B801-3F65434BC3EE"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "BlindWrite 5 TOC file"; + /// public List Partitions { get; private set; } + /// public List Tracks { get; private set; } + /// public List Sessions { get; private set; } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/BlindWrite5/Read.cs b/Aaru.Images/BlindWrite5/Read.cs index 65615da10..f0b8aea3b 100644 --- a/Aaru.Images/BlindWrite5/Read.cs +++ b/Aaru.Images/BlindWrite5/Read.cs @@ -56,6 +56,7 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite5 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -1394,6 +1395,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -1460,15 +1462,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -1480,6 +1487,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -1491,6 +1499,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { // TODO: Cross data files @@ -1626,6 +1635,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { // TODO: Cross data files @@ -2115,10 +2125,13 @@ namespace Aaru.DiscImages }; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -2130,6 +2143,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { // TODO: Cross data files @@ -2233,6 +2247,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(Sessions.Contains(session)) @@ -2241,6 +2256,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) => Tracks.Where(aaruTrack => aaruTrack.TrackSession == session).ToList(); } diff --git a/Aaru.Images/BlindWrite5/Verify.cs b/Aaru.Images/BlindWrite5/Verify.cs index c49ffe6b4..1972a3f47 100644 --- a/Aaru.Images/BlindWrite5/Verify.cs +++ b/Aaru.Images/BlindWrite5/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class BlindWrite5 { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/CDRDAO/CDRDAO.cs b/Aaru.Images/CDRDAO/CDRDAO.cs index d778bf3d0..23786e707 100644 --- a/Aaru.Images/CDRDAO/CDRDAO.cs +++ b/Aaru.Images/CDRDAO/CDRDAO.cs @@ -41,6 +41,9 @@ namespace Aaru.DiscImages { // TODO: Doesn't support compositing from several files // TODO: Doesn't support silences that are not in files + /// + /// Implements reading and writing cdrdao cuesheet disc images + /// public sealed partial class Cdrdao : IWritableOpticalImage { IFilter _cdrdaoFilter; diff --git a/Aaru.Images/CDRDAO/Identify.cs b/Aaru.Images/CDRDAO/Identify.cs index 8344e0751..b71c5fdb6 100644 --- a/Aaru.Images/CDRDAO/Identify.cs +++ b/Aaru.Images/CDRDAO/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class Cdrdao { + /// public bool Identify(IFilter imageFilter) { try diff --git a/Aaru.Images/CDRDAO/Properties.cs b/Aaru.Images/CDRDAO/Properties.cs index 76a453c81..cd33aded4 100644 --- a/Aaru.Images/CDRDAO/Properties.cs +++ b/Aaru.Images/CDRDAO/Properties.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class Cdrdao { + /// public OpticalImageCapabilities OpticalCapabilities => OpticalImageCapabilities.CanStoreAudioTracks | OpticalImageCapabilities.CanStoreDataTracks | OpticalImageCapabilities.CanStorePregaps | @@ -53,13 +54,20 @@ namespace Aaru.DiscImages OpticalImageCapabilities.CanStoreCookedData | OpticalImageCapabilities.CanStoreMultipleTracks | OpticalImageCapabilities.CanStoreIndexes; + /// public ImageInfo Info => _imageInfo; + /// public string Name => "CDRDAO tocfile"; + /// public Guid Id => new Guid("04D7BA12-1BE8-44D4-97A4-1B48A505463E"); + /// public string Format => "CDRDAO tocfile"; + /// public string Author => "Natalia Portillo"; + /// public List Partitions { get; private set; } + /// public List Sessions { get @@ -81,6 +89,7 @@ namespace Aaru.DiscImages } } + /// public List Tracks { get @@ -151,14 +160,18 @@ namespace Aaru.DiscImages } } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; // TODO: Decode CD-Text to text + /// public IEnumerable SupportedMediaTags => new[] { MediaTagType.CD_MCN }; + /// public IEnumerable SupportedSectorTags => new[] { SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, @@ -166,6 +179,7 @@ namespace Aaru.DiscImages SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdTrackIsrc }; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, @@ -176,15 +190,19 @@ namespace Aaru.DiscImages MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { ("separate", typeof(bool), "Write each track to a separate file.", (object)false) }; + /// public IEnumerable KnownExtensions => new[] { ".toc" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/CDRDAO/Read.cs b/Aaru.Images/CDRDAO/Read.cs index 4c38a31f0..eed904dd1 100644 --- a/Aaru.Images/CDRDAO/Read.cs +++ b/Aaru.Images/CDRDAO/Read.cs @@ -49,6 +49,7 @@ namespace Aaru.DiscImages { public sealed partial class Cdrdao { + /// public bool Open(IFilter imageFilter) { if(imageFilter == null) @@ -879,6 +880,7 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -895,15 +897,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetmap where sectorAddress >= kvp.Value @@ -915,6 +922,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in from kvp in _offsetmap where sectorAddress >= kvp.Value @@ -926,6 +934,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { var aaruTrack = new CdrdaoTrack @@ -1064,6 +1073,7 @@ namespace Aaru.DiscImages return swapped; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags || @@ -1265,10 +1275,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetmap where sectorAddress >= kvp.Value @@ -1280,6 +1293,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { var aaruTrack = new CdrdaoTrack @@ -1470,8 +1484,10 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) => GetSessionTracks(session.SessionSequence); + /// public List GetSessionTracks(ushort session) { if(session == 1) diff --git a/Aaru.Images/CDRDAO/Verify.cs b/Aaru.Images/CDRDAO/Verify.cs index eab928996..199580a77 100644 --- a/Aaru.Images/CDRDAO/Verify.cs +++ b/Aaru.Images/CDRDAO/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Cdrdao { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { @@ -111,6 +114,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); diff --git a/Aaru.Images/CDRDAO/Write.cs b/Aaru.Images/CDRDAO/Write.cs index 9cae822ce..625f1e9eb 100644 --- a/Aaru.Images/CDRDAO/Write.cs +++ b/Aaru.Images/CDRDAO/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Cdrdao { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -114,6 +115,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(!IsWriting) @@ -136,6 +138,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -202,6 +205,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -300,6 +304,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -361,6 +366,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -432,6 +438,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetTracks(List tracks) { if(!IsWriting) @@ -502,6 +509,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -626,6 +634,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _discimage.Barcode = metadata.MediaBarcode; @@ -634,6 +643,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { ErrorMessage = "Unsupported feature"; @@ -641,6 +651,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { if(!IsWriting) @@ -725,6 +736,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { if(!IsWriting) @@ -794,8 +806,10 @@ namespace Aaru.DiscImages } } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/CDRWin/CDRWin.cs b/Aaru.Images/CDRWin/CDRWin.cs index e8fcf918f..86f66bc1f 100644 --- a/Aaru.Images/CDRWin/CDRWin.cs +++ b/Aaru.Images/CDRWin/CDRWin.cs @@ -40,6 +40,9 @@ using Aaru.Decoders.CD; namespace Aaru.DiscImages { // TODO: Implement track flags + /// + /// Implements reading and writing CDRWin cuesheet disc images + /// public sealed partial class CdrWin : IWritableOpticalImage, IVerifiableImage { IFilter _cdrwinFilter; diff --git a/Aaru.Images/CDRWin/Identify.cs b/Aaru.Images/CDRWin/Identify.cs index 19efb4ee9..21946f831 100644 --- a/Aaru.Images/CDRWin/Identify.cs +++ b/Aaru.Images/CDRWin/Identify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages public sealed partial class CdrWin { // Due to .cue format, this method must parse whole file, ignoring errors (those will be thrown by OpenImage()). + /// public bool Identify(IFilter imageFilter) { _cdrwinFilter = imageFilter; diff --git a/Aaru.Images/CDRWin/Properties.cs b/Aaru.Images/CDRWin/Properties.cs index fee3ccfff..5b6349dcd 100644 --- a/Aaru.Images/CDRWin/Properties.cs +++ b/Aaru.Images/CDRWin/Properties.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class CdrWin { + /// public OpticalImageCapabilities OpticalCapabilities => OpticalImageCapabilities.CanStoreAudioTracks | OpticalImageCapabilities.CanStoreDataTracks | OpticalImageCapabilities.CanStorePregaps | @@ -55,13 +56,20 @@ namespace Aaru.DiscImages OpticalImageCapabilities.CanStoreNotCdSessions | OpticalImageCapabilities.CanStoreNotCdTracks | OpticalImageCapabilities.CanStoreIndexes; + /// public ImageInfo Info => _imageInfo; + /// public string Name => "CDRWin cuesheet"; + /// public Guid Id => new Guid("664568B2-15D4-4E64-8A7A-20BDA8B8386F"); + /// public string Format => "CDRWin CUESheet"; + /// public string Author => "Natalia Portillo"; + /// public List Partitions { get; private set; } + /// public List Tracks { get @@ -145,19 +153,25 @@ namespace Aaru.DiscImages } } + /// public List Sessions => _discImage.Sessions; + /// public List DumpHardware { get; private set; } + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new[] { MediaTagType.CD_MCN, MediaTagType.CD_TEXT }; + /// public IEnumerable SupportedSectorTags => new[] { SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdTrackIsrc }; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.BDR, MediaType.BDRE, MediaType.BDREXL, MediaType.BDROM, MediaType.UHDBD, MediaType.BDRXL, @@ -175,15 +189,19 @@ namespace Aaru.DiscImages MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { ("separate", typeof(bool), "Write each track to a separate file.", (object)false) }; + /// public IEnumerable KnownExtensions => new[] { ".cue" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/CDRWin/Read.cs b/Aaru.Images/CDRWin/Read.cs index b5957cd4d..54bcd8b37 100644 --- a/Aaru.Images/CDRWin/Read.cs +++ b/Aaru.Images/CDRWin/Read.cs @@ -51,6 +51,7 @@ namespace Aaru.DiscImages { public sealed partial class CdrWin { + /// public bool Open(IFilter imageFilter) { if(imageFilter == null) @@ -1555,6 +1556,7 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -1580,15 +1582,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -1600,6 +1607,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags || @@ -1615,6 +1623,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { var aaruTrack = new CdrWinTrack @@ -1768,6 +1777,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags || @@ -2015,10 +2025,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -2030,6 +2043,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(!_isCd) @@ -2234,6 +2248,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(_discImage.Sessions.Contains(session)) @@ -2242,6 +2257,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) => Tracks.Where(t => t.TrackSession == session).OrderBy(t => t.TrackSequence).ToList(); } diff --git a/Aaru.Images/CDRWin/Verify.cs b/Aaru.Images/CDRWin/Verify.cs index 3575ee6df..1071dc47b 100644 --- a/Aaru.Images/CDRWin/Verify.cs +++ b/Aaru.Images/CDRWin/Verify.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class CdrWin { + /// public bool? VerifyMediaImage() { if(_discImage.DiscHashes.Count == 0) @@ -148,6 +149,7 @@ namespace Aaru.DiscImages return null; } + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -155,6 +157,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -188,6 +191,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { @@ -221,6 +225,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); diff --git a/Aaru.Images/CDRWin/Write.cs b/Aaru.Images/CDRWin/Write.cs index 58bf8b5e6..7747ef2e3 100644 --- a/Aaru.Images/CDRWin/Write.cs +++ b/Aaru.Images/CDRWin/Write.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class CdrWin { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -124,6 +125,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(!IsWriting) @@ -155,6 +157,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -207,6 +210,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -266,6 +270,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -311,6 +316,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -363,6 +369,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetTracks(List tracks) { if(!IsWriting) @@ -417,6 +424,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -593,6 +601,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { ErrorMessage = "Unsupported feature"; @@ -600,6 +609,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { if(!IsWriting) @@ -649,9 +659,11 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) => WriteSectorTag(data, sectorAddress, tag); + /// public bool SetDumpHardware(List dumpHardware) { DumpHardware = dumpHardware; @@ -659,8 +671,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; + /// public bool SetMetadata(ImageInfo metadata) { _discImage.Barcode = metadata.MediaBarcode; diff --git a/Aaru.Images/CHD/CHD.cs b/Aaru.Images/CHD/CHD.cs index 9aac2a4c7..f50316c48 100644 --- a/Aaru.Images/CHD/CHD.cs +++ b/Aaru.Images/CHD/CHD.cs @@ -42,6 +42,9 @@ using Aaru.Decoders.CD; namespace Aaru.DiscImages { // TODO: Implement PCMCIA support + /// + /// Implements reading MAME CHD disk images + /// [SuppressMessage("ReSharper", "NotAccessedField.Local")] public sealed partial class Chd : IOpticalMediaImage, IVerifiableImage { diff --git a/Aaru.Images/CHD/Identify.cs b/Aaru.Images/CHD/Identify.cs index dd70daf44..bfc578c93 100644 --- a/Aaru.Images/CHD/Identify.cs +++ b/Aaru.Images/CHD/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Chd { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/CHD/Properties.cs b/Aaru.Images/CHD/Properties.cs index 4b9c333d3..7a62ecc42 100644 --- a/Aaru.Images/CHD/Properties.cs +++ b/Aaru.Images/CHD/Properties.cs @@ -42,12 +42,18 @@ namespace Aaru.DiscImages { public sealed partial class Chd { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "MAME Compressed Hunks of Data"; + /// public Guid Id => new Guid("0D50233A-08BD-47D4-988B-27EAA0358597"); + /// public string Format => "Compressed Hunks of Data"; + /// public string Author => "Natalia Portillo"; + /// public List Partitions { get @@ -60,6 +66,7 @@ namespace Aaru.DiscImages } } + /// public List Tracks { get @@ -72,6 +79,7 @@ namespace Aaru.DiscImages } } + /// public List Sessions { get @@ -84,7 +92,9 @@ namespace Aaru.DiscImages } } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/CHD/Read.cs b/Aaru.Images/CHD/Read.cs index a3ab0d6e3..09550ca1e 100644 --- a/Aaru.Images/CHD/Read.cs +++ b/Aaru.Images/CHD/Read.cs @@ -52,6 +52,7 @@ namespace Aaru.DiscImages { public sealed partial class Chd { + /// [SuppressMessage("ReSharper", "UnusedVariable")] public bool Open(IFilter imageFilter) { @@ -1242,6 +1243,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -1368,6 +1370,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) { if(_isHdd) @@ -1623,6 +1626,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -1644,6 +1648,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -1665,6 +1670,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadSectorLong(ulong sectorAddress) { if(_isHdd) @@ -1760,6 +1766,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -1781,6 +1788,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadDiskTag(MediaTagType tag) { if(_imageInfo.ReadableMediaTags.Contains(MediaTagType.ATA_IDENTIFY)) @@ -1792,6 +1800,7 @@ namespace Aaru.DiscImages throw new FeatureUnsupportedImageException("Feature not supported by image format"); } + /// public List GetSessionTracks(Session session) { if(_isHdd) @@ -1800,6 +1809,7 @@ namespace Aaru.DiscImages return GetSessionTracks(session.SessionSequence); } + /// public List GetSessionTracks(ushort session) { if(_isHdd) @@ -1808,6 +1818,7 @@ namespace Aaru.DiscImages return _tracks.Values.Where(track => track.TrackSession == session).ToList(); } + /// public byte[] ReadSector(ulong sectorAddress, uint track) { if(_isHdd) @@ -1816,6 +1827,7 @@ namespace Aaru.DiscImages return ReadSector(GetAbsoluteSector(sectorAddress, track)); } + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) { if(_isHdd) @@ -1824,6 +1836,7 @@ namespace Aaru.DiscImages return ReadSectorTag(GetAbsoluteSector(sectorAddress, track), tag); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { if(_isHdd) @@ -1832,6 +1845,7 @@ namespace Aaru.DiscImages return ReadSectors(GetAbsoluteSector(sectorAddress, track), length); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(_isHdd) @@ -1840,6 +1854,7 @@ namespace Aaru.DiscImages return ReadSectorsTag(GetAbsoluteSector(sectorAddress, track), length, tag); } + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) { if(_isHdd) @@ -1848,6 +1863,7 @@ namespace Aaru.DiscImages return ReadSectorLong(GetAbsoluteSector(sectorAddress, track)); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(_isHdd) diff --git a/Aaru.Images/CHD/Verify.cs b/Aaru.Images/CHD/Verify.cs index d2cf46fa2..0bbb707c8 100644 --- a/Aaru.Images/CHD/Verify.cs +++ b/Aaru.Images/CHD/Verify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class Chd { + /// public bool? VerifySector(ulong sectorAddress) { if(_isHdd) @@ -50,6 +51,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -87,6 +89,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { @@ -124,6 +127,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifyMediaImage() { byte[] calculated; @@ -150,6 +154,7 @@ namespace Aaru.DiscImages return _expectedChecksum.SequenceEqual(calculated); } + /// public bool? VerifySector(ulong sectorAddress, uint track) { if(_isHdd) diff --git a/Aaru.Images/CPCDSK/CPCDSK.cs b/Aaru.Images/CPCDSK/CPCDSK.cs index 3cec777ff..9be913dc3 100644 --- a/Aaru.Images/CPCDSK/CPCDSK.cs +++ b/Aaru.Images/CPCDSK/CPCDSK.cs @@ -37,6 +37,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading CPCDSK disk images + /// public sealed partial class Cpcdsk : IMediaImage { Dictionary _addressMarks; diff --git a/Aaru.Images/CPCDSK/Identify.cs b/Aaru.Images/CPCDSK/Identify.cs index eb790c251..03c83d4cd 100644 --- a/Aaru.Images/CPCDSK/Identify.cs +++ b/Aaru.Images/CPCDSK/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class Cpcdsk { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/CPCDSK/Properties.cs b/Aaru.Images/CPCDSK/Properties.cs index 7d18e9d39..ef8ccab1e 100644 --- a/Aaru.Images/CPCDSK/Properties.cs +++ b/Aaru.Images/CPCDSK/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class Cpcdsk { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "CPCEMU Disk-File and Extended CPC Disk-File"; + /// public Guid Id => new Guid("724B16CC-ADB9-492E-BA07-CAEEC1012B16"); + /// public string Format => _extended ? "CPCEMU Extended disk image" : "CPCEMU disk image"; + /// public string Author => "Natalia Portillo"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/CPCDSK/Read.cs b/Aaru.Images/CPCDSK/Read.cs index 3421e7456..0aa0597f5 100644 --- a/Aaru.Images/CPCDSK/Read.cs +++ b/Aaru.Images/CPCDSK/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class Cpcdsk { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -287,6 +288,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(_sectors.TryGetValue(sectorAddress, out byte[] sector)) @@ -295,6 +297,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -315,6 +318,7 @@ namespace Aaru.DiscImages return ms.ToArray(); } + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) { if(tag != SectorTagType.FloppyAddressMark) @@ -326,6 +330,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(tag != SectorTagType.FloppyAddressMark) diff --git a/Aaru.Images/CPCDSK/Unsupported.cs b/Aaru.Images/CPCDSK/Unsupported.cs index 4cd4d689a..25683fa37 100644 --- a/Aaru.Images/CPCDSK/Unsupported.cs +++ b/Aaru.Images/CPCDSK/Unsupported.cs @@ -37,12 +37,15 @@ namespace Aaru.DiscImages { public sealed partial class Cpcdsk { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/CisCopy/CisCopy.cs b/Aaru.Images/CisCopy/CisCopy.cs index 70fc6ca5d..15b12ec0c 100644 --- a/Aaru.Images/CisCopy/CisCopy.cs +++ b/Aaru.Images/CisCopy/CisCopy.cs @@ -53,6 +53,9 @@ namespace Aaru.DiscImages * 2) High compression, algorithm unknown * Then the data for whole tracks follow. */ + /// + /// Implements reading and writing CisCopy disk images + /// public sealed partial class CisCopy : IWritableImage { byte[] _decodedDisk; diff --git a/Aaru.Images/CisCopy/Identify.cs b/Aaru.Images/CisCopy/Identify.cs index a2c7490f9..6a460724e 100644 --- a/Aaru.Images/CisCopy/Identify.cs +++ b/Aaru.Images/CisCopy/Identify.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class CisCopy { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/CisCopy/Properties.cs b/Aaru.Images/CisCopy/Properties.cs index 2fce7f519..25dd4d135 100644 --- a/Aaru.Images/CisCopy/Properties.cs +++ b/Aaru.Images/CisCopy/Properties.cs @@ -41,32 +41,46 @@ namespace Aaru.DiscImages { public sealed partial class CisCopy { + /// public string Name => "CisCopy Disk Image (DC-File)"; + /// public Guid Id => new Guid("EDF20CC7-6012-49E2-9E92-663A53E42130"); + /// public string Format => "CisCopy"; + /// public string Author => "Natalia Portillo"; + /// public ImageInfo Info => _imageInfo; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".dcf" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/CisCopy/Read.cs b/Aaru.Images/CisCopy/Read.cs index 5d4a0de09..228c2f2f2 100644 --- a/Aaru.Images/CisCopy/Read.cs +++ b/Aaru.Images/CisCopy/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class CisCopy { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -199,8 +200,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/CisCopy/Unsupported.cs b/Aaru.Images/CisCopy/Unsupported.cs index b60c609da..2cba94ce1 100644 --- a/Aaru.Images/CisCopy/Unsupported.cs +++ b/Aaru.Images/CisCopy/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class CisCopy { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/CisCopy/Write.cs b/Aaru.Images/CisCopy/Write.cs index 3f1d20a02..1b3757b0d 100644 --- a/Aaru.Images/CisCopy/Write.cs +++ b/Aaru.Images/CisCopy/Write.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class CisCopy { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -159,6 +160,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -166,6 +168,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -197,6 +200,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -228,6 +232,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -235,6 +240,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -242,6 +248,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -260,10 +267,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -271,6 +281,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -278,8 +289,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/CloneCD/CloneCD.cs b/Aaru.Images/CloneCD/CloneCD.cs index 0cd9f9115..6b2d849dd 100644 --- a/Aaru.Images/CloneCD/CloneCD.cs +++ b/Aaru.Images/CloneCD/CloneCD.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // TODO: CloneCD stores subchannel deinterleaved + /// + /// Implements reading and writing CloneCD disc images + /// public sealed partial class CloneCd : IWritableOpticalImage { string _catalog; // TODO: Use it diff --git a/Aaru.Images/CloneCD/Identify.cs b/Aaru.Images/CloneCD/Identify.cs index 0a505d424..2cf3a70c3 100644 --- a/Aaru.Images/CloneCD/Identify.cs +++ b/Aaru.Images/CloneCD/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class CloneCd { + /// public bool Identify(IFilter imageFilter) { _ccdFilter = imageFilter; diff --git a/Aaru.Images/CloneCD/Properties.cs b/Aaru.Images/CloneCD/Properties.cs index 7fb7fefab..74e4c9430 100644 --- a/Aaru.Images/CloneCD/Properties.cs +++ b/Aaru.Images/CloneCD/Properties.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class CloneCd { + /// public OpticalImageCapabilities OpticalCapabilities => OpticalImageCapabilities.CanStoreAudioTracks | OpticalImageCapabilities.CanStoreDataTracks | OpticalImageCapabilities.CanStorePregaps | @@ -54,26 +55,39 @@ namespace Aaru.DiscImages OpticalImageCapabilities.CanStoreRawData | OpticalImageCapabilities.CanStoreCookedData | OpticalImageCapabilities.CanStoreMultipleTracks; + /// public ImageInfo Info => _imageInfo; + /// public string Name => "CloneCD"; + /// public Guid Id => new Guid("EE9C2975-2E79-427A-8EE9-F86F19165784"); + /// public string Format => "CloneCD"; + /// public string Author => "Natalia Portillo"; + /// public List Partitions { get; private set; } + /// public List Tracks { get; private set; } + /// public List Sessions { get; private set; } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new[] { MediaTagType.CD_MCN, MediaTagType.CD_FullTOC }; + /// public IEnumerable SupportedSectorTags => new[] { SectorTagType.CdSectorEcc, SectorTagType.CdSectorEccP, SectorTagType.CdSectorEccQ, SectorTagType.CdSectorEdc, SectorTagType.CdSectorHeader, SectorTagType.CdSectorSubHeader, SectorTagType.CdSectorSync, SectorTagType.CdTrackFlags, SectorTagType.CdSectorSubchannel }; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.CD, MediaType.CDDA, MediaType.CDEG, MediaType.CDG, MediaType.CDI, MediaType.CDMIDI, @@ -84,14 +98,18 @@ namespace Aaru.DiscImages MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS, MediaType.MilCD, MediaType.VideoNow, MediaType.VideoNowColor, MediaType.VideoNowXp, MediaType.CVD, MediaType.PCD }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".ccd" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/CloneCD/Read.cs b/Aaru.Images/CloneCD/Read.cs index c326da5d1..ca7c8d675 100644 --- a/Aaru.Images/CloneCD/Read.cs +++ b/Aaru.Images/CloneCD/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class CloneCd { + /// public bool Open(IFilter imageFilter) { if(imageFilter == null) @@ -900,6 +901,7 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -918,15 +920,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -938,6 +945,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in _offsetMap.Where(kvp => sectorAddress >= kvp.Value). @@ -955,6 +963,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { var aaruTrack = new Track @@ -1052,6 +1061,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags) @@ -1327,10 +1337,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -1342,6 +1355,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { var aaruTrack = new Track @@ -1371,6 +1385,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(Sessions.Contains(session)) @@ -1379,6 +1394,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) => Tracks.Where(track => track.TrackSession == session).ToList(); } diff --git a/Aaru.Images/CloneCD/Verify.cs b/Aaru.Images/CloneCD/Verify.cs index 5e7de0623..a00b0bc92 100644 --- a/Aaru.Images/CloneCD/Verify.cs +++ b/Aaru.Images/CloneCD/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class CloneCd { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { @@ -111,6 +114,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); diff --git a/Aaru.Images/CloneCD/Write.cs b/Aaru.Images/CloneCD/Write.cs index 7975f8beb..3f982d9f8 100644 --- a/Aaru.Images/CloneCD/Write.cs +++ b/Aaru.Images/CloneCD/Write.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class CloneCd { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -91,6 +92,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(!IsWriting) @@ -117,6 +119,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -132,6 +135,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -147,6 +151,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -183,6 +188,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -226,6 +232,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetTracks(List tracks) { ulong currentDataOffset = 0; @@ -282,6 +289,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -399,8 +407,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { ErrorMessage = "Unsupported feature"; @@ -408,6 +418,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { if(!IsWriting) @@ -488,6 +499,7 @@ namespace Aaru.DiscImages } } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { if(!IsWriting) @@ -557,8 +569,10 @@ namespace Aaru.DiscImages } } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/CopyQM/CopyQM.cs b/Aaru.Images/CopyQM/CopyQM.cs index 543959658..2dd0c4267 100644 --- a/Aaru.Images/CopyQM/CopyQM.cs +++ b/Aaru.Images/CopyQM/CopyQM.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading CopyQM disk images + /// public sealed partial class CopyQm : IMediaImage, IVerifiableImage { uint _calculatedDataCrc; diff --git a/Aaru.Images/CopyQM/Identify.cs b/Aaru.Images/CopyQM/Identify.cs index b3ba79be2..b3a1a3e67 100644 --- a/Aaru.Images/CopyQM/Identify.cs +++ b/Aaru.Images/CopyQM/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class CopyQm { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/CopyQM/Properties.cs b/Aaru.Images/CopyQM/Properties.cs index 57bc7c3c9..d06c8a4e4 100644 --- a/Aaru.Images/CopyQM/Properties.cs +++ b/Aaru.Images/CopyQM/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class CopyQm { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Sydex CopyQM"; + /// public Guid Id => new Guid("147E927D-3A92-4E0C-82CD-142F5A4FA76D"); + /// public string Format => "Sydex CopyQM"; + /// public string Author => "Natalia Portillo"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/CopyQM/Read.cs b/Aaru.Images/CopyQM/Read.cs index 625e3036d..bbc42d999 100644 --- a/Aaru.Images/CopyQM/Read.cs +++ b/Aaru.Images/CopyQM/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class CopyQm { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -194,8 +195,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -212,6 +215,7 @@ namespace Aaru.DiscImages return buffer; } + /// public bool? VerifyMediaImage() => _calculatedDataCrc == _header.crc && _headerChecksumOk; } } \ No newline at end of file diff --git a/Aaru.Images/CopyQM/Unsupported.cs b/Aaru.Images/CopyQM/Unsupported.cs index a6c4a6ba0..fbf1749e6 100644 --- a/Aaru.Images/CopyQM/Unsupported.cs +++ b/Aaru.Images/CopyQM/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class CopyQm { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/CopyTape/CopyTape.cs b/Aaru.Images/CopyTape/CopyTape.cs index 79bcbd110..f88abbd2d 100644 --- a/Aaru.Images/CopyTape/CopyTape.cs +++ b/Aaru.Images/CopyTape/CopyTape.cs @@ -6,6 +6,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing copytape tape images + /// public sealed partial class CopyTape : IWritableTapeImage { long[] _blockPositionCache; diff --git a/Aaru.Images/CopyTape/Identify.cs b/Aaru.Images/CopyTape/Identify.cs index 92b1c10fc..84d00ed47 100644 --- a/Aaru.Images/CopyTape/Identify.cs +++ b/Aaru.Images/CopyTape/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class CopyTape { + /// public bool Identify(IFilter imageFilter) { if(imageFilter.GetDataForkLength() <= 16) diff --git a/Aaru.Images/CopyTape/Properties.cs b/Aaru.Images/CopyTape/Properties.cs index 51458da4c..77fb0c4a1 100644 --- a/Aaru.Images/CopyTape/Properties.cs +++ b/Aaru.Images/CopyTape/Properties.cs @@ -41,21 +41,34 @@ namespace Aaru.DiscImages { public sealed partial class CopyTape { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "CopyTape"; + /// public Guid Id => new Guid("C537D41E-D6A7-4922-9AA9-8E8442D0E340"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "CopyTape"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public List Files { get; private set; } + /// public List TapePartitions { get; private set; } + /// public bool IsTape { get; set; } + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.UnknownTape, MediaType.ADR2120, MediaType.ADR260, MediaType.ADR30, MediaType.ADR50, @@ -84,15 +97,19 @@ namespace Aaru.DiscImages MediaType.Travan, MediaType.Travan1Ex, MediaType.Travan3, MediaType.Travan3Ex, MediaType.Travan4, MediaType.Travan5, MediaType.Travan7, MediaType.VXA1, MediaType.VXA2, MediaType.VXA3 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".cptp" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/CopyTape/Read.cs b/Aaru.Images/CopyTape/Read.cs index 38ee9c8ac..f33fe67d4 100644 --- a/Aaru.Images/CopyTape/Read.cs +++ b/Aaru.Images/CopyTape/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class CopyTape { + /// public bool Open(IFilter imageFilter) { List blockPositions = new List(); @@ -163,6 +164,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress >= (ulong)_blockPositionCache.LongLength) @@ -203,6 +205,7 @@ namespace Aaru.DiscImages return data; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { var dataMs = new MemoryStream(); diff --git a/Aaru.Images/CopyTape/Unsupported.cs b/Aaru.Images/CopyTape/Unsupported.cs index 1881541be..0f2d43bdd 100644 --- a/Aaru.Images/CopyTape/Unsupported.cs +++ b/Aaru.Images/CopyTape/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class CopyTape { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/CopyTape/Write.cs b/Aaru.Images/CopyTape/Write.cs index 65c8e8602..57e1051b7 100644 --- a/Aaru.Images/CopyTape/Write.cs +++ b/Aaru.Images/CopyTape/Write.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages ulong _lastWrittenBlock; Dictionary _writtenBlockPositions; + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -86,6 +87,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Unsupported feature"; @@ -93,6 +95,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!_writtenBlockPositions.TryGetValue(sectorAddress, out ulong position)) @@ -132,6 +135,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { for(uint i = 0; i < length; i++) @@ -145,6 +149,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Unsupported feature"; @@ -152,6 +157,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Unsupported feature"; @@ -159,6 +165,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -179,8 +186,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { ErrorMessage = "Unsupported feature"; @@ -188,6 +197,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -195,6 +205,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -202,10 +213,13 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; + /// public bool AddFile(TapeFile file) { if(file.Partition != 0) @@ -222,6 +236,7 @@ namespace Aaru.DiscImages return true; } + /// public bool AddPartition(TapePartition partition) { if(partition.Number == 0) @@ -232,6 +247,7 @@ namespace Aaru.DiscImages return false; } + /// public bool SetTape() { IsTape = true; diff --git a/Aaru.Images/D88/D88.cs b/Aaru.Images/D88/D88.cs index 35fc58dbd..15eca6326 100644 --- a/Aaru.Images/D88/D88.cs +++ b/Aaru.Images/D88/D88.cs @@ -40,6 +40,9 @@ namespace Aaru.DiscImages // Information from Quasi88's FORMAT.TXT file // Japanese comments copied from there // TODO: Solve media types + /// + /// Implements reading Quasi88 disk images + /// public sealed partial class D88 : IMediaImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/D88/Identify.cs b/Aaru.Images/D88/Identify.cs index 91de8963c..8be98449e 100644 --- a/Aaru.Images/D88/Identify.cs +++ b/Aaru.Images/D88/Identify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class D88 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/D88/Properties.cs b/Aaru.Images/D88/Properties.cs index b51320525..e80e5b8da 100644 --- a/Aaru.Images/D88/Properties.cs +++ b/Aaru.Images/D88/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class D88 { + /// public string Name => "D88 Disk Image"; + /// public Guid Id => new Guid("669EDC77-EC41-4720-A88C-49C38CFFBAA0"); + /// public ImageInfo Info => _imageInfo; + /// public string Format => "D88 disk image"; + /// public string Author => "Natalia Portillo"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/D88/Read.cs b/Aaru.Images/D88/Read.cs index 9d7c2c7a1..01701c5b9 100644 --- a/Aaru.Images/D88/Read.cs +++ b/Aaru.Images/D88/Read.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class D88 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -364,8 +365,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/D88/Unsupported.cs b/Aaru.Images/D88/Unsupported.cs index d15ac55ec..987c1a679 100644 --- a/Aaru.Images/D88/Unsupported.cs +++ b/Aaru.Images/D88/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class D88 { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/DART/DART.cs b/Aaru.Images/DART/DART.cs index e9bd8dc41..fa19d954c 100644 --- a/Aaru.Images/DART/DART.cs +++ b/Aaru.Images/DART/DART.cs @@ -37,6 +37,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading Apple DART disk images + /// public sealed partial class Dart : IMediaImage { // DART images are at most 1474560 bytes, so let's cache the whole diff --git a/Aaru.Images/DART/Identify.cs b/Aaru.Images/DART/Identify.cs index 6a9210729..caa291444 100644 --- a/Aaru.Images/DART/Identify.cs +++ b/Aaru.Images/DART/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Dart { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/DART/Properties.cs b/Aaru.Images/DART/Properties.cs index 19a022c57..6f37a4644 100644 --- a/Aaru.Images/DART/Properties.cs +++ b/Aaru.Images/DART/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class Dart { + /// public string Name => "Apple Disk Archival/Retrieval Tool"; + /// public Guid Id => new Guid("B3E06BF8-F98D-4F9B-BBE2-342C373BAF3E"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "Apple Disk Archival/Retrieval Tool"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/DART/Read.cs b/Aaru.Images/DART/Read.cs index 5dc57909c..ff9c2b97b 100644 --- a/Aaru.Images/DART/Read.cs +++ b/Aaru.Images/DART/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class Dart { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -322,10 +323,13 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -342,6 +346,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(tag != SectorTagType.AppleSectorTag) @@ -364,8 +369,10 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/DART/Unsupported.cs b/Aaru.Images/DART/Unsupported.cs index c3c044a31..1856f8129 100644 --- a/Aaru.Images/DART/Unsupported.cs +++ b/Aaru.Images/DART/Unsupported.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class Dart { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/DIM/DIM.cs b/Aaru.Images/DIM/DIM.cs index 1fa1dbe1c..1af11f90a 100644 --- a/Aaru.Images/DIM/DIM.cs +++ b/Aaru.Images/DIM/DIM.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // TODO: What are the real supported floppies for this image format? + /// + /// Implements reading DIM disk images + /// public sealed partial class Dim : IMediaImage { byte[] _comment; diff --git a/Aaru.Images/DIM/Identify.cs b/Aaru.Images/DIM/Identify.cs index be375a564..96c8c6c77 100644 --- a/Aaru.Images/DIM/Identify.cs +++ b/Aaru.Images/DIM/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Dim { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/DIM/Properties.cs b/Aaru.Images/DIM/Properties.cs index ed351e296..61f70d974 100644 --- a/Aaru.Images/DIM/Properties.cs +++ b/Aaru.Images/DIM/Properties.cs @@ -47,12 +47,19 @@ namespace Aaru.DiscImages throw new FeatureUnsupportedImageException("Feature not supported by image format"); public List Sessions => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public string Name => "DIM Disk Image"; + /// public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "DIM disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/DIM/Read.cs b/Aaru.Images/DIM/Read.cs index 619a13e54..92d587e5a 100644 --- a/Aaru.Images/DIM/Read.cs +++ b/Aaru.Images/DIM/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class Dim { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -240,8 +241,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/DIM/Unsupported.cs b/Aaru.Images/DIM/Unsupported.cs index af231e085..dc29fc664 100644 --- a/Aaru.Images/DIM/Unsupported.cs +++ b/Aaru.Images/DIM/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Dim { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/DiscFerret/DiscFerret.cs b/Aaru.Images/DiscFerret/DiscFerret.cs index 91236ec02..5c9383cad 100644 --- a/Aaru.Images/DiscFerret/DiscFerret.cs +++ b/Aaru.Images/DiscFerret/DiscFerret.cs @@ -37,6 +37,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading DiscFerret flux images + /// public sealed partial class DiscFerret : IMediaImage, IVerifiableSectorsImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/DiscFerret/Identify.cs b/Aaru.Images/DiscFerret/Identify.cs index dcef45846..cf16e8ccd 100644 --- a/Aaru.Images/DiscFerret/Identify.cs +++ b/Aaru.Images/DiscFerret/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class DiscFerret { + /// public bool Identify(IFilter imageFilter) { byte[] magicB = new byte[4]; diff --git a/Aaru.Images/DiscFerret/Properties.cs b/Aaru.Images/DiscFerret/Properties.cs index acfa95d98..b40db2213 100644 --- a/Aaru.Images/DiscFerret/Properties.cs +++ b/Aaru.Images/DiscFerret/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class DiscFerret { + /// public string Name => "DiscFerret"; + /// public Guid Id => new Guid("70EA7B9B-5323-42EB-9B40-8DDA37C5EB4D"); + /// public ImageInfo Info => _imageInfo; + /// public string Format => "DiscFerret"; + /// public string Author => "Natalia Portillo"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/DiscFerret/Read.cs b/Aaru.Images/DiscFerret/Read.cs index 6e11a96cb..b23a0f48a 100644 --- a/Aaru.Images/DiscFerret/Read.cs +++ b/Aaru.Images/DiscFerret/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class DiscFerret { + /// public bool Open(IFilter imageFilter) { byte[] magicB = new byte[4]; @@ -123,23 +124,30 @@ namespace Aaru.DiscImages throw new NotImplementedException("Flux decoding is not yet implemented."); } + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); } diff --git a/Aaru.Images/DiscFerret/Verify.cs b/Aaru.Images/DiscFerret/Verify.cs index c53f51798..dac735373 100644 --- a/Aaru.Images/DiscFerret/Verify.cs +++ b/Aaru.Images/DiscFerret/Verify.cs @@ -37,9 +37,11 @@ namespace Aaru.DiscImages { public sealed partial class DiscFerret { + /// public bool? VerifySector(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) => throw new NotImplementedException("Flux decoding is not yet implemented."); diff --git a/Aaru.Images/DiscJuggler/DiscJuggler.cs b/Aaru.Images/DiscJuggler/DiscJuggler.cs index 6e6c1f75a..d4d817fae 100644 --- a/Aaru.Images/DiscJuggler/DiscJuggler.cs +++ b/Aaru.Images/DiscJuggler/DiscJuggler.cs @@ -41,6 +41,9 @@ namespace Aaru.DiscImages { // Support separate data files? Never seen a DiscJuggler image using them anyways... // TODO: Too many unknowns to make this writable + /// + /// Implements reading DiscJuggler disc images + /// public sealed partial class DiscJuggler : IOpticalMediaImage { byte[] _cdtext; diff --git a/Aaru.Images/DiscJuggler/Identify.cs b/Aaru.Images/DiscJuggler/Identify.cs index 6f5a16ac6..afd2a29d3 100644 --- a/Aaru.Images/DiscJuggler/Identify.cs +++ b/Aaru.Images/DiscJuggler/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class DiscJuggler { + /// public bool Identify(IFilter imageFilter) { _imageStream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/DiscJuggler/Properties.cs b/Aaru.Images/DiscJuggler/Properties.cs index e797ab139..7af2fac6b 100644 --- a/Aaru.Images/DiscJuggler/Properties.cs +++ b/Aaru.Images/DiscJuggler/Properties.cs @@ -40,15 +40,25 @@ namespace Aaru.DiscImages { public sealed partial class DiscJuggler { + /// public string Name => "DiscJuggler"; + /// public Guid Id => new Guid("2444DBC6-CD35-424C-A227-39B0C4DB01B2"); + /// public ImageInfo Info => _imageInfo; + /// public string Format => "DiscJuggler"; + /// public string Author => "Natalia Portillo"; + /// public List Partitions { get; private set; } + /// public List Tracks { get; private set; } + /// public List Sessions { get; private set; } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/DiscJuggler/Read.cs b/Aaru.Images/DiscJuggler/Read.cs index b37c4e777..92151a532 100644 --- a/Aaru.Images/DiscJuggler/Read.cs +++ b/Aaru.Images/DiscJuggler/Read.cs @@ -49,6 +49,7 @@ namespace Aaru.DiscImages { public sealed partial class DiscJuggler { + /// public bool Open(IFilter imageFilter) { _imageStream = imageFilter.GetDataForkStream(); @@ -791,6 +792,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -808,15 +810,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -828,6 +835,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -839,6 +847,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { var aaruTrack = new Track @@ -961,6 +970,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags) @@ -1225,10 +1235,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -1240,6 +1253,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(!_isCd) @@ -1342,6 +1356,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(Sessions.Contains(session)) @@ -1350,6 +1365,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) => Tracks.Where(track => track.TrackSession == session).ToList(); } diff --git a/Aaru.Images/DiscJuggler/Verify.cs b/Aaru.Images/DiscJuggler/Verify.cs index edfa40b5d..6c2e8c15c 100644 --- a/Aaru.Images/DiscJuggler/Verify.cs +++ b/Aaru.Images/DiscJuggler/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class DiscJuggler { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { @@ -111,6 +114,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); diff --git a/Aaru.Images/DiskCopy42/DiskCopy42.cs b/Aaru.Images/DiskCopy42/DiskCopy42.cs index 109765004..709cd27c2 100644 --- a/Aaru.Images/DiskCopy42/DiskCopy42.cs +++ b/Aaru.Images/DiskCopy42/DiskCopy42.cs @@ -40,6 +40,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // Checked using several images and strings inside Apple's DiskImages.framework + /// + /// Implements reading and writing Apple DiskCopy 4.2 disk images + /// [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed partial class DiskCopy42 : IWritableImage, IVerifiableImage { diff --git a/Aaru.Images/DiskCopy42/Identify.cs b/Aaru.Images/DiskCopy42/Identify.cs index d10587b27..a8082ebed 100644 --- a/Aaru.Images/DiskCopy42/Identify.cs +++ b/Aaru.Images/DiskCopy42/Identify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class DiskCopy42 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/DiskCopy42/Properties.cs b/Aaru.Images/DiskCopy42/Properties.cs index 635b10639..040e0abeb 100644 --- a/Aaru.Images/DiskCopy42/Properties.cs +++ b/Aaru.Images/DiskCopy42/Properties.cs @@ -41,33 +41,47 @@ namespace Aaru.DiscImages { public sealed partial class DiskCopy42 { + /// public ImageInfo Info => imageInfo; + /// public string Name => "Apple DiskCopy 4.2"; + /// public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); + /// public string Author => "Natalia Portillo"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public string Format => "Apple DiskCopy 4.2"; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new[] { SectorTagType.AppleSectorTag }; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.AppleFileWare, MediaType.AppleHD20, MediaType.AppleProfile, MediaType.AppleSonyDS, MediaType.AppleSonySS, MediaType.AppleWidget, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, MediaType.DMF }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { ("macosx", typeof(bool), "Use Mac OS X format byte", (object)false) }; + /// public IEnumerable KnownExtensions => new[] { ".dc42", ".diskcopy42", ".image" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/DiskCopy42/Read.cs b/Aaru.Images/DiskCopy42/Read.cs index 68a1a8d8b..dc84a255a 100644 --- a/Aaru.Images/DiskCopy42/Read.cs +++ b/Aaru.Images/DiskCopy42/Read.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class DiskCopy42 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -466,10 +467,13 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > imageInfo.Sectors - 1) @@ -493,6 +497,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(tag != SectorTagType.AppleSectorTag) @@ -521,8 +526,10 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { if(sectorAddress > imageInfo.Sectors - 1) diff --git a/Aaru.Images/DiskCopy42/Unsupported.cs b/Aaru.Images/DiskCopy42/Unsupported.cs index d1a831187..27937e782 100644 --- a/Aaru.Images/DiskCopy42/Unsupported.cs +++ b/Aaru.Images/DiskCopy42/Unsupported.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class DiskCopy42 { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/DiskCopy42/Verify.cs b/Aaru.Images/DiskCopy42/Verify.cs index 840dd410d..62e3a33f2 100644 --- a/Aaru.Images/DiskCopy42/Verify.cs +++ b/Aaru.Images/DiskCopy42/Verify.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class DiskCopy42 { + /// public bool? VerifyMediaImage() { byte[] data = new byte[header.DataSize]; diff --git a/Aaru.Images/DiskCopy42/Write.cs b/Aaru.Images/DiskCopy42/Write.cs index a7cebc25f..f5d1e2147 100644 --- a/Aaru.Images/DiskCopy42/Write.cs +++ b/Aaru.Images/DiskCopy42/Write.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class DiskCopy42 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -213,6 +214,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Unsupported feature"; @@ -220,6 +222,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -251,6 +254,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -282,6 +286,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -322,6 +327,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -367,6 +373,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Close() { if(!IsWriting) @@ -417,6 +424,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { header.DiskName = metadata.MediaTitle ?? "-Aaru converted image-"; @@ -424,8 +432,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -433,6 +443,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -440,8 +451,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/DiskDupe/DiskDupe.cs b/Aaru.Images/DiskDupe/DiskDupe.cs index ccb803e26..24041f22a 100644 --- a/Aaru.Images/DiskDupe/DiskDupe.cs +++ b/Aaru.Images/DiskDupe/DiskDupe.cs @@ -64,6 +64,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading DiskDupe disk images + /// public sealed partial class DiskDupe : IMediaImage { /// Every track that has been read is cached here diff --git a/Aaru.Images/DiskDupe/Identify.cs b/Aaru.Images/DiskDupe/Identify.cs index 638f18c5a..95bbe824b 100644 --- a/Aaru.Images/DiskDupe/Identify.cs +++ b/Aaru.Images/DiskDupe/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class DiskDupe { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/DiskDupe/Properties.cs b/Aaru.Images/DiskDupe/Properties.cs index e50303cf5..10028adf8 100644 --- a/Aaru.Images/DiskDupe/Properties.cs +++ b/Aaru.Images/DiskDupe/Properties.cs @@ -48,12 +48,19 @@ namespace Aaru.DiscImages throw new FeatureUnsupportedImageException("Feature not supported by image format"); public List Sessions => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public string Name => "DiskDupe DDI Disk Image"; + /// public Guid Id => new Guid("5439B4A2-5F38-33A7-B8DC-3910D296B3DD"); + /// public string Author => "Michael DrĂ¼ing"; + /// public string Format => "DDI disk image"; + /// public ImageInfo Info => _imageInfo; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } diff --git a/Aaru.Images/DiskDupe/Unsupported.cs b/Aaru.Images/DiskDupe/Unsupported.cs index 8259ed6ff..0e9ec0b73 100644 --- a/Aaru.Images/DiskDupe/Unsupported.cs +++ b/Aaru.Images/DiskDupe/Unsupported.cs @@ -38,18 +38,23 @@ namespace Aaru.DiscImages { public sealed partial class DiskDupe { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/DriDiskCopy/DriDiskCopy.cs b/Aaru.Images/DriDiskCopy/DriDiskCopy.cs index 1265022d7..cee6e739e 100644 --- a/Aaru.Images/DriDiskCopy/DriDiskCopy.cs +++ b/Aaru.Images/DriDiskCopy/DriDiskCopy.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing DR-DOS' DISKCOPY disk images + /// public sealed partial class DriDiskCopy : IWritableImage { /// Disk image file diff --git a/Aaru.Images/DriDiskCopy/Identify.cs b/Aaru.Images/DriDiskCopy/Identify.cs index 2d97d9fd0..5d8e1f770 100644 --- a/Aaru.Images/DriDiskCopy/Identify.cs +++ b/Aaru.Images/DriDiskCopy/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class DriDiskCopy { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/DriDiskCopy/Properties.cs b/Aaru.Images/DriDiskCopy/Properties.cs index 04afa6f23..ca9f3b650 100644 --- a/Aaru.Images/DriDiskCopy/Properties.cs +++ b/Aaru.Images/DriDiskCopy/Properties.cs @@ -41,20 +41,30 @@ namespace Aaru.DiscImages { public sealed partial class DriDiskCopy { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Digital Research DiskCopy"; + /// public Guid Id => new Guid("9F0BE551-8BAB-4038-8B5A-691F1BF5FFF3"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Digital Research DiskCopy"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.ACORN_35_DS_DD, MediaType.ACORN_35_DS_HD, MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, @@ -65,14 +75,18 @@ namespace Aaru.DiscImages MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".dsk" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/DriDiskCopy/Read.cs b/Aaru.Images/DriDiskCopy/Read.cs index 9fa33b2e4..e7696301c 100644 --- a/Aaru.Images/DriDiskCopy/Read.cs +++ b/Aaru.Images/DriDiskCopy/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class DriDiskCopy { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -128,8 +129,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/DriDiskCopy/Unsupported.cs b/Aaru.Images/DriDiskCopy/Unsupported.cs index b14d379aa..6005b933e 100644 --- a/Aaru.Images/DriDiskCopy/Unsupported.cs +++ b/Aaru.Images/DriDiskCopy/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class DriDiskCopy { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/DriDiskCopy/Write.cs b/Aaru.Images/DriDiskCopy/Write.cs index 6475eae0d..5d1bf5331 100644 --- a/Aaru.Images/DriDiskCopy/Write.cs +++ b/Aaru.Images/DriDiskCopy/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class DriDiskCopy { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -119,6 +120,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -126,6 +128,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -157,6 +160,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -188,6 +192,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -195,6 +200,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -202,6 +208,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -229,10 +236,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -240,6 +250,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -247,8 +258,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/GDI/GDI.cs b/Aaru.Images/GDI/GDI.cs index 921c995a0..0e28fd829 100644 --- a/Aaru.Images/GDI/GDI.cs +++ b/Aaru.Images/GDI/GDI.cs @@ -41,6 +41,9 @@ namespace Aaru.DiscImages { // TODO: There seems no be no clear definition on how to treat pregaps that are not included in the file, so this is just appending it to start of track // TODO: This format doesn't support to specify pregaps that are included in the file (like Redump ones) + /// + /// Implements reading Dreamcast GDI disc images + /// public sealed partial class Gdi : IOpticalMediaImage { ulong _densitySeparationSectors; diff --git a/Aaru.Images/GDI/Identify.cs b/Aaru.Images/GDI/Identify.cs index f6bb33863..40a41ea17 100644 --- a/Aaru.Images/GDI/Identify.cs +++ b/Aaru.Images/GDI/Identify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages public sealed partial class Gdi { // Due to .gdi format, this method must parse whole file, ignoring errors (those will be thrown by OpenImage()). + /// public bool Identify(IFilter imageFilter) { try diff --git a/Aaru.Images/GDI/Properties.cs b/Aaru.Images/GDI/Properties.cs index 402fb5fe4..6c7c68493 100644 --- a/Aaru.Images/GDI/Properties.cs +++ b/Aaru.Images/GDI/Properties.cs @@ -42,14 +42,21 @@ namespace Aaru.DiscImages { public sealed partial class Gdi { + /// public string Name => "Dreamcast GDI image"; + /// public Guid Id => new Guid("281ECBF2-D2A7-414C-8497-1A33F6DCB2DD"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "Dreamcast GDI image"; + /// public List Partitions { get; private set; } + /// public List Tracks { get @@ -84,8 +91,11 @@ namespace Aaru.DiscImages } } + /// public List Sessions => _discImage.Sessions; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/GDI/Read.cs b/Aaru.Images/GDI/Read.cs index 96b9d9eff..14eb37c5e 100644 --- a/Aaru.Images/GDI/Read.cs +++ b/Aaru.Images/GDI/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class Gdi { + /// public bool Open(IFilter imageFilter) { if(imageFilter == null) @@ -324,15 +325,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -350,6 +356,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -367,6 +374,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { if(track == 0) @@ -486,6 +494,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags) @@ -672,10 +681,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetMap where sectorAddress >= kvp.Value @@ -687,6 +699,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(track == 0) @@ -827,6 +840,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(_discImage.Sessions.Contains(session)) @@ -835,6 +849,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException("Session does not exist in disc image"); } + /// public List GetSessionTracks(ushort session) { List tracks = new List(); diff --git a/Aaru.Images/GDI/Unsupported.cs b/Aaru.Images/GDI/Unsupported.cs index 0214c6943..d01251c65 100644 --- a/Aaru.Images/GDI/Unsupported.cs +++ b/Aaru.Images/GDI/Unsupported.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class Gdi { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureSupportedButNotImplementedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/GDI/Verify.cs b/Aaru.Images/GDI/Verify.cs index 7186bc5c4..c527b3e38 100644 --- a/Aaru.Images/GDI/Verify.cs +++ b/Aaru.Images/GDI/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Gdi { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -45,6 +46,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -78,6 +80,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/HDCopy/HDCopy.cs b/Aaru.Images/HDCopy/HDCopy.cs index 62b620f57..aeddd5e62 100644 --- a/Aaru.Images/HDCopy/HDCopy.cs +++ b/Aaru.Images/HDCopy/HDCopy.cs @@ -72,6 +72,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading HD-Copy disk images + /// public sealed partial class HdCopy : IMediaImage { /// Every track that has been read is cached here diff --git a/Aaru.Images/HDCopy/Identify.cs b/Aaru.Images/HDCopy/Identify.cs index cc00de044..66bca8fec 100644 --- a/Aaru.Images/HDCopy/Identify.cs +++ b/Aaru.Images/HDCopy/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class HdCopy { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/HDCopy/Properties.cs b/Aaru.Images/HDCopy/Properties.cs index 7e0cd1deb..68379b65d 100644 --- a/Aaru.Images/HDCopy/Properties.cs +++ b/Aaru.Images/HDCopy/Properties.cs @@ -40,13 +40,20 @@ namespace Aaru.DiscImages { public sealed partial class HdCopy { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "HD-Copy disk image"; + /// public Guid Id => new Guid("8D57483F-71A5-42EC-9B87-66AEC439C792"); + /// public string Author => "Michael DrĂ¼ing"; + /// public string Format => "HD-Copy image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/HDCopy/Read.cs b/Aaru.Images/HDCopy/Read.cs index 8653d406d..87ee1c292 100644 --- a/Aaru.Images/HDCopy/Read.cs +++ b/Aaru.Images/HDCopy/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class HdCopy { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -118,6 +119,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { int trackNum = (int)(sectorAddress / _imageInfo.SectorsPerTrack); @@ -146,6 +148,7 @@ namespace Aaru.DiscImages return result; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { byte[] result = new byte[length * _imageInfo.SectorSize]; diff --git a/Aaru.Images/HDCopy/Unsupported.cs b/Aaru.Images/HDCopy/Unsupported.cs index 72581258a..1742296f7 100644 --- a/Aaru.Images/HDCopy/Unsupported.cs +++ b/Aaru.Images/HDCopy/Unsupported.cs @@ -38,18 +38,23 @@ namespace Aaru.DiscImages { public sealed partial class HdCopy { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/IMD/IMD.cs b/Aaru.Images/IMD/IMD.cs index 59681f5da..380f85298 100644 --- a/Aaru.Images/IMD/IMD.cs +++ b/Aaru.Images/IMD/IMD.cs @@ -37,6 +37,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading IMageDisk disk images + /// public sealed partial class Imd : IMediaImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/IMD/Identify.cs b/Aaru.Images/IMD/Identify.cs index 15fe00394..b6f386024 100644 --- a/Aaru.Images/IMD/Identify.cs +++ b/Aaru.Images/IMD/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class Imd { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/IMD/Properties.cs b/Aaru.Images/IMD/Properties.cs index 991e00ca6..6580acb63 100644 --- a/Aaru.Images/IMD/Properties.cs +++ b/Aaru.Images/IMD/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class Imd { + /// public string Name => "Dunfield's IMD"; + /// public Guid Id => new Guid("0D67162E-38A3-407D-9B1A-CF40080A48CB"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "IMageDisk"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/IMD/Read.cs b/Aaru.Images/IMD/Read.cs index fb5e9c6e7..899142ca3 100644 --- a/Aaru.Images/IMD/Read.cs +++ b/Aaru.Images/IMD/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class Imd { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -215,8 +216,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/IMD/Unsupported.cs b/Aaru.Images/IMD/Unsupported.cs index aa00bdc96..ae54c8053 100644 --- a/Aaru.Images/IMD/Unsupported.cs +++ b/Aaru.Images/IMD/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Imd { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/KryoFlux/Identify.cs b/Aaru.Images/KryoFlux/Identify.cs index 2afee9dea..9cac30f10 100644 --- a/Aaru.Images/KryoFlux/Identify.cs +++ b/Aaru.Images/KryoFlux/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class KryoFlux { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/KryoFlux/KryoFlux.cs b/Aaru.Images/KryoFlux/KryoFlux.cs index 2d3af25b8..d8831b510 100644 --- a/Aaru.Images/KryoFlux/KryoFlux.cs +++ b/Aaru.Images/KryoFlux/KryoFlux.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading KryoFlux flux images + /// [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed partial class KryoFlux : IMediaImage, IVerifiableSectorsImage { diff --git a/Aaru.Images/KryoFlux/Properties.cs b/Aaru.Images/KryoFlux/Properties.cs index 97774b583..2360d449a 100644 --- a/Aaru.Images/KryoFlux/Properties.cs +++ b/Aaru.Images/KryoFlux/Properties.cs @@ -39,13 +39,20 @@ namespace Aaru.DiscImages { public sealed partial class KryoFlux { - public ImageInfo imageInfo; + ImageInfo imageInfo; + /// public ImageInfo Info => imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Name => "KryoFlux STREAM"; + /// public Guid Id => new Guid("4DBC95E4-93EE-4F7A-9492-919887E60EFE"); + /// public string Format => "KryoFlux STREAM"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/KryoFlux/Read.cs b/Aaru.Images/KryoFlux/Read.cs index 0601c0219..c5d1f6489 100644 --- a/Aaru.Images/KryoFlux/Read.cs +++ b/Aaru.Images/KryoFlux/Read.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class KryoFlux { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -254,23 +255,30 @@ namespace Aaru.DiscImages throw new NotImplementedException("Flux decoding is not yet implemented."); } + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); } diff --git a/Aaru.Images/KryoFlux/Verify.cs b/Aaru.Images/KryoFlux/Verify.cs index 61c5ed25c..5fabfe626 100644 --- a/Aaru.Images/KryoFlux/Verify.cs +++ b/Aaru.Images/KryoFlux/Verify.cs @@ -37,9 +37,11 @@ namespace Aaru.DiscImages { public sealed partial class KryoFlux { + /// public bool? VerifySector(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) => throw new NotImplementedException("Flux decoding is not yet implemented."); diff --git a/Aaru.Images/MaxiDisk/Identify.cs b/Aaru.Images/MaxiDisk/Identify.cs index ca8cdcffe..1fefa000e 100644 --- a/Aaru.Images/MaxiDisk/Identify.cs +++ b/Aaru.Images/MaxiDisk/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class MaxiDisk { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/MaxiDisk/MaxiDisk.cs b/Aaru.Images/MaxiDisk/MaxiDisk.cs index 04e1d5bb8..dbbc88cc4 100644 --- a/Aaru.Images/MaxiDisk/MaxiDisk.cs +++ b/Aaru.Images/MaxiDisk/MaxiDisk.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing MaxiDisk disk images + /// public sealed partial class MaxiDisk : IWritableImage { /// Disk image file diff --git a/Aaru.Images/MaxiDisk/Properties.cs b/Aaru.Images/MaxiDisk/Properties.cs index 24918de9c..e7660c292 100644 --- a/Aaru.Images/MaxiDisk/Properties.cs +++ b/Aaru.Images/MaxiDisk/Properties.cs @@ -41,19 +41,29 @@ namespace Aaru.DiscImages { public sealed partial class MaxiDisk { + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Name => "MAXI Disk image"; + /// public Guid Id => new Guid("D27D924A-7034-466E-ADE1-B81EF37E469E"); + /// public string Format => "MAXI Disk"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, @@ -63,14 +73,18 @@ namespace Aaru.DiscImages MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".hdk" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/MaxiDisk/Read.cs b/Aaru.Images/MaxiDisk/Read.cs index 1e936f286..dfaf0ef35 100644 --- a/Aaru.Images/MaxiDisk/Read.cs +++ b/Aaru.Images/MaxiDisk/Read.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class MaxiDisk { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -99,8 +100,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/MaxiDisk/Unsupported.cs b/Aaru.Images/MaxiDisk/Unsupported.cs index 0cab4ff49..3b9be4afb 100644 --- a/Aaru.Images/MaxiDisk/Unsupported.cs +++ b/Aaru.Images/MaxiDisk/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class MaxiDisk { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/MaxiDisk/Write.cs b/Aaru.Images/MaxiDisk/Write.cs index 893817a7a..4c6b3b05b 100644 --- a/Aaru.Images/MaxiDisk/Write.cs +++ b/Aaru.Images/MaxiDisk/Write.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class MaxiDisk { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -113,6 +114,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -120,6 +122,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -153,6 +156,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -186,6 +190,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -193,6 +198,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -200,6 +206,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -241,8 +248,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > 90) @@ -273,6 +282,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -280,6 +290,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -287,8 +298,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/NDIF/Identify.cs b/Aaru.Images/NDIF/Identify.cs index 08a9cbe52..e9b1630e0 100644 --- a/Aaru.Images/NDIF/Identify.cs +++ b/Aaru.Images/NDIF/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Ndif { + /// public bool Identify(IFilter imageFilter) { if(!imageFilter.HasResourceFork() || diff --git a/Aaru.Images/NDIF/NDIF.cs b/Aaru.Images/NDIF/NDIF.cs index 298cca6a2..b27b18154 100644 --- a/Aaru.Images/NDIF/NDIF.cs +++ b/Aaru.Images/NDIF/NDIF.cs @@ -42,6 +42,9 @@ namespace Aaru.DiscImages // TODO: Check checksum // TODO: Implement segments // TODO: Implement compression + /// + /// Implements reading Apple New Disk Image Format disk images + /// public sealed partial class Ndif : IMediaImage { uint _bufferSize; diff --git a/Aaru.Images/NDIF/Properties.cs b/Aaru.Images/NDIF/Properties.cs index f66a53161..e76f01a44 100644 --- a/Aaru.Images/NDIF/Properties.cs +++ b/Aaru.Images/NDIF/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class Ndif { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Apple New Disk Image Format"; + /// public Guid Id => new Guid("5A7FF7D8-491E-458D-8674-5B5EADBECC24"); + /// public string Format => "Apple New Disk Image Format"; + /// public string Author => "Natalia Portillo"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/NDIF/Read.cs b/Aaru.Images/NDIF/Read.cs index 9a750b0af..8ccd3d2d4 100644 --- a/Aaru.Images/NDIF/Read.cs +++ b/Aaru.Images/NDIF/Read.cs @@ -50,6 +50,7 @@ namespace Aaru.DiscImages { public sealed partial class Ndif { + /// public bool Open(IFilter imageFilter) { if(!imageFilter.HasResourceFork() || @@ -309,6 +310,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -438,6 +440,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException($"Unsupported chunk type 0x{currentChunk.type:X8} found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/NDIF/Unsupported.cs b/Aaru.Images/NDIF/Unsupported.cs index 3e30a6217..1323ca355 100644 --- a/Aaru.Images/NDIF/Unsupported.cs +++ b/Aaru.Images/NDIF/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Ndif { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/NHDr0/Identify.cs b/Aaru.Images/NHDr0/Identify.cs index 3e7369b2e..b0f512aad 100644 --- a/Aaru.Images/NHDr0/Identify.cs +++ b/Aaru.Images/NHDr0/Identify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class Nhdr0 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/NHDr0/NHDr0.cs b/Aaru.Images/NHDr0/NHDr0.cs index 7bcb6534a..9b8803b31 100644 --- a/Aaru.Images/NHDr0/NHDr0.cs +++ b/Aaru.Images/NHDr0/NHDr0.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // Info from http://www.geocities.jp/t98next/nhdr0.txt + /// + /// Implements reading and writing T98-Next disk images + /// public sealed partial class Nhdr0 : IWritableImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/NHDr0/Properties.cs b/Aaru.Images/NHDr0/Properties.cs index 09e877a33..401767f33 100644 --- a/Aaru.Images/NHDr0/Properties.cs +++ b/Aaru.Images/NHDr0/Properties.cs @@ -41,31 +41,45 @@ namespace Aaru.DiscImages { public sealed partial class Nhdr0 { + /// public string Name => "T98-Next NHD r0 Disk Image"; + /// public Guid Id => new Guid("6ECACD0A-8F4D-4465-8815-AEA000D370E3"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "NHDr0 disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.GENERIC_HDD, MediaType.Unknown }; // TODO: Support dynamic images + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".nhd" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/NHDr0/Read.cs b/Aaru.Images/NHDr0/Read.cs index ce40b0725..934c5385a 100644 --- a/Aaru.Images/NHDr0/Read.cs +++ b/Aaru.Images/NHDr0/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class Nhdr0 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -77,8 +78,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/NHDr0/Unsupported.cs b/Aaru.Images/NHDr0/Unsupported.cs index 7439b05a0..54de4af59 100644 --- a/Aaru.Images/NHDr0/Unsupported.cs +++ b/Aaru.Images/NHDr0/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Nhdr0 { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/NHDr0/Write.cs b/Aaru.Images/NHDr0/Write.cs index fa178c738..a5f1061b0 100644 --- a/Aaru.Images/NHDr0/Write.cs +++ b/Aaru.Images/NHDr0/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Nhdr0 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -86,6 +87,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -93,6 +95,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -126,6 +129,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -159,6 +163,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -166,6 +171,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -173,6 +179,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -244,6 +251,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Comments = metadata.Comments; @@ -251,6 +259,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > int.MaxValue) @@ -281,6 +290,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -288,6 +298,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -295,8 +306,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/Nero/Identify.cs b/Aaru.Images/Nero/Identify.cs index de15c6811..69d15b981 100644 --- a/Aaru.Images/Nero/Identify.cs +++ b/Aaru.Images/Nero/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Nero { + /// public bool Identify(IFilter imageFilter) { _imageStream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Nero/Nero.cs b/Aaru.Images/Nero/Nero.cs index 069fde0d6..c43c9b11e 100644 --- a/Aaru.Images/Nero/Nero.cs +++ b/Aaru.Images/Nero/Nero.cs @@ -44,6 +44,9 @@ using Aaru.Decoders.CD; namespace Aaru.DiscImages { + /// + /// Implements reading Nero Burning ROM disc images + /// [SuppressMessage("ReSharper", "NotAccessedField.Local"), SuppressMessage("ReSharper", "CollectionNeverQueried.Local")] public sealed partial class Nero : IOpticalMediaImage diff --git a/Aaru.Images/Nero/Properties.cs b/Aaru.Images/Nero/Properties.cs index aaa066dd4..4a66fab0c 100644 --- a/Aaru.Images/Nero/Properties.cs +++ b/Aaru.Images/Nero/Properties.cs @@ -40,15 +40,25 @@ namespace Aaru.DiscImages { public sealed partial class Nero { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Nero Burning ROM image"; + /// public Guid Id => new Guid("D160F9FF-5941-43FC-B037-AD81DD141F05"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Nero Burning ROM"; + /// public List Partitions { get; } + /// public List Tracks { get; private set; } + /// public List Sessions { get; } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/Nero/Read.cs b/Aaru.Images/Nero/Read.cs index 839b555db..352e36af0 100644 --- a/Aaru.Images/Nero/Read.cs +++ b/Aaru.Images/Nero/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class Nero { + /// public bool Open(IFilter imageFilter) { try @@ -1568,6 +1569,7 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadDiskTag(MediaTagType tag) { switch(tag) @@ -1579,15 +1581,20 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, tag); + /// public byte[] ReadSector(ulong sectorAddress, uint track) => ReadSectors(sectorAddress, 1, track); + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) => ReadSectorsTag(sectorAddress, 1, track, tag); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetmap where sectorAddress >= kvp.Value @@ -1599,6 +1606,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { foreach(KeyValuePair kvp in from kvp in _offsetmap where sectorAddress >= kvp.Value @@ -1610,6 +1618,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { if(!_neroTracks.TryGetValue(track, out NeroTrack aaruTrack)) @@ -1746,6 +1755,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(tag == SectorTagType.CdTrackFlags || @@ -2061,10 +2071,13 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) => ReadSectorsLong(sectorAddress, 1, track); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { foreach(KeyValuePair kvp in from kvp in _offsetmap where sectorAddress >= kvp.Value @@ -2076,6 +2089,7 @@ namespace Aaru.DiscImages throw new ArgumentOutOfRangeException(nameof(sectorAddress), $"Sector address {sectorAddress} not found"); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(!_isCd) @@ -2223,9 +2237,11 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(CommonTypes.Structs.Session session) => GetSessionTracks(session.SessionSequence); + /// public List GetSessionTracks(ushort session) => Tracks.Where(track => track.TrackSession == session).ToList(); } diff --git a/Aaru.Images/Nero/Verify.cs b/Aaru.Images/Nero/Verify.cs index 4510a88f1..cefedf830 100644 --- a/Aaru.Images/Nero/Verify.cs +++ b/Aaru.Images/Nero/Verify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Nero { + /// public bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); @@ -52,6 +53,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -85,6 +87,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/Parallels/Identify.cs b/Aaru.Images/Parallels/Identify.cs index 4081b1ec1..edee84ab0 100644 --- a/Aaru.Images/Parallels/Identify.cs +++ b/Aaru.Images/Parallels/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Parallels { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Parallels/Parallels.cs b/Aaru.Images/Parallels/Parallels.cs index 319992e08..ce83cd30a 100644 --- a/Aaru.Images/Parallels/Parallels.cs +++ b/Aaru.Images/Parallels/Parallels.cs @@ -40,6 +40,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing Parallels' disk images + /// public sealed partial class Parallels : IWritableImage { uint[] _bat; diff --git a/Aaru.Images/Parallels/Properties.cs b/Aaru.Images/Parallels/Properties.cs index 1bdeaec7b..ca7318f51 100644 --- a/Aaru.Images/Parallels/Properties.cs +++ b/Aaru.Images/Parallels/Properties.cs @@ -41,17 +41,27 @@ namespace Aaru.DiscImages { public sealed partial class Parallels { + /// public string Name => "Parallels disk image"; + /// public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "Parallels"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, @@ -60,14 +70,18 @@ namespace Aaru.DiscImages }; // TODO: Add cluster size option + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".hdd" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/Parallels/Read.cs b/Aaru.Images/Parallels/Read.cs index da093c37f..6312b1df5 100644 --- a/Aaru.Images/Parallels/Read.cs +++ b/Aaru.Images/Parallels/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class Parallels { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -106,6 +107,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -146,6 +148,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/Parallels/Unsupported.cs b/Aaru.Images/Parallels/Unsupported.cs index e81088788..dd6f3bab3 100644 --- a/Aaru.Images/Parallels/Unsupported.cs +++ b/Aaru.Images/Parallels/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Parallels { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Parallels/Write.cs b/Aaru.Images/Parallels/Write.cs index 7af393570..9fe916141 100644 --- a/Aaru.Images/Parallels/Write.cs +++ b/Aaru.Images/Parallels/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages public sealed partial class Parallels { // TODO: Support extended + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -117,6 +118,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -124,6 +126,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -175,6 +178,7 @@ namespace Aaru.DiscImages } // TODO: This can be optimized + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -216,6 +220,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -223,6 +228,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -230,6 +236,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -285,8 +292,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { _pHdr.cylinders = cylinders; @@ -295,6 +304,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -302,6 +312,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -309,8 +320,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/PartClone/Identify.cs b/Aaru.Images/PartClone/Identify.cs index 18c3c10cf..969ab7439 100644 --- a/Aaru.Images/PartClone/Identify.cs +++ b/Aaru.Images/PartClone/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class PartClone { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/PartClone/PartClone.cs b/Aaru.Images/PartClone/PartClone.cs index c0155c4f9..784ab472f 100644 --- a/Aaru.Images/PartClone/PartClone.cs +++ b/Aaru.Images/PartClone/PartClone.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading partclone disk images + /// public sealed partial class PartClone : IMediaImage, IVerifiableImage { // The used block "bitmap" uses one byte per block diff --git a/Aaru.Images/PartClone/Properties.cs b/Aaru.Images/PartClone/Properties.cs index cd9455d51..7c1b7a5f2 100644 --- a/Aaru.Images/PartClone/Properties.cs +++ b/Aaru.Images/PartClone/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class PartClone { + /// public string Name => "PartClone disk image"; + /// public Guid Id => new Guid("AB1D7518-B548-4099-A4E2-C29C53DDE0C3"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "PartClone"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/PartClone/Read.cs b/Aaru.Images/PartClone/Read.cs index f9839bcd0..5c4c60151 100644 --- a/Aaru.Images/PartClone/Read.cs +++ b/Aaru.Images/PartClone/Read.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class PartClone { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -137,6 +138,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -163,6 +165,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/PartClone/Unsupported.cs b/Aaru.Images/PartClone/Unsupported.cs index 98bff1fd3..12241946b 100644 --- a/Aaru.Images/PartClone/Unsupported.cs +++ b/Aaru.Images/PartClone/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class PartClone { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/PartClone/Verify.cs b/Aaru.Images/PartClone/Verify.cs index f01ff484a..ce671b555 100644 --- a/Aaru.Images/PartClone/Verify.cs +++ b/Aaru.Images/PartClone/Verify.cs @@ -35,6 +35,7 @@ namespace Aaru.DiscImages public sealed partial class PartClone { // TODO: All blocks contain a CRC32 that's incompatible with current implementation. Need to check for compatibility. + /// public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/Aaru.Images/Partimage/Identify.cs b/Aaru.Images/Partimage/Identify.cs index efa4e4a05..f7e4e1d43 100644 --- a/Aaru.Images/Partimage/Identify.cs +++ b/Aaru.Images/Partimage/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Partimage { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Partimage/Partimage.cs b/Aaru.Images/Partimage/Partimage.cs index 91306fc8e..6416e278b 100644 --- a/Aaru.Images/Partimage/Partimage.cs +++ b/Aaru.Images/Partimage/Partimage.cs @@ -41,6 +41,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading partimage disk images + /// public sealed partial class Partimage : IMediaImage, IVerifiableImage { byte[] _bitmap; diff --git a/Aaru.Images/Partimage/Properties.cs b/Aaru.Images/Partimage/Properties.cs index 299012ec7..f18aefe2b 100644 --- a/Aaru.Images/Partimage/Properties.cs +++ b/Aaru.Images/Partimage/Properties.cs @@ -39,13 +39,20 @@ namespace Aaru.DiscImages { public sealed partial class Partimage { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Partimage disk image"; + /// public Guid Id => new Guid("AAFDB99D-2B77-49EA-831C-C9BB58C68C95"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Partimage"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/Partimage/Read.cs b/Aaru.Images/Partimage/Read.cs index 9346547ae..5b8559406 100644 --- a/Aaru.Images/Partimage/Read.cs +++ b/Aaru.Images/Partimage/Read.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Partimage { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -351,6 +352,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -387,6 +389,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/Partimage/Unsupported.cs b/Aaru.Images/Partimage/Unsupported.cs index 0a8e9160e..f302af442 100644 --- a/Aaru.Images/Partimage/Unsupported.cs +++ b/Aaru.Images/Partimage/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Partimage { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Partimage/Verify.cs b/Aaru.Images/Partimage/Verify.cs index 99420a906..afd206a33 100644 --- a/Aaru.Images/Partimage/Verify.cs +++ b/Aaru.Images/Partimage/Verify.cs @@ -35,6 +35,7 @@ namespace Aaru.DiscImages public sealed partial class Partimage { // TODO: All blocks contain a CRC32 that's incompatible with current implementation. Need to check for compatibility. + /// public bool? VerifyMediaImage() => null; } } \ No newline at end of file diff --git a/Aaru.Images/QCOW/Identify.cs b/Aaru.Images/QCOW/Identify.cs index 6ab8f4418..0d3878b06 100644 --- a/Aaru.Images/QCOW/Identify.cs +++ b/Aaru.Images/QCOW/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Qcow { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/QCOW/Properties.cs b/Aaru.Images/QCOW/Properties.cs index 362fb9fa3..6ac0b90e6 100644 --- a/Aaru.Images/QCOW/Properties.cs +++ b/Aaru.Images/QCOW/Properties.cs @@ -41,32 +41,46 @@ namespace Aaru.DiscImages { public sealed partial class Qcow { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "QEMU Copy-On-Write disk image"; + /// public Guid Id => new Guid("A5C35765-9FE2-469D-BBBF-ACDEBDB7B954"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "QEMU Copy-On-Write"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".qcow", ".qc" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/QCOW/QCOW.cs b/Aaru.Images/QCOW/QCOW.cs index c215bf47d..4aa84851e 100644 --- a/Aaru.Images/QCOW/QCOW.cs +++ b/Aaru.Images/QCOW/QCOW.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing QEMU's Copy On Write disk images + /// public sealed partial class Qcow : IWritableImage { Dictionary _clusterCache; diff --git a/Aaru.Images/QCOW/Read.cs b/Aaru.Images/QCOW/Read.cs index ede8d254d..b44264199 100644 --- a/Aaru.Images/QCOW/Read.cs +++ b/Aaru.Images/QCOW/Read.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class Qcow { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -178,6 +179,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -272,6 +274,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/QCOW/Unsupported.cs b/Aaru.Images/QCOW/Unsupported.cs index 406ba6853..dce4964fe 100644 --- a/Aaru.Images/QCOW/Unsupported.cs +++ b/Aaru.Images/QCOW/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Qcow { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/QCOW/Write.cs b/Aaru.Images/QCOW/Write.cs index 22bb14d9a..a211b906a 100644 --- a/Aaru.Images/QCOW/Write.cs +++ b/Aaru.Images/QCOW/Write.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class Qcow { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -143,6 +144,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -150,6 +152,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -224,6 +227,7 @@ namespace Aaru.DiscImages } // TODO: This can be optimized + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -265,6 +269,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -272,6 +277,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -279,6 +285,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -320,10 +327,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -331,6 +341,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -338,8 +349,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/QCOW2/Identify.cs b/Aaru.Images/QCOW2/Identify.cs index f0f690a92..f6fc5a043 100644 --- a/Aaru.Images/QCOW2/Identify.cs +++ b/Aaru.Images/QCOW2/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class Qcow2 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/QCOW2/Properties.cs b/Aaru.Images/QCOW2/Properties.cs index 0ea725e65..da43df0c0 100644 --- a/Aaru.Images/QCOW2/Properties.cs +++ b/Aaru.Images/QCOW2/Properties.cs @@ -41,32 +41,46 @@ namespace Aaru.DiscImages { public sealed partial class Qcow2 { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "QEMU Copy-On-Write disk image v2"; + /// public Guid Id => new Guid("F20107CB-95B3-4398-894B-975261F1E8C5"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "QEMU Copy-On-Write"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".qcow2", ".qc2", ".qcow3", ".qc3" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/QCOW2/QCOW2.cs b/Aaru.Images/QCOW2/QCOW2.cs index d3b4ed0a7..ec26d3ea7 100644 --- a/Aaru.Images/QCOW2/QCOW2.cs +++ b/Aaru.Images/QCOW2/QCOW2.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing QEMU's Copy On Write v2 and v3 disk images + /// public sealed partial class Qcow2 : IWritableImage { Dictionary _clusterCache; diff --git a/Aaru.Images/QCOW2/Read.cs b/Aaru.Images/QCOW2/Read.cs index be4f7af39..b8b8c6884 100644 --- a/Aaru.Images/QCOW2/Read.cs +++ b/Aaru.Images/QCOW2/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class Qcow2 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -185,6 +186,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -280,6 +282,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/QCOW2/Unsupported.cs b/Aaru.Images/QCOW2/Unsupported.cs index 019da470a..6cab7dece 100644 --- a/Aaru.Images/QCOW2/Unsupported.cs +++ b/Aaru.Images/QCOW2/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Qcow2 { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/QCOW2/Write.cs b/Aaru.Images/QCOW2/Write.cs index cd712c6ad..9327f62fb 100644 --- a/Aaru.Images/QCOW2/Write.cs +++ b/Aaru.Images/QCOW2/Write.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class Qcow2 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -171,6 +172,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -178,6 +180,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -274,6 +277,7 @@ namespace Aaru.DiscImages } // TODO: This can be optimized + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -315,6 +319,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -322,6 +327,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -329,6 +335,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -384,10 +391,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -395,6 +405,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -402,8 +413,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/QED/Identify.cs b/Aaru.Images/QED/Identify.cs index d76e0370a..1a82773a0 100644 --- a/Aaru.Images/QED/Identify.cs +++ b/Aaru.Images/QED/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Qed { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/QED/Properties.cs b/Aaru.Images/QED/Properties.cs index 6569aa317..7b6012266 100644 --- a/Aaru.Images/QED/Properties.cs +++ b/Aaru.Images/QED/Properties.cs @@ -41,19 +41,29 @@ namespace Aaru.DiscImages { public sealed partial class Qed { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "QEMU Enhanced Disk image"; + /// public Guid Id => new Guid("B9DBB155-A69A-4C10-BF91-96BF431B9BB6"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "QEMU Enhanced Disk"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, @@ -62,14 +72,18 @@ namespace Aaru.DiscImages }; // TODO: Add cluster size option + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".qed" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/QED/QED.cs b/Aaru.Images/QED/QED.cs index 1e2d2c1d3..6a8bc24b1 100644 --- a/Aaru.Images/QED/QED.cs +++ b/Aaru.Images/QED/QED.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing QEMU Enhanced Disk images + /// public sealed partial class Qed : IWritableImage { int _clusterBits; diff --git a/Aaru.Images/QED/Read.cs b/Aaru.Images/QED/Read.cs index 86c424aeb..2df753ac9 100644 --- a/Aaru.Images/QED/Read.cs +++ b/Aaru.Images/QED/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class Qed { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -159,6 +160,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -227,6 +229,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/QED/Unsupported.cs b/Aaru.Images/QED/Unsupported.cs index 26aac91f6..62439db5d 100644 --- a/Aaru.Images/QED/Unsupported.cs +++ b/Aaru.Images/QED/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Qed { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/QED/Write.cs b/Aaru.Images/QED/Write.cs index c1b4160c9..3c035caec 100644 --- a/Aaru.Images/QED/Write.cs +++ b/Aaru.Images/QED/Write.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class Qed { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -134,6 +135,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -141,6 +143,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -215,6 +218,7 @@ namespace Aaru.DiscImages } // TODO: This can be optimized + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -256,6 +260,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -263,6 +268,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -270,6 +276,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -298,10 +305,13 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -309,6 +319,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -316,8 +327,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/RayDIM/Identify.cs b/Aaru.Images/RayDIM/Identify.cs index 6ec5dc726..7fcf99c76 100644 --- a/Aaru.Images/RayDIM/Identify.cs +++ b/Aaru.Images/RayDIM/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class RayDim { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/RayDIM/Properties.cs b/Aaru.Images/RayDIM/Properties.cs index 40bfcdeef..8e508a5be 100644 --- a/Aaru.Images/RayDIM/Properties.cs +++ b/Aaru.Images/RayDIM/Properties.cs @@ -41,19 +41,29 @@ namespace Aaru.DiscImages { public sealed partial class RayDim { + /// public string Name => "Ray Arachelian's Disk IMage"; + /// public Guid Id => new Guid("F541F4E7-C1E3-4A2D-B07F-D863E87AB961"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "Ray Arachelian's Disk IMage"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, MediaType.ATARI_35_DS_DD_11, MediaType.ATARI_35_SS_DD, @@ -63,14 +73,18 @@ namespace Aaru.DiscImages MediaType.DOS_525_SS_DD_8, MediaType.DOS_525_SS_DD_9, MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".dim" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/RayDIM/RayDIM.cs b/Aaru.Images/RayDIM/RayDIM.cs index 9c1a56587..4dfddf066 100644 --- a/Aaru.Images/RayDIM/RayDIM.cs +++ b/Aaru.Images/RayDIM/RayDIM.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing Ray Arachellian's DIM disk images + /// public sealed partial class RayDim : IWritableImage { MemoryStream _disk; diff --git a/Aaru.Images/RayDIM/Read.cs b/Aaru.Images/RayDIM/Read.cs index 45ef017f8..bbb6058de 100644 --- a/Aaru.Images/RayDIM/Read.cs +++ b/Aaru.Images/RayDIM/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class RayDim { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -108,8 +109,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/RayDIM/Unsupported.cs b/Aaru.Images/RayDIM/Unsupported.cs index 0cdf16e91..e9e1a3b03 100644 --- a/Aaru.Images/RayDIM/Unsupported.cs +++ b/Aaru.Images/RayDIM/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class RayDim { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/RayDIM/Write.cs b/Aaru.Images/RayDIM/Write.cs index 9fcbdbc62..87f2a11fb 100644 --- a/Aaru.Images/RayDIM/Write.cs +++ b/Aaru.Images/RayDIM/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class RayDim { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -99,6 +100,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -106,6 +108,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -139,6 +142,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -172,6 +176,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -179,6 +184,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -186,8 +192,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -195,6 +203,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -202,10 +211,13 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; + /// public bool Close() { if(!IsWriting) @@ -247,6 +259,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; } } \ No newline at end of file diff --git a/Aaru.Images/Register.cs b/Aaru.Images/Register.cs index 67b63c88e..37d7bcfd2 100644 --- a/Aaru.Images/Register.cs +++ b/Aaru.Images/Register.cs @@ -44,39 +44,50 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.DiscImages { + /// public sealed class Register : IPluginRegister { + /// public List GetAllChecksumPlugins() => null; + /// public List GetAllFilesystemPlugins() => null; + /// public List GetAllFilterPlugins() => null; + /// public List GetAllFloppyImagePlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IFloppyImage))). Where(t => t.IsClass).ToList(); + /// public List GetAllMediaImagePlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IMediaImage))). Where(t => t.IsClass).ToList(); + /// public List GetAllPartitionPlugins() => null; + /// public List GetAllReadOnlyFilesystemPlugins() => null; + /// public List GetAllWritableFloppyImagePlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IWritableFloppyImage ))).Where(t => t.IsClass). ToList(); + /// public List GetAllWritableImagePlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IWritableImage))). Where(t => t.IsClass).ToList(); + /// public List GetAllArchivePlugins() => null; } } diff --git a/Aaru.Images/RsIde/Identify.cs b/Aaru.Images/RsIde/Identify.cs index 8b840511e..58479e475 100644 --- a/Aaru.Images/RsIde/Identify.cs +++ b/Aaru.Images/RsIde/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class RsIde { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/RsIde/Properties.cs b/Aaru.Images/RsIde/Properties.cs index d00dbbc7f..54d52470b 100644 --- a/Aaru.Images/RsIde/Properties.cs +++ b/Aaru.Images/RsIde/Properties.cs @@ -41,33 +41,47 @@ namespace Aaru.DiscImages { public sealed partial class RsIde { + /// public string Name => "RS-IDE Hard Disk Image"; + /// public Guid Id => new Guid("47C3E78D-2BE2-4BA5-AA6B-FEE27C86FC65"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "RS-IDE disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new[] { MediaTagType.ATA_IDENTIFY }; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".ide" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/RsIde/Read.cs b/Aaru.Images/RsIde/Read.cs index 563a87f71..8c710c57b 100644 --- a/Aaru.Images/RsIde/Read.cs +++ b/Aaru.Images/RsIde/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class RsIde { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -103,8 +104,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -124,6 +127,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadDiskTag(MediaTagType tag) { if(!_imageInfo.ReadableMediaTags.Contains(tag) || diff --git a/Aaru.Images/RsIde/RsIde.cs b/Aaru.Images/RsIde/RsIde.cs index e585754c7..df2b56543 100644 --- a/Aaru.Images/RsIde/RsIde.cs +++ b/Aaru.Images/RsIde/RsIde.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing RS-IDE disk images + /// public sealed partial class RsIde : IWritableImage { ushort _dataOff; diff --git a/Aaru.Images/RsIde/Unsupported.cs b/Aaru.Images/RsIde/Unsupported.cs index 2e7ea670d..3d8e657fd 100644 --- a/Aaru.Images/RsIde/Unsupported.cs +++ b/Aaru.Images/RsIde/Unsupported.cs @@ -37,15 +37,19 @@ namespace Aaru.DiscImages { public sealed partial class RsIde { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/RsIde/Write.cs b/Aaru.Images/RsIde/Write.cs index f805ea173..66b6c2f35 100644 --- a/Aaru.Images/RsIde/Write.cs +++ b/Aaru.Images/RsIde/Write.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class RsIde { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -95,6 +96,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(tag != MediaTagType.ATA_IDENTIFY) @@ -117,6 +119,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -150,6 +153,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -183,6 +187,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -190,6 +195,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -197,6 +203,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -318,6 +325,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.DriveManufacturer = metadata.DriveManufacturer; @@ -328,6 +336,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > ushort.MaxValue) @@ -358,6 +367,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -365,6 +375,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -372,8 +383,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/SaveDskF/Identify.cs b/Aaru.Images/SaveDskF/Identify.cs index 44d1f900d..67dbbae07 100644 --- a/Aaru.Images/SaveDskF/Identify.cs +++ b/Aaru.Images/SaveDskF/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class SaveDskF { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/SaveDskF/Properties.cs b/Aaru.Images/SaveDskF/Properties.cs index 020448ce5..5c73d70c3 100644 --- a/Aaru.Images/SaveDskF/Properties.cs +++ b/Aaru.Images/SaveDskF/Properties.cs @@ -41,19 +41,29 @@ namespace Aaru.DiscImages { public sealed partial class SaveDskF { + /// public string Name => "IBM SaveDskF"; + /// public Guid Id => new Guid("288CE058-1A51-4034-8C45-5A256CAE1461"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "IBM SaveDskF"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; // TODO: Test with real hardware to see real supported media + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.ACORN_35_DS_DD, MediaType.ACORN_35_DS_HD, MediaType.Apricot_35, MediaType.ATARI_35_DS_DD, @@ -64,15 +74,19 @@ namespace Aaru.DiscImages MediaType.FDFORMAT_35_DD, MediaType.FDFORMAT_35_HD, MediaType.FDFORMAT_525_DD, MediaType.FDFORMAT_525_HD, MediaType.RX50, MediaType.XDF_35, MediaType.XDF_525 }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".dsk" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/SaveDskF/Read.cs b/Aaru.Images/SaveDskF/Read.cs index b7b5f80a5..042a4ab43 100644 --- a/Aaru.Images/SaveDskF/Read.cs +++ b/Aaru.Images/SaveDskF/Read.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class SaveDskF { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -137,8 +138,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/SaveDskF/SaveDskF.cs b/Aaru.Images/SaveDskF/SaveDskF.cs index 3090b82b2..678fa39a6 100644 --- a/Aaru.Images/SaveDskF/SaveDskF.cs +++ b/Aaru.Images/SaveDskF/SaveDskF.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing IBM's SaveDskF disk images + /// public sealed partial class SaveDskF : IWritableImage, IVerifiableImage { uint _calculatedChk; diff --git a/Aaru.Images/SaveDskF/Unsupported.cs b/Aaru.Images/SaveDskF/Unsupported.cs index 3e91da34c..efeabed27 100644 --- a/Aaru.Images/SaveDskF/Unsupported.cs +++ b/Aaru.Images/SaveDskF/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class SaveDskF { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/SaveDskF/Verify.cs b/Aaru.Images/SaveDskF/Verify.cs index 5e1be80a6..9196695ea 100644 --- a/Aaru.Images/SaveDskF/Verify.cs +++ b/Aaru.Images/SaveDskF/Verify.cs @@ -34,6 +34,7 @@ namespace Aaru.DiscImages { public sealed partial class SaveDskF { + /// public bool? VerifyMediaImage() => _calculatedChk == _header.checksum; } } \ No newline at end of file diff --git a/Aaru.Images/SaveDskF/Write.cs b/Aaru.Images/SaveDskF/Write.cs index 7488bb341..1e746f9be 100644 --- a/Aaru.Images/SaveDskF/Write.cs +++ b/Aaru.Images/SaveDskF/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class SaveDskF { + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -52,6 +53,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -83,6 +85,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -114,6 +117,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -121,6 +125,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -128,6 +133,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -188,6 +194,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Comments = metadata.Comments; @@ -195,6 +202,7 @@ namespace Aaru.DiscImages return true; } + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -257,8 +265,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -266,6 +276,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -273,8 +284,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/SuperCardPro/Identify.cs b/Aaru.Images/SuperCardPro/Identify.cs index 1b9c45acd..a83beb67f 100644 --- a/Aaru.Images/SuperCardPro/Identify.cs +++ b/Aaru.Images/SuperCardPro/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class SuperCardPro { + /// public bool Identify(IFilter imageFilter) { Header = new ScpHeader(); diff --git a/Aaru.Images/SuperCardPro/Properties.cs b/Aaru.Images/SuperCardPro/Properties.cs index 98b4f43af..dae6dd3c7 100644 --- a/Aaru.Images/SuperCardPro/Properties.cs +++ b/Aaru.Images/SuperCardPro/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class SuperCardPro { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "SuperCardPro"; + /// public Guid Id => new Guid("C5D3182E-1D45-4767-A205-E6E5C83444DC"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "SuperCardPro"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/SuperCardPro/Read.cs b/Aaru.Images/SuperCardPro/Read.cs index 024ce8463..de05814db 100644 --- a/Aaru.Images/SuperCardPro/Read.cs +++ b/Aaru.Images/SuperCardPro/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class SuperCardPro { + /// public bool Open(IFilter imageFilter) { Header = new ScpHeader(); @@ -253,23 +254,30 @@ namespace Aaru.DiscImages throw new NotImplementedException("Flux decoding is not yet implemented."); } + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new NotImplementedException("Flux decoding is not yet implemented."); } diff --git a/Aaru.Images/SuperCardPro/SuperCardPro.cs b/Aaru.Images/SuperCardPro/SuperCardPro.cs index 2ad171fb7..64f43551b 100644 --- a/Aaru.Images/SuperCardPro/SuperCardPro.cs +++ b/Aaru.Images/SuperCardPro/SuperCardPro.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading SuperCardPro flux images + /// public sealed partial class SuperCardPro : IMediaImage, IVerifiableImage, IVerifiableSectorsImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/SuperCardPro/Verify.cs b/Aaru.Images/SuperCardPro/Verify.cs index b9d23596c..f9e89aacb 100644 --- a/Aaru.Images/SuperCardPro/Verify.cs +++ b/Aaru.Images/SuperCardPro/Verify.cs @@ -37,6 +37,7 @@ namespace Aaru.DiscImages { public sealed partial class SuperCardPro { + /// public bool? VerifyMediaImage() { if(Header.flags.HasFlag(ScpFlags.Writable)) @@ -54,9 +55,11 @@ namespace Aaru.DiscImages return Header.checksum == sum; } + /// public bool? VerifySector(ulong sectorAddress) => throw new NotImplementedException("Flux decoding is not yet implemented."); + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) => throw new NotImplementedException("Flux decoding is not yet implemented."); diff --git a/Aaru.Images/T98/Identify.cs b/Aaru.Images/T98/Identify.cs index 8dae8b40c..1f4e5c8ad 100644 --- a/Aaru.Images/T98/Identify.cs +++ b/Aaru.Images/T98/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class T98 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/T98/Properties.cs b/Aaru.Images/T98/Properties.cs index 0e179ed2a..adad0ccc5 100644 --- a/Aaru.Images/T98/Properties.cs +++ b/Aaru.Images/T98/Properties.cs @@ -41,31 +41,45 @@ namespace Aaru.DiscImages { public sealed partial class T98 { + /// public string Name => "T98 Hard Disk Image"; + /// public Guid Id => new Guid("0410003E-6E7B-40E6-9328-BA5651ADF6B7"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "T98 disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".t98" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/T98/Read.cs b/Aaru.Images/T98/Read.cs index 2a6590f5e..f1c987749 100644 --- a/Aaru.Images/T98/Read.cs +++ b/Aaru.Images/T98/Read.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class T98 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -75,8 +76,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/T98/T98.cs b/Aaru.Images/T98/T98.cs index e9850178c..b44819787 100644 --- a/Aaru.Images/T98/T98.cs +++ b/Aaru.Images/T98/T98.cs @@ -38,6 +38,10 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// + /// Implements reading and writing T98 disk images + /// public sealed partial class T98 : IWritableImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/T98/Unsupported.cs b/Aaru.Images/T98/Unsupported.cs index 11e6e0eeb..523f8c774 100644 --- a/Aaru.Images/T98/Unsupported.cs +++ b/Aaru.Images/T98/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class T98 { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/T98/Write.cs b/Aaru.Images/T98/Write.cs index 0698846ec..bc6ccdb82 100644 --- a/Aaru.Images/T98/Write.cs +++ b/Aaru.Images/T98/Write.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class T98 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -84,6 +85,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -91,6 +93,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -122,6 +125,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -153,6 +157,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -160,6 +165,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -167,6 +173,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -189,8 +196,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -198,6 +207,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -205,10 +215,13 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; + /// public bool SetMetadata(ImageInfo metadata) => true; } } \ No newline at end of file diff --git a/Aaru.Images/TeleDisk/Identify.cs b/Aaru.Images/TeleDisk/Identify.cs index a28893d6f..693070da0 100644 --- a/Aaru.Images/TeleDisk/Identify.cs +++ b/Aaru.Images/TeleDisk/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class TeleDisk { + /// public bool Identify(IFilter imageFilter) { _header = new Header(); diff --git a/Aaru.Images/TeleDisk/Properties.cs b/Aaru.Images/TeleDisk/Properties.cs index e90dbcae7..b8a89a640 100644 --- a/Aaru.Images/TeleDisk/Properties.cs +++ b/Aaru.Images/TeleDisk/Properties.cs @@ -39,13 +39,20 @@ namespace Aaru.DiscImages { public sealed partial class TeleDisk { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Sydex TeleDisk"; + /// public Guid Id => new Guid("0240B7B1-E959-4CDC-B0BD-386D6E467B88"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Sydex TeleDisk"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/TeleDisk/Read.cs b/Aaru.Images/TeleDisk/Read.cs index a7de665fc..854033fa5 100644 --- a/Aaru.Images/TeleDisk/Read.cs +++ b/Aaru.Images/TeleDisk/Read.cs @@ -43,6 +43,7 @@ namespace Aaru.DiscImages { public sealed partial class TeleDisk { + /// public bool Open(IFilter imageFilter) { _header = new Header(); @@ -528,6 +529,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { (ushort cylinder, byte head, byte sector) = LbaToChs(sectorAddress); @@ -544,6 +546,7 @@ namespace Aaru.DiscImages return _sectorsData[cylinder][head][sector]; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -563,10 +566,13 @@ namespace Aaru.DiscImages return buffer.ToArray(); } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => ReadSectors(sectorAddress, length); + /// public byte[] ReadDiskTag(MediaTagType tag) { if(tag != MediaTagType.Floppy_LeadOut) diff --git a/Aaru.Images/TeleDisk/TeleDisk.cs b/Aaru.Images/TeleDisk/TeleDisk.cs index 09d5a63b7..219981471 100644 --- a/Aaru.Images/TeleDisk/TeleDisk.cs +++ b/Aaru.Images/TeleDisk/TeleDisk.cs @@ -40,6 +40,9 @@ namespace Aaru.DiscImages { // Created following notes from Dave Dunfield // http://www.classiccmp.org/dunfield/img54306/td0notes.txt + /// + /// Implements reading of Sydex TeleDisk disk images + /// public sealed partial class TeleDisk : IMediaImage, IVerifiableImage, IVerifiableSectorsImage { readonly List _sectorsWhereCrcHasFailed; diff --git a/Aaru.Images/TeleDisk/Unsupported.cs b/Aaru.Images/TeleDisk/Unsupported.cs index 1c1e9bc19..a733b8441 100644 --- a/Aaru.Images/TeleDisk/Unsupported.cs +++ b/Aaru.Images/TeleDisk/Unsupported.cs @@ -37,9 +37,11 @@ namespace Aaru.DiscImages { public sealed partial class TeleDisk { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/TeleDisk/Verify.cs b/Aaru.Images/TeleDisk/Verify.cs index f164d7187..a6398556e 100644 --- a/Aaru.Images/TeleDisk/Verify.cs +++ b/Aaru.Images/TeleDisk/Verify.cs @@ -36,10 +36,13 @@ namespace Aaru.DiscImages { public sealed partial class TeleDisk { + /// public bool? VerifyMediaImage() => _aDiskCrcHasFailed; + /// public bool? VerifySector(ulong sectorAddress) => !_sectorsWhereCrcHasFailed.Contains(sectorAddress); + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/UDIF/Identify.cs b/Aaru.Images/UDIF/Identify.cs index f7c014923..6b071ac5f 100644 --- a/Aaru.Images/UDIF/Identify.cs +++ b/Aaru.Images/UDIF/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Udif { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/UDIF/Properties.cs b/Aaru.Images/UDIF/Properties.cs index bf8a2b434..bd71fef04 100644 --- a/Aaru.Images/UDIF/Properties.cs +++ b/Aaru.Images/UDIF/Properties.cs @@ -41,32 +41,46 @@ namespace Aaru.DiscImages { public sealed partial class Udif { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Apple Universal Disk Image Format"; + /// public Guid Id => new Guid("5BEB9002-CF3D-429C-8E06-9A96F49203FF"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Apple Universal Disk Image Format"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".dmg" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/UDIF/Read.cs b/Aaru.Images/UDIF/Read.cs index 07ff6b474..fd0f6c3ce 100644 --- a/Aaru.Images/UDIF/Read.cs +++ b/Aaru.Images/UDIF/Read.cs @@ -54,6 +54,7 @@ namespace Aaru.DiscImages { public sealed partial class Udif { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -395,6 +396,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -553,6 +555,7 @@ namespace Aaru.DiscImages throw new ImageNotSupportedException($"Unsupported chunk type 0x{readChunk.type:X8} found"); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/UDIF/UDIF.cs b/Aaru.Images/UDIF/UDIF.cs index 2cee68c69..bba3e0460 100644 --- a/Aaru.Images/UDIF/UDIF.cs +++ b/Aaru.Images/UDIF/UDIF.cs @@ -41,6 +41,10 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// + /// Implements reading and writing Apple's Universal Disk Image Format disk images + /// public sealed partial class Udif : IWritableImage { uint _buffersize; diff --git a/Aaru.Images/UDIF/Unsupported.cs b/Aaru.Images/UDIF/Unsupported.cs index eb15869f2..4283fd4d2 100644 --- a/Aaru.Images/UDIF/Unsupported.cs +++ b/Aaru.Images/UDIF/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Udif { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/UDIF/Write.cs b/Aaru.Images/UDIF/Write.cs index 452607f34..bd5e0ec6e 100644 --- a/Aaru.Images/UDIF/Write.cs +++ b/Aaru.Images/UDIF/Write.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class Udif { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -94,6 +95,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -101,6 +103,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -171,6 +174,7 @@ namespace Aaru.DiscImages } // TODO: This can be optimized + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -231,6 +235,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -238,6 +243,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -245,6 +251,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -401,10 +408,13 @@ namespace Aaru.DiscImages } // TODO: Comments + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -412,6 +422,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -419,8 +430,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/UkvFdi/Identify.cs b/Aaru.Images/UkvFdi/Identify.cs index 5836bcb6f..8d7e1bdb9 100644 --- a/Aaru.Images/UkvFdi/Identify.cs +++ b/Aaru.Images/UkvFdi/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class UkvFdi { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/UkvFdi/Properties.cs b/Aaru.Images/UkvFdi/Properties.cs index 2c38928c8..601f6a672 100644 --- a/Aaru.Images/UkvFdi/Properties.cs +++ b/Aaru.Images/UkvFdi/Properties.cs @@ -39,12 +39,19 @@ namespace Aaru.DiscImages { public sealed partial class UkvFdi { + /// public string Name => "Spectrum Floppy Disk Image"; + /// public Guid Id => new Guid("DADFC9B2-67C1-42A3-B124-825528163FC0"); + /// public string Format => "Spectrum floppy disk image"; + /// public string Author => "Natalia Portillo"; + /// public ImageInfo Info => _imageInfo; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/UkvFdi/Read.cs b/Aaru.Images/UkvFdi/Read.cs index 307661932..d5b3ce5b8 100644 --- a/Aaru.Images/UkvFdi/Read.cs +++ b/Aaru.Images/UkvFdi/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class UkvFdi { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -184,6 +185,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { (ushort cylinder, byte head, byte sector) = LbaToChs(sectorAddress); @@ -200,6 +202,7 @@ namespace Aaru.DiscImages return _sectorsData[cylinder][head][sector - 1]; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/UkvFdi/UkvFdi.cs b/Aaru.Images/UkvFdi/UkvFdi.cs index 81e12229a..64e05a453 100644 --- a/Aaru.Images/UkvFdi/UkvFdi.cs +++ b/Aaru.Images/UkvFdi/UkvFdi.cs @@ -37,6 +37,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading UKV FDI disk images + /// public sealed partial class UkvFdi : IMediaImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/UkvFdi/Unsupported.cs b/Aaru.Images/UkvFdi/Unsupported.cs index 73d5af458..971cbd508 100644 --- a/Aaru.Images/UkvFdi/Unsupported.cs +++ b/Aaru.Images/UkvFdi/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class UkvFdi { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/VDI/Identify.cs b/Aaru.Images/VDI/Identify.cs index 9b44b63b9..4dcf790d7 100644 --- a/Aaru.Images/VDI/Identify.cs +++ b/Aaru.Images/VDI/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Vdi { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/VDI/Properties.cs b/Aaru.Images/VDI/Properties.cs index 59021e241..1931314a2 100644 --- a/Aaru.Images/VDI/Properties.cs +++ b/Aaru.Images/VDI/Properties.cs @@ -41,18 +41,28 @@ namespace Aaru.DiscImages { public sealed partial class Vdi { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "VirtualBox Disk Image"; + /// public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "VDI"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.Unknown, MediaType.GENERIC_HDD, MediaType.FlashDrive, MediaType.CompactFlash, @@ -61,14 +71,18 @@ namespace Aaru.DiscImages }; // TODO: Add cluster size option + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".vdi" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/VDI/Read.cs b/Aaru.Images/VDI/Read.cs index 9cec6e674..83518741b 100644 --- a/Aaru.Images/VDI/Read.cs +++ b/Aaru.Images/VDI/Read.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Vdi { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -192,6 +193,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -225,6 +227,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/VDI/Unsupported.cs b/Aaru.Images/VDI/Unsupported.cs index 278e36920..5dd3bf52f 100644 --- a/Aaru.Images/VDI/Unsupported.cs +++ b/Aaru.Images/VDI/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Vdi { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/VDI/VDI.cs b/Aaru.Images/VDI/VDI.cs index 59250b688..e809c4c38 100644 --- a/Aaru.Images/VDI/VDI.cs +++ b/Aaru.Images/VDI/VDI.cs @@ -40,6 +40,9 @@ namespace Aaru.DiscImages { // TODO: Support version 0 // TODO: Support fixed images + /// + /// Implements reading and writing VirtualBox disk images + /// public sealed partial class Vdi : IWritableImage { ulong _currentWritingPosition; diff --git a/Aaru.Images/VDI/Write.cs b/Aaru.Images/VDI/Write.cs index a29291901..c9ca16929 100644 --- a/Aaru.Images/VDI/Write.cs +++ b/Aaru.Images/VDI/Write.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class Vdi { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -128,6 +129,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -135,6 +137,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -187,6 +190,7 @@ namespace Aaru.DiscImages } // TODO: This can be optimized + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -228,6 +232,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -235,6 +240,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -242,6 +248,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -301,6 +308,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Comments = metadata.Comments; @@ -308,6 +316,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { _vHdr.cylinders = cylinders; @@ -317,6 +326,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -324,6 +334,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -331,8 +342,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/VHD/Properties.cs b/Aaru.Images/VHD/Properties.cs index 119847d0a..14d6c06b1 100644 --- a/Aaru.Images/VHD/Properties.cs +++ b/Aaru.Images/VHD/Properties.cs @@ -41,12 +41,17 @@ namespace Aaru.DiscImages { public sealed partial class Vhd { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "VirtualPC"; + /// public Guid Id => new Guid("8014d88f-64cd-4484-9441-7635c632958a"); + /// public string Author => "Natalia Portillo"; + /// public string Format { get @@ -61,12 +66,17 @@ namespace Aaru.DiscImages } } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, @@ -75,14 +85,18 @@ namespace Aaru.DiscImages }; // TODO: Support dynamic images + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".vhd" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/VHD/Read.cs b/Aaru.Images/VHD/Read.cs index b1f6d21bf..00b24dc2d 100644 --- a/Aaru.Images/VHD/Read.cs +++ b/Aaru.Images/VHD/Read.cs @@ -46,6 +46,7 @@ namespace Aaru.DiscImages { public sealed partial class Vhd { + /// public bool Open(IFilter imageFilter) { Stream imageStream = imageFilter.GetDataForkStream(); @@ -657,6 +658,7 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSector(ulong sectorAddress) { switch(_thisFooter.DiskType) @@ -728,6 +730,7 @@ namespace Aaru.DiscImages } } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { switch(_thisFooter.DiskType) diff --git a/Aaru.Images/VHD/Unsupported.cs b/Aaru.Images/VHD/Unsupported.cs index 431a4a69e..ed9c29172 100644 --- a/Aaru.Images/VHD/Unsupported.cs +++ b/Aaru.Images/VHD/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Vhd { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/VHD/VHD.cs b/Aaru.Images/VHD/VHD.cs index b8cffa797..3ca1f916d 100644 --- a/Aaru.Images/VHD/VHD.cs +++ b/Aaru.Images/VHD/VHD.cs @@ -41,9 +41,9 @@ namespace Aaru.DiscImages { /// /// - /// Supports Connectix/Microsoft Virtual PC hard disk image format Until Virtual PC 5 there existed no format, and - /// the hard disk image was merely a sector by sector (RAW) image with a resource fork giving information to Virtual PC - /// itself. + /// Supports Connectix/Microsoft Virtual PC hard disk image format. + /// Until Virtual PC 5 there existed no format, and the hard disk image was merely a sector by sector (RAW) + /// image with a resource fork giving information to Virtual PC itself. /// public sealed partial class Vhd : IWritableImage { diff --git a/Aaru.Images/VHD/Write.cs b/Aaru.Images/VHD/Write.cs index 6cb648883..fdba157cf 100644 --- a/Aaru.Images/VHD/Write.cs +++ b/Aaru.Images/VHD/Write.cs @@ -47,6 +47,7 @@ namespace Aaru.DiscImages { public sealed partial class Vhd { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -88,6 +89,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -95,6 +97,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -127,6 +130,7 @@ namespace Aaru.DiscImages } // TODO: Implement dynamic + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -158,6 +162,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -165,6 +170,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -172,6 +178,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -258,8 +265,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > 0xFFFF) @@ -290,6 +299,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -297,6 +307,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -304,8 +315,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/VHDX/Identify.cs b/Aaru.Images/VHDX/Identify.cs index 850e2034a..a68b2c683 100644 --- a/Aaru.Images/VHDX/Identify.cs +++ b/Aaru.Images/VHDX/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class Vhdx { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/VHDX/Properties.cs b/Aaru.Images/VHDX/Properties.cs index 3b7cf3402..39a54964e 100644 --- a/Aaru.Images/VHDX/Properties.cs +++ b/Aaru.Images/VHDX/Properties.cs @@ -39,13 +39,20 @@ namespace Aaru.DiscImages { public sealed partial class Vhdx { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Microsoft VHDX"; + /// public Guid Id => new Guid("536B141B-D09C-4799-AB70-34631286EB9D"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "VHDX"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/VHDX/Read.cs b/Aaru.Images/VHDX/Read.cs index bff8aa394..5d8bbf063 100644 --- a/Aaru.Images/VHDX/Read.cs +++ b/Aaru.Images/VHDX/Read.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Vhdx { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -428,6 +429,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -487,6 +489,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/VHDX/Unsupported.cs b/Aaru.Images/VHDX/Unsupported.cs index 9e48821ee..5ba53609b 100644 --- a/Aaru.Images/VHDX/Unsupported.cs +++ b/Aaru.Images/VHDX/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Vhdx { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/VHDX/VHDX.cs b/Aaru.Images/VHDX/VHDX.cs index 069a7c068..0d5eea24f 100644 --- a/Aaru.Images/VHDX/VHDX.cs +++ b/Aaru.Images/VHDX/VHDX.cs @@ -41,6 +41,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading Hyper-V disk images + /// public sealed partial class Vhdx : IMediaImage { long _batOffset; diff --git a/Aaru.Images/VMware/Identify.cs b/Aaru.Images/VMware/Identify.cs index 3e53ed458..f55f19683 100644 --- a/Aaru.Images/VMware/Identify.cs +++ b/Aaru.Images/VMware/Identify.cs @@ -39,6 +39,7 @@ namespace Aaru.DiscImages { public sealed partial class VMware { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/VMware/Properties.cs b/Aaru.Images/VMware/Properties.cs index 2f7a1f9bc..42bf170ba 100644 --- a/Aaru.Images/VMware/Properties.cs +++ b/Aaru.Images/VMware/Properties.cs @@ -41,24 +41,35 @@ namespace Aaru.DiscImages { public sealed partial class VMware { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "VMware disk image"; + /// public Guid Id => new Guid("E314DE35-C103-48A3-AD36-990F68523C46"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "VMware"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { ("adapter_type", typeof(string), @@ -67,11 +78,14 @@ namespace Aaru.DiscImages ("sparse", typeof(bool), "Use sparse extents.", (object)false), ("split", typeof(bool), "Split data file at 2GiB.", (object)false) }; + /// public IEnumerable KnownExtensions => new[] { ".vmdk" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/VMware/Read.cs b/Aaru.Images/VMware/Read.cs index b208c1070..74fd57989 100644 --- a/Aaru.Images/VMware/Read.cs +++ b/Aaru.Images/VMware/Read.cs @@ -48,6 +48,7 @@ namespace Aaru.DiscImages { public sealed partial class VMware { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -525,6 +526,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { if(sectorAddress > _imageInfo.Sectors - 1) @@ -625,6 +627,7 @@ namespace Aaru.DiscImages return sector; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/VMware/Unsupported.cs b/Aaru.Images/VMware/Unsupported.cs index 5a57e66cb..7a8e7424e 100644 --- a/Aaru.Images/VMware/Unsupported.cs +++ b/Aaru.Images/VMware/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class VMware { + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/VMware/VMware.cs b/Aaru.Images/VMware/VMware.cs index 41dace06f..44a9a4530 100644 --- a/Aaru.Images/VMware/VMware.cs +++ b/Aaru.Images/VMware/VMware.cs @@ -38,6 +38,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading VMware disk images + /// public sealed partial class VMware : IWritableImage { string _adapterType; diff --git a/Aaru.Images/VMware/Write.cs b/Aaru.Images/VMware/Write.cs index 149d5b79b..486c328e5 100644 --- a/Aaru.Images/VMware/Write.cs +++ b/Aaru.Images/VMware/Write.cs @@ -44,6 +44,7 @@ namespace Aaru.DiscImages { public sealed partial class VMware { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -167,6 +168,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -174,6 +176,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -206,6 +209,7 @@ namespace Aaru.DiscImages } // TODO: Implement sparse and split + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -237,6 +241,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -244,6 +249,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -252,6 +258,7 @@ namespace Aaru.DiscImages } // TODO: Implement sparse and split + /// public bool Close() { if(!IsWriting) @@ -316,8 +323,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > ushort.MaxValue) @@ -348,6 +357,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -355,6 +365,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -362,8 +373,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/Virtual98/Identify.cs b/Aaru.Images/Virtual98/Identify.cs index e19d9a886..92b2158e5 100644 --- a/Aaru.Images/Virtual98/Identify.cs +++ b/Aaru.Images/Virtual98/Identify.cs @@ -41,6 +41,7 @@ namespace Aaru.DiscImages { public sealed partial class Virtual98 { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/Virtual98/Properties.cs b/Aaru.Images/Virtual98/Properties.cs index 70fe3d5e7..7fe9dfd80 100644 --- a/Aaru.Images/Virtual98/Properties.cs +++ b/Aaru.Images/Virtual98/Properties.cs @@ -41,31 +41,45 @@ namespace Aaru.DiscImages { public sealed partial class Virtual98 { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "Virtual98 Disk Image"; + /// public Guid Id => new Guid("C0CDE13D-04D0-4913-8740-AFAA44D0A107"); + /// public string Author => "Natalia Portillo"; + /// public string Format => "Virtual98 disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; + /// public IEnumerable SupportedMediaTags => new MediaTagType[] {}; + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes => new[] { MediaType.GENERIC_HDD, MediaType.Unknown, MediaType.FlashDrive, MediaType.CompactFlash, MediaType.CompactFlashType2, MediaType.PCCardTypeI, MediaType.PCCardTypeII, MediaType.PCCardTypeIII, MediaType.PCCardTypeIV }; + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".v98" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/Virtual98/Read.cs b/Aaru.Images/Virtual98/Read.cs index b820a1022..14256d771 100644 --- a/Aaru.Images/Virtual98/Read.cs +++ b/Aaru.Images/Virtual98/Read.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class Virtual98 { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -77,8 +78,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(sectorAddress > _imageInfo.Sectors - 1) diff --git a/Aaru.Images/Virtual98/Unsupported.cs b/Aaru.Images/Virtual98/Unsupported.cs index 225f051e2..cc0f2ebd4 100644 --- a/Aaru.Images/Virtual98/Unsupported.cs +++ b/Aaru.Images/Virtual98/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class Virtual98 { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/Virtual98/Virtual98.cs b/Aaru.Images/Virtual98/Virtual98.cs index b5ff6e6cb..e12fd885b 100644 --- a/Aaru.Images/Virtual98/Virtual98.cs +++ b/Aaru.Images/Virtual98/Virtual98.cs @@ -39,6 +39,9 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { // Info from Neko Project II emulator + /// + /// Implements reading Virtual98 disk images + /// public sealed partial class Virtual98 : IWritableImage { ImageInfo _imageInfo; diff --git a/Aaru.Images/Virtual98/Write.cs b/Aaru.Images/Virtual98/Write.cs index 9699d1c39..b456f9324 100644 --- a/Aaru.Images/Virtual98/Write.cs +++ b/Aaru.Images/Virtual98/Write.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class Virtual98 { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -93,6 +94,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { ErrorMessage = "Writing media tags is not supported."; @@ -100,6 +102,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -131,6 +134,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -162,6 +166,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -169,6 +174,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -176,6 +182,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -249,6 +256,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) { _imageInfo.Comments = metadata.Comments; @@ -256,6 +264,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) { if(cylinders > ushort.MaxValue) @@ -286,6 +295,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -293,6 +303,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -300,8 +311,10 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; } } \ No newline at end of file diff --git a/Aaru.Images/WCDiskImage/Identify.cs b/Aaru.Images/WCDiskImage/Identify.cs index 0880d222b..182d18333 100644 --- a/Aaru.Images/WCDiskImage/Identify.cs +++ b/Aaru.Images/WCDiskImage/Identify.cs @@ -40,6 +40,7 @@ namespace Aaru.DiscImages { public sealed partial class WCDiskImage { + /// public bool Identify(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); diff --git a/Aaru.Images/WCDiskImage/Properties.cs b/Aaru.Images/WCDiskImage/Properties.cs index 912b9a34f..55f266e88 100644 --- a/Aaru.Images/WCDiskImage/Properties.cs +++ b/Aaru.Images/WCDiskImage/Properties.cs @@ -40,13 +40,20 @@ namespace Aaru.DiscImages { public sealed partial class WCDiskImage { + /// public ImageInfo Info => _imageInfo; + /// public string Name => "d2f disk image"; + /// public Guid Id => new Guid("DDE01493-BCA2-41C2-A269-7E56D3716D2F"); + /// public string Author => "Michael DrĂ¼ing"; + /// public string Format => "d2f disk image"; + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata => null; } } \ No newline at end of file diff --git a/Aaru.Images/WCDiskImage/Read.cs b/Aaru.Images/WCDiskImage/Read.cs index db69e1991..fec67c75b 100644 --- a/Aaru.Images/WCDiskImage/Read.cs +++ b/Aaru.Images/WCDiskImage/Read.cs @@ -45,6 +45,7 @@ namespace Aaru.DiscImages { public sealed partial class WCDiskImage { + /// public bool Open(IFilter imageFilter) { string comments = string.Empty; @@ -161,6 +162,7 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) { int sectorNumber = (int)(sectorAddress % _imageInfo.SectorsPerTrack) + 1; @@ -184,6 +186,7 @@ namespace Aaru.DiscImages return _sectorCache[(cylinderNumber, headNumber, sectorNumber)]; } + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { byte[] result = new byte[length * _imageInfo.SectorSize]; diff --git a/Aaru.Images/WCDiskImage/Unsupported.cs b/Aaru.Images/WCDiskImage/Unsupported.cs index a6b97b275..643ce46b4 100644 --- a/Aaru.Images/WCDiskImage/Unsupported.cs +++ b/Aaru.Images/WCDiskImage/Unsupported.cs @@ -37,18 +37,23 @@ namespace Aaru.DiscImages { public sealed partial class WCDiskImage { + /// public byte[] ReadDiskTag(MediaTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorLong(ulong sectorAddress) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) => throw new FeatureUnsupportedImageException("Feature not supported by image format"); } diff --git a/Aaru.Images/WCDiskImage/WCDiskImage.cs b/Aaru.Images/WCDiskImage/WCDiskImage.cs index c1f6e19e0..65a3ac522 100644 --- a/Aaru.Images/WCDiskImage/WCDiskImage.cs +++ b/Aaru.Images/WCDiskImage/WCDiskImage.cs @@ -39,7 +39,12 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// + /// Manages floppy disk images created with d2f by DataPackRat + /// [SuppressMessage("ReSharper", "NotAccessedField.Local")] + [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed partial class WCDiskImage : IMediaImage { readonly Dictionary<(int cylinder, int head, int sector), bool> _badSectors = @@ -55,6 +60,9 @@ namespace Aaru.DiscImages /// The ImageFilter we're reading from, after the file has been opened IFilter _wcImageFilter; + /// + /// Manages floppy disk images created with d2f by DataPackRat + /// public WCDiskImage() => _imageInfo = new ImageInfo { ReadableSectorTags = new List(), diff --git a/Aaru.Images/ZZZRawImage/Identify.cs b/Aaru.Images/ZZZRawImage/Identify.cs index 3d7d51ef9..4f261c68d 100644 --- a/Aaru.Images/ZZZRawImage/Identify.cs +++ b/Aaru.Images/ZZZRawImage/Identify.cs @@ -38,6 +38,7 @@ namespace Aaru.DiscImages { public sealed partial class ZZZRawImage { + /// public bool Identify(IFilter imageFilter) { _extension = Path.GetExtension(imageFilter.GetFilename())?.ToLower(); diff --git a/Aaru.Images/ZZZRawImage/Properties.cs b/Aaru.Images/ZZZRawImage/Properties.cs index 3bf8c8aa0..cfa03032f 100644 --- a/Aaru.Images/ZZZRawImage/Properties.cs +++ b/Aaru.Images/ZZZRawImage/Properties.cs @@ -44,16 +44,23 @@ namespace Aaru.DiscImages { public sealed partial class ZZZRawImage { + /// public OpticalImageCapabilities OpticalCapabilities => OpticalImageCapabilities.CanStoreDataTracks | OpticalImageCapabilities.CanStoreCookedData; + /// public string Name => "Raw Disk Image"; // Non-random UUID to recognize this specific plugin + /// public Guid Id => new Guid("12345678-AAAA-BBBB-CCCC-123456789000"); + /// public ImageInfo Info => _imageInfo; + /// public string Author => "Natalia Portillo"; + /// public string Format => "Raw disk image (sector by sector copy)"; + /// public List Tracks { get @@ -102,6 +109,7 @@ namespace Aaru.DiscImages } } + /// public List Sessions { get @@ -127,6 +135,7 @@ namespace Aaru.DiscImages } } + /// public List Partitions { get @@ -158,14 +167,19 @@ namespace Aaru.DiscImages } } + /// public List DumpHardware => null; + /// public CICMMetadataType CicmMetadata { get; private set; } + /// public IEnumerable SupportedMediaTags => _readWriteSidecars.Concat(_writeOnlySidecars). OrderBy(t => t.tag).Select(t => t.tag).ToArray(); + /// public IEnumerable SupportedSectorTags => new SectorTagType[] {}; + /// public IEnumerable SupportedMediaTypes { get @@ -202,15 +216,19 @@ namespace Aaru.DiscImages } } + /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new (string name, Type type, string description, object @default)[] {}; + /// public IEnumerable KnownExtensions => new[] { ".adf", ".adl", ".d81", ".dsk", ".hdf", ".ima", ".img", ".iso", ".ssd", ".st", ".1kn", ".2kn", ".4kn", ".8kn", ".16kn", ".32kn", ".64kn", ".512e", ".512", ".128", ".256" }; + /// public bool IsWriting { get; private set; } + /// public string ErrorMessage { get; private set; } } } \ No newline at end of file diff --git a/Aaru.Images/ZZZRawImage/Read.cs b/Aaru.Images/ZZZRawImage/Read.cs index b50dae80a..7e9f0caaf 100644 --- a/Aaru.Images/ZZZRawImage/Read.cs +++ b/Aaru.Images/ZZZRawImage/Read.cs @@ -57,6 +57,7 @@ namespace Aaru.DiscImages { public sealed partial class ZZZRawImage { + /// public bool Open(IFilter imageFilter) { Stream stream = imageFilter.GetDataForkStream(); @@ -1193,8 +1194,10 @@ namespace Aaru.DiscImages return true; } + /// public byte[] ReadSector(ulong sectorAddress) => ReadSectors(sectorAddress, 1); + /// public byte[] ReadSectors(ulong sectorAddress, uint length) { if(_differentTrackZeroSize) @@ -1258,6 +1261,7 @@ namespace Aaru.DiscImages return buffer; } + /// public List GetSessionTracks(Session session) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1290,6 +1294,7 @@ namespace Aaru.DiscImages return lst; } + /// public List GetSessionTracks(ushort session) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1322,6 +1327,7 @@ namespace Aaru.DiscImages return lst; } + /// public byte[] ReadSector(ulong sectorAddress, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1333,6 +1339,7 @@ namespace Aaru.DiscImages return ReadSector(sectorAddress); } + /// public byte[] ReadSectors(ulong sectorAddress, uint length, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1344,6 +1351,7 @@ namespace Aaru.DiscImages return ReadSectors(sectorAddress, length); } + /// public byte[] ReadSectorLong(ulong sectorAddress, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1355,6 +1363,7 @@ namespace Aaru.DiscImages return ReadSectorsLong(sectorAddress, 1); } + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc) @@ -1366,6 +1375,7 @@ namespace Aaru.DiscImages return ReadSectorsLong(sectorAddress, length); } + /// public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc || @@ -1375,6 +1385,7 @@ namespace Aaru.DiscImages return ReadSectorsTag(sectorAddress, 1, tag); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc || @@ -1503,8 +1514,10 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadSectorLong(ulong sectorAddress) => ReadSectorsLong(sectorAddress, 1); + /// public byte[] ReadSectorsLong(ulong sectorAddress, uint length) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc || @@ -1544,6 +1557,7 @@ namespace Aaru.DiscImages return buffer; } + /// public byte[] ReadDiskTag(MediaTagType tag) { if(_mediaTags.TryGetValue(tag, out byte[] data)) @@ -1552,6 +1566,7 @@ namespace Aaru.DiscImages throw new FeatureNotPresentImageException("Requested tag is not present in image"); } + /// public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc || @@ -1564,6 +1579,7 @@ namespace Aaru.DiscImages return ReadSectorsTag(sectorAddress, 1, track, tag); } + /// public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag) { if(_imageInfo.XmlMediaType != XmlMediaType.OpticalDisc || diff --git a/Aaru.Images/ZZZRawImage/Verify.cs b/Aaru.Images/ZZZRawImage/Verify.cs index 51bdd5177..5cac5b7c8 100644 --- a/Aaru.Images/ZZZRawImage/Verify.cs +++ b/Aaru.Images/ZZZRawImage/Verify.cs @@ -32,12 +32,14 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Aaru.Checksums; namespace Aaru.DiscImages { public sealed partial class ZZZRawImage { + /// public bool? VerifySector(ulong sectorAddress) { if(!_rawCompactDisc) @@ -48,6 +50,7 @@ namespace Aaru.DiscImages return CdChecksums.CheckCdSector(buffer); } + /// public bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas) { @@ -92,6 +95,7 @@ namespace Aaru.DiscImages return failingLbas.Count <= 0; } + /// public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, out List unknownLbas) { diff --git a/Aaru.Images/ZZZRawImage/Write.cs b/Aaru.Images/ZZZRawImage/Write.cs index d879ffbef..eb8b9e4d4 100644 --- a/Aaru.Images/ZZZRawImage/Write.cs +++ b/Aaru.Images/ZZZRawImage/Write.cs @@ -42,6 +42,7 @@ namespace Aaru.DiscImages { public sealed partial class ZZZRawImage { + /// public bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize) { @@ -107,8 +108,10 @@ namespace Aaru.DiscImages return true; } + /// public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) => true; + /// public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -116,6 +119,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag) { ErrorMessage = "Unsupported feature"; @@ -123,10 +127,13 @@ namespace Aaru.DiscImages return false; } + /// public bool SetDumpHardware(List dumpHardware) => false; + /// public bool SetCicmMetadata(CICMMetadataType metadata) => false; + /// public bool WriteMediaTag(byte[] data, MediaTagType tag) { if(!SupportedMediaTags.Contains(tag)) @@ -144,6 +151,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSector(byte[] data, ulong sectorAddress) { if(!IsWriting) @@ -175,6 +183,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) { if(!IsWriting) @@ -206,6 +215,7 @@ namespace Aaru.DiscImages return true; } + /// public bool WriteSectorLong(byte[] data, ulong sectorAddress) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -213,6 +223,7 @@ namespace Aaru.DiscImages return false; } + /// public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length) { ErrorMessage = "Writing sectors with tags is not supported."; @@ -220,6 +231,7 @@ namespace Aaru.DiscImages return false; } + /// public bool SetTracks(List tracks) { if(tracks.Count <= 1) @@ -230,6 +242,7 @@ namespace Aaru.DiscImages return false; } + /// public bool Close() { if(!IsWriting) @@ -261,6 +274,7 @@ namespace Aaru.DiscImages return true; } + /// public bool SetMetadata(ImageInfo metadata) => true; } } \ No newline at end of file diff --git a/Aaru.Images/ZZZRawImage/ZZZRawImage.cs b/Aaru.Images/ZZZRawImage/ZZZRawImage.cs index fc2963411..e0967660d 100644 --- a/Aaru.Images/ZZZRawImage/ZZZRawImage.cs +++ b/Aaru.Images/ZZZRawImage/ZZZRawImage.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Interfaces; @@ -38,6 +39,10 @@ using Aaru.CommonTypes.Structs; namespace Aaru.DiscImages { + /// + /// Implements reading and writing raw (sector by sector) images + /// + [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed partial class ZZZRawImage : IWritableOpticalImage { string _basePath; @@ -51,6 +56,9 @@ namespace Aaru.DiscImages IFilter _rawImageFilter; FileStream _writingStream; + /// + /// Implements reading and writing raw (sector by sector) images + /// public ZZZRawImage() => _imageInfo = new ImageInfo { ReadableSectorTags = new List(), diff --git a/Aaru.Partitions/Acorn.cs b/Aaru.Partitions/Acorn.cs index 1c98ebefc..58935e9ac 100644 --- a/Aaru.Partitions/Acorn.cs +++ b/Aaru.Partitions/Acorn.cs @@ -41,6 +41,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of Acorn partitions + /// public sealed class Acorn : IPartition { const ulong ADFS_SB_POS = 0xC00; @@ -52,10 +55,14 @@ namespace Aaru.Partitions const uint TYPE_RISCIX_SCSI = 2; const uint TYPE_MASK = 15; + /// public string Name => "Acorn FileCore partitions"; + /// public Guid Id => new Guid("A7C8FEBE-8D00-4933-B9F3-42184C8BA808"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/AppleMap.cs b/Aaru.Partitions/AppleMap.cs index 689d46005..f36bf827b 100644 --- a/Aaru.Partitions/AppleMap.cs +++ b/Aaru.Partitions/AppleMap.cs @@ -45,6 +45,9 @@ namespace Aaru.Partitions { // Information about structures learnt from Inside Macintosh // Constants from image testing + /// + /// Implements decoding of the Apple Partition Map + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class AppleMap : IPartition { @@ -57,10 +60,14 @@ namespace Aaru.Partitions /// Old indicator for HFS partition, "TFS1" const uint HFS_MAGIC_OLD = 0x54465331; + /// public string Name => "Apple Partition Map"; + /// public Guid Id => new Guid("36405F8D-4F1A-07F5-209C-223D735D6D22"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { uint sectorSize; diff --git a/Aaru.Partitions/Apricot.cs b/Aaru.Partitions/Apricot.cs index b3c48c040..b3bf45403 100644 --- a/Aaru.Partitions/Apricot.cs +++ b/Aaru.Partitions/Apricot.cs @@ -41,6 +41,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of Apricot partitions + /// public sealed class Apricot : IPartition { readonly int[] _baudRates = @@ -81,10 +84,14 @@ namespace Aaru.Partitions 1, 1.5, 2 }; + /// public string Name => "ACT Apricot partitions"; + /// public Guid Id => new Guid("8CBF5864-7B5A-47A0-8CEB-199C74FA22DE"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/Atari.cs b/Aaru.Partitions/Atari.cs index 8cb7f5b1c..4a39284c1 100644 --- a/Aaru.Partitions/Atari.cs +++ b/Aaru.Partitions/Atari.cs @@ -41,6 +41,9 @@ using Aaru.Helpers; namespace Aaru.Partitions { + /// + /// Implements decoding of Atari GEMDOS partitions + /// public sealed class AtariPartitions : IPartition { const uint TypeGEMDOS = 0x0047454D; @@ -56,10 +59,14 @@ namespace Aaru.Partitions const uint TypeMinix = 0x004D4958; const uint TypeMinix2 = 0x004D4E58; + /// public string Name => "Atari partitions"; + /// public Guid Id => new Guid("d1dd0f24-ec39-4c4d-9072-be31919a3b5e"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/BSD.cs b/Aaru.Partitions/BSD.cs index 123a9f049..ae97d774d 100644 --- a/Aaru.Partitions/BSD.cs +++ b/Aaru.Partitions/BSD.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of BSD disklabels + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class BSD : IPartition { @@ -61,10 +64,14 @@ namespace Aaru.Partitions 0, 9, 64, 128, 516 }; + /// public string Name => "BSD disklabel"; + /// public Guid Id => new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/DEC.cs b/Aaru.Partitions/DEC.cs index 2c77420bb..a1fe78b25 100644 --- a/Aaru.Partitions/DEC.cs +++ b/Aaru.Partitions/DEC.cs @@ -39,15 +39,22 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of DEC disklabels + /// public sealed class DEC : IPartition { const int PT_MAGIC = 0x032957; const int PT_VALID = 1; + /// public string Name => "DEC disklabel"; + /// public Guid Id => new Guid("58CEC3B7-3B93-4D47-86EE-D6DADE9D444F"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { diff --git a/Aaru.Partitions/DragonFlyBSD.cs b/Aaru.Partitions/DragonFlyBSD.cs index 4b4af7619..26d069033 100644 --- a/Aaru.Partitions/DragonFlyBSD.cs +++ b/Aaru.Partitions/DragonFlyBSD.cs @@ -40,15 +40,22 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of DragonFly BSD disklabels + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class DragonFlyBSD : IPartition { const uint DISK_MAGIC64 = 0xC4464C59; + /// public string Name => "DragonFly BSD 64-bit disklabel"; + /// public Guid Id => new Guid("D49E41A6-D952-4760-9D94-03DAE2450C5F"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/GPT.cs b/Aaru.Partitions/GPT.cs index 140a10357..cec176662 100644 --- a/Aaru.Partitions/GPT.cs +++ b/Aaru.Partitions/GPT.cs @@ -43,16 +43,23 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of the GUID Partition Table + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class GuidPartitionTable : IPartition { const ulong GPT_MAGIC = 0x5452415020494645; const uint GPT_REVISION1 = 0x00010000; + /// public string Name => "GUID Partition Table"; + /// public Guid Id => new Guid("CBC9D281-C1D0-44E8-9038-4D66FD2678AB"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/Human68k.cs b/Aaru.Partitions/Human68k.cs index 578a9ad11..030568b40 100644 --- a/Aaru.Partitions/Human68k.cs +++ b/Aaru.Partitions/Human68k.cs @@ -42,14 +42,21 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of Sharp's Human68K partitions + /// public sealed class Human68K : IPartition { const uint X68K_MAGIC = 0x5836384B; + /// public string Name => "Human 68k partitions"; + /// public Guid Id => new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/MBR.cs b/Aaru.Partitions/MBR.cs index 0419d63f4..f3e7f6c3a 100644 --- a/Aaru.Partitions/MBR.cs +++ b/Aaru.Partitions/MBR.cs @@ -44,6 +44,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { // TODO: Support AAP extensions + /// + /// Implements decoding of Intel/Microsoft Master Boot Record and extensions + /// public sealed class MBR : IPartition { const ulong GPT_MAGIC = 0x5452415020494645; @@ -250,10 +253,14 @@ namespace Aaru.Partitions "VMWare VMKCORE", "Linux RAID, FreeDOS", "SpeedStor, LANStep, PS/2 IML", "Xenix bad block" }; + /// public string Name => "Master Boot Record"; + /// public Guid Id => new Guid("5E8A34E8-4F1A-59E6-4BF7-7EA647063A76"); + /// public string Author => "Natalia Portillo"; + /// [SuppressMessage("ReSharper", "UnusedVariable")] public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { diff --git a/Aaru.Partitions/NeXT.cs b/Aaru.Partitions/NeXT.cs index ec8712510..6c10123ad 100644 --- a/Aaru.Partitions/NeXT.cs +++ b/Aaru.Partitions/NeXT.cs @@ -45,6 +45,9 @@ using Marshal = Aaru.Helpers.Marshal; // Information learnt from XNU source and testing against real disks namespace Aaru.Partitions { + /// + /// Implements decoding of NeXT disklabels + /// [SuppressMessage("ReSharper", "UnusedMember.Local"), SuppressMessage("ReSharper", "UnusedType.Local")] public sealed class NeXTDisklabel : IPartition { @@ -59,10 +62,14 @@ namespace Aaru.Partitions /// 44 const ushort DISKTAB_ENTRY_SIZE = 0x2C; + /// public string Name => "NeXT Disklabel"; + /// public Guid Id => new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { bool magicFound = false; diff --git a/Aaru.Partitions/PC98.cs b/Aaru.Partitions/PC98.cs index e9985ddda..cd3eb7672 100644 --- a/Aaru.Partitions/PC98.cs +++ b/Aaru.Partitions/PC98.cs @@ -41,12 +41,19 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of NEC PC-9800 partitions + /// public sealed class PC98 : IPartition { + /// public string Name => "NEC PC-9800 partition table"; + /// public Guid Id => new Guid("27333401-C7C2-447D-961C-22AD0641A09A"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { diff --git a/Aaru.Partitions/Plan9.cs b/Aaru.Partitions/Plan9.cs index e126480b0..0923ace4f 100644 --- a/Aaru.Partitions/Plan9.cs +++ b/Aaru.Partitions/Plan9.cs @@ -44,12 +44,19 @@ namespace Aaru.Partitions // "part type start end\n" // One line per partition, start and end relative to offset // e.g.: "part nvram 10110 10112\npart fossil 10112 3661056\n" + /// + /// Implements decoding of Plan-9 partitions + /// public sealed class Plan9 : IPartition { + /// public string Name => "Plan9 partition table"; + /// public Guid Id => new Guid("F0BF4FFC-056E-4E7C-8B65-4EAEE250ADD9"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/RDB.cs b/Aaru.Partitions/RDB.cs index 7950a55ef..1eabdd183 100644 --- a/Aaru.Partitions/RDB.cs +++ b/Aaru.Partitions/RDB.cs @@ -45,6 +45,9 @@ using Aaru.Helpers; namespace Aaru.Partitions { + /// + /// Implements decoding of the Amiga Rigid Disk Block + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class AmigaRigidDiskBlock : IPartition { @@ -166,10 +169,14 @@ namespace Aaru.Partitions /// Partition should not be mounted automatically const uint FLAGS_NO_AUTOMOUNT = 0x00000002; + /// public string Name => "Amiga Rigid Disk Block"; + /// public Guid Id => new Guid("8D72ED97-1854-4170-9CE4-6E8446FD9863"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/Register.cs b/Aaru.Partitions/Register.cs index 183d8f30f..29050239b 100644 --- a/Aaru.Partitions/Register.cs +++ b/Aaru.Partitions/Register.cs @@ -44,29 +44,40 @@ using Aaru.CommonTypes.Interfaces; namespace Aaru.Partitions { + /// public sealed class Register : IPluginRegister { + /// public List GetAllChecksumPlugins() => null; + /// public List GetAllFilesystemPlugins() => null; + /// public List GetAllFilterPlugins() => null; + /// public List GetAllFloppyImagePlugins() => null; + /// public List GetAllMediaImagePlugins() => null; + /// public List GetAllPartitionPlugins() => Assembly.GetExecutingAssembly().GetTypes(). Where(t => t.GetInterfaces(). Contains(typeof(IPartition))). Where(t => t.IsClass).ToList(); + /// public List GetAllReadOnlyFilesystemPlugins() => null; + /// public List GetAllWritableFloppyImagePlugins() => null; + /// public List GetAllWritableImagePlugins() => null; + /// public List GetAllArchivePlugins() => null; } } diff --git a/Aaru.Partitions/RioKarma.cs b/Aaru.Partitions/RioKarma.cs index 8f13c4131..418d9dc19 100644 --- a/Aaru.Partitions/RioKarma.cs +++ b/Aaru.Partitions/RioKarma.cs @@ -40,15 +40,22 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of Rio Karma partitions + /// public sealed class RioKarma : IPartition { const ushort KARMA_MAGIC = 0xAB56; const byte ENTRY_MAGIC = 0x4D; + /// public string Name => "Rio Karma partitioning"; + /// public Guid Id => new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = null; diff --git a/Aaru.Partitions/SGI.cs b/Aaru.Partitions/SGI.cs index 34a066484..48b74f598 100644 --- a/Aaru.Partitions/SGI.cs +++ b/Aaru.Partitions/SGI.cs @@ -44,15 +44,22 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of the SGI Disk Volume Header + /// [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed class SGI : IPartition { const int SGI_MAGIC = 0x0BE5A941; + /// public string Name => "SGI Disk Volume Header"; + /// public Guid Id => new Guid("AEF5AB45-4880-4CE8-8735-F0A402E2E5F2"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { diff --git a/Aaru.Partitions/Sun.cs b/Aaru.Partitions/Sun.cs index 0d3fc7096..3587854d3 100644 --- a/Aaru.Partitions/Sun.cs +++ b/Aaru.Partitions/Sun.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of Sun disklabels + /// [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed class SunDisklabel : IPartition { @@ -72,10 +75,14 @@ namespace Aaru.Partitions const int LEN_DKL_PAD16 = DK_LABEL_SIZE - (456 + // sizeof(dk_vtoc16) (4 * 4) + (12 * 2) + (2 * 2)); + /// public string Name => "Sun Disklabel"; + /// public Guid Id => new Guid("50F35CC4-8375-4445-8DCB-1BA550C931A3"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/UNIX.cs b/Aaru.Partitions/UNIX.cs index 8b45530c0..3105f303e 100644 --- a/Aaru.Partitions/UNIX.cs +++ b/Aaru.Partitions/UNIX.cs @@ -41,6 +41,9 @@ namespace Aaru.Partitions // These partitions are hardwired in kernel sources for some UNIX versions predating System V. // They depend on exact device, indeed the kernel chooses what to use depending on the disk driver, so that's what we do. // Currently only DEC devices used in Ultrix are added, probably it's missing a lot of entries. + /// + /// Implements decoding of historic UNIX static partitions + /// public sealed class UNIX : IPartition { readonly Partition[] RA60 = @@ -1369,10 +1372,14 @@ namespace Aaru.Partitions } }; + /// public string Name => "UNIX hardwired"; + /// public Guid Id => new Guid("9ED7E30B-53BF-4619-87A0-5D2002155617"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/VTOC.cs b/Aaru.Partitions/VTOC.cs index f1527c7c0..84a73d81d 100644 --- a/Aaru.Partitions/VTOC.cs +++ b/Aaru.Partitions/VTOC.cs @@ -43,6 +43,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of UNIX VTOC partitions + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class VTOC : IPartition { @@ -53,10 +56,14 @@ namespace Aaru.Partitions const int V_NUMPAR = 16; const uint XPDVERS = 3; /* 1st version of extended pdinfo */ + /// public string Name => "UNIX VTOC"; + /// public Guid Id => new Guid("6D35A66F-8D77-426F-A562-D88F6A1F1702"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Partitions/XENIX.cs b/Aaru.Partitions/XENIX.cs index fd4a26a5f..c1402a64e 100644 --- a/Aaru.Partitions/XENIX.cs +++ b/Aaru.Partitions/XENIX.cs @@ -40,6 +40,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { // TODO: Find better documentation, this is working for XENIX 2 but not for SCO OpenServer... + /// + /// Implements decoding of XENIX partitions + /// public sealed class XENIX : IPartition { const ushort PAMAGIC = 0x1234; @@ -49,10 +52,14 @@ namespace Aaru.Partitions // Can't find this in any documentation but everything is aligned to this offset (in sectors) const uint XENIX_OFFSET = 977; + /// public string Name => "XENIX"; + /// public Guid Id => new Guid("53BE01DE-E68B-469F-A17F-EC2E4BD61CD9"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { diff --git a/Aaru.Partitions/Xbox.cs b/Aaru.Partitions/Xbox.cs index 31418ba5b..a3b36a4ca 100644 --- a/Aaru.Partitions/Xbox.cs +++ b/Aaru.Partitions/Xbox.cs @@ -40,6 +40,9 @@ using Marshal = Aaru.Helpers.Marshal; namespace Aaru.Partitions { + /// + /// Implements decoding of Xbox partitions + /// [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed class Xbox : IPartition { @@ -62,10 +65,14 @@ namespace Aaru.Partitions const uint XBOX360_DEVKIT_MAGIC = 0x00020000; + /// public string Name => "Xbox partitioning"; + /// public Guid Id => new Guid("E3F6FB91-D358-4F22-A550-81E92D50EB78"); + /// public string Author => "Natalia Portillo"; + /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); diff --git a/Aaru.Settings/Settings.cs b/Aaru.Settings/Settings.cs index 3bedef9c0..ad53afeb1 100644 --- a/Aaru.Settings/Settings.cs +++ b/Aaru.Settings/Settings.cs @@ -66,7 +66,13 @@ namespace Aaru.Settings /// User settings, for media dumps, completely unused public class UserSettings { + /// + /// User email + /// public string Email; + /// + /// User name or nick + /// public string Name; } @@ -113,7 +119,13 @@ namespace Aaru.Settings /// Global path to save statistics public static string StatsPath { get; private set; } + /// + /// Local database path + /// public static string LocalDbPath { get; private set; } + /// + /// Main database path + /// public static string MainDbPath { get; private set; } /// Loads settings @@ -495,6 +507,9 @@ namespace Aaru.Settings } } + /// + /// Saves current settings + /// public static void SaveSettings() { try diff --git a/Aaru.sln.DotSettings b/Aaru.sln.DotSettings index dd679c9f6..6b9d815e5 100644 --- a/Aaru.sln.DotSettings +++ b/Aaru.sln.DotSettings @@ -498,6 +498,7 @@ True True True + True True True True