// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : CPM.cs // Author(s) : Natalia Portillo // // Component : CP/M filesystem plugin. // // --[ Description ] ---------------------------------------------------------- // // Constructors and common variables for the CP/M filesystem plugin. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2024 Natalia Portillo // ****************************************************************************/ using System; using System.Collections.Generic; using System.Text; using Aaru.CommonTypes.AaruMetadata; using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Structs; namespace Aaru.Filesystems; /// /// Implements the CP/M filesystem public sealed partial class CPM : IReadOnlyFilesystem { const string MODULE_NAME = "CP/M Plugin"; /// True if thinks this is a CP/M filesystem bool _cpmFound; /// Cached FileSystemInfo _cpmStat; /// Cached file passwords, decoded Dictionary _decodedPasswordCache; /// Stores all known CP/M disk definitions CpmDefinitions _definitions; IMediaImage _device; /// Cached directory listing List _dirList; /// CP/M disc parameter block (on-memory) DiscParameterBlock _dpb; Encoding _encoding; /// Cached file data Dictionary _fileCache; /// The volume label, if the CP/M filesystem contains one string _label; /// Timestamp in volume label for creation byte[] _labelCreationDate; /// Timestamp in volume label for update byte[] _labelUpdateDate; bool _mounted; /// Cached file passwords Dictionary _passwordCache; /// Sector deinterleaving mask int[] _sectorMask; /// True if there are CP/M 3 timestamps bool _standardTimestamps; /// Cached file Dictionary _statCache; /// True if there are timestamps in Z80DOS or DOS+ format bool _thirdPartyTimestamps; /// If thinks this is a CP/M filesystem, this is the definition for it CpmDefinition _workingDefinition; #region IReadOnlyFilesystem Members /// public FileSystem Metadata { get; private set; } /// public string Name => Localization.CPM_Name; /// public Guid Id => new("AA2B8585-41DF-4E3B-8A35-D1A935E2F8A1"); /// public string Author => Authors.NataliaPortillo; /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; #endregion }