// /*************************************************************************** // 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-2025 Natalia Portillo // ****************************************************************************/ using System; using System.Collections.Generic; using System.Text; using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Structs; 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 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; /// 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; /// 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 { { "debug", false.ToString() } }; } }