2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2016-10-07 00:41:59 +01:00
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : AppleDOS.cs
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// Component : Apple DOS filesystem plugin.
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Constructors and common variables for the Apple DOS 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2018-12-29 17:34:38 +00:00
|
|
|
// Copyright © 2011-2019 Natalia Portillo
|
2016-10-07 00:41:59 +01:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-12-26 08:01:40 +00:00
|
|
|
using System.Text;
|
2018-06-25 19:08:16 +01:00
|
|
|
using DiscImageChef.CommonTypes.Interfaces;
|
2017-12-26 06:05:12 +00:00
|
|
|
using Schemas;
|
2016-10-07 00:41:59 +01:00
|
|
|
|
|
|
|
|
namespace DiscImageChef.Filesystems.AppleDOS
|
|
|
|
|
{
|
2017-12-26 07:23:09 +00:00
|
|
|
public partial class AppleDOS : IReadOnlyFilesystem
|
2016-10-07 00:41:59 +01:00
|
|
|
{
|
2017-12-27 23:55:59 +00:00
|
|
|
bool debug;
|
2017-12-26 08:01:40 +00:00
|
|
|
IMediaImage device;
|
2017-12-27 23:55:59 +00:00
|
|
|
bool mounted;
|
|
|
|
|
int sectorsPerTrack;
|
|
|
|
|
ulong start;
|
|
|
|
|
ulong totalFileEntries;
|
|
|
|
|
bool track1UsedByFiles;
|
|
|
|
|
bool track2UsedByFiles;
|
|
|
|
|
int usedSectors;
|
2016-10-07 00:41:59 +01:00
|
|
|
|
2017-12-24 02:37:41 +00:00
|
|
|
Vtoc vtoc;
|
|
|
|
|
|
2017-12-26 08:01:40 +00:00
|
|
|
public FileSystemType XmlFsType { get; private set; }
|
2017-12-27 23:55:59 +00:00
|
|
|
public Encoding Encoding { get; private set; }
|
|
|
|
|
public string Name => "Apple DOS File System";
|
|
|
|
|
public Guid Id => new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n");
|
2018-08-29 22:15:43 +01:00
|
|
|
public string Author => "Natalia Portillo";
|
2017-12-27 23:55:59 +00:00
|
|
|
|
2017-12-28 18:08:15 +00:00
|
|
|
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
|
2018-06-22 08:08:38 +01:00
|
|
|
new (string name, Type type, string description)[] { };
|
2017-12-28 00:29:04 +00:00
|
|
|
|
2018-08-29 22:15:43 +01:00
|
|
|
static Dictionary<string, string> GetDefaultOptions() =>
|
|
|
|
|
new Dictionary<string, string> {{"debug", false.ToString()}};
|
2017-12-24 02:37:41 +00:00
|
|
|
|
|
|
|
|
#region Caches
|
|
|
|
|
/// <summary>Caches track/sector lists</summary>
|
|
|
|
|
Dictionary<string, byte[]> extentCache;
|
|
|
|
|
/// <summary>Caches files</summary>
|
|
|
|
|
Dictionary<string, byte[]> fileCache;
|
|
|
|
|
/// <summary>Caches catalog</summary>
|
|
|
|
|
Dictionary<string, ushort> catalogCache;
|
|
|
|
|
/// <summary>Caches file size</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
Dictionary<string, int> fileSizeCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
/// <summary>Caches VTOC</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
byte[] vtocBlocks;
|
2017-12-24 02:37:41 +00:00
|
|
|
/// <summary>Caches catalog</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
byte[] catalogBlocks;
|
2017-12-24 02:37:41 +00:00
|
|
|
/// <summary>Caches boot code</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
byte[] bootBlocks;
|
2017-12-24 02:37:41 +00:00
|
|
|
/// <summary>Caches file type</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
Dictionary<string, byte> fileTypeCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
/// <summary>Caches locked files</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
List<string> lockedFiles;
|
2017-12-24 02:37:41 +00:00
|
|
|
#endregion Caches
|
2016-10-07 00:41:59 +01:00
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
}
|