2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : LisaFS.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : Apple Lisa filesystem plugin.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Constructors and common variables for the Apple Lisa 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-07-28 18:13:49 +01:00
|
|
|
|
// ****************************************************************************/
|
2014-04-17 19:58:14 +00:00
|
|
|
|
|
2014-04-17 03:45:02 +00:00
|
|
|
|
using System;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
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-07-22 02:18:53 +01:00
|
|
|
|
|
2016-07-21 17:36:51 +01:00
|
|
|
|
namespace DiscImageChef.Filesystems.LisaFS
|
2014-04-17 03:45:02 +00:00
|
|
|
|
{
|
2016-07-28 22:25:26 +01:00
|
|
|
|
// All information by Natalia Portillo
|
|
|
|
|
|
// Variable names from Lisa API
|
2017-12-26 07:23:09 +00:00
|
|
|
|
public partial class LisaFS : IReadOnlyFilesystem
|
2014-04-17 03:45:02 +00: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
|
|
|
|
int devTagSize;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
|
2017-12-27 23:55:59 +00:00
|
|
|
|
MDDF mddf;
|
|
|
|
|
|
bool mounted;
|
2016-07-28 03:41:57 +01:00
|
|
|
|
SRecord[] srecords;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
ulong volumePrefix;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
|
2017-12-27 23:55:59 +00:00
|
|
|
|
public string Name => "Apple Lisa File System";
|
|
|
|
|
|
public Guid Id => new Guid("7E6034D1-D823-4248-A54D-239742B28391");
|
|
|
|
|
|
public Encoding Encoding { get; private set; }
|
2017-12-26 08:01:40 +00:00
|
|
|
|
public FileSystemType XmlFsType { get; private set; }
|
2018-08-29 22:15:43 +01:00
|
|
|
|
public string Author => "Natalia Portillo";
|
2017-12-24 02:37:41 +00:00
|
|
|
|
|
2017-12-28 00:29:04 +00:00
|
|
|
|
// TODO: Implement Lisa 7/7 namespace (needs decoding {!CATALOG} file)
|
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
|
|
|
|
|
2019-04-17 00:11:28 +01:00
|
|
|
|
public Dictionary<string, string> Namespaces =>
|
|
|
|
|
|
new Dictionary<string, string>
|
|
|
|
|
|
{
|
|
|
|
|
|
{"workshop", "Filenames as shown by the Lisa Pascal Workshop (default)"},
|
|
|
|
|
|
{"office", "Filenames as shown by the Lisa Office System (not yet implemented)"}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2018-08-29 22:15:43 +01:00
|
|
|
|
static Dictionary<string, string> GetDefaultOptions() =>
|
|
|
|
|
|
new Dictionary<string, string> {{"debug", false.ToString()}};
|
2017-12-27 23:55:59 +00:00
|
|
|
|
|
2017-12-24 02:37:41 +00:00
|
|
|
|
#region Caches
|
|
|
|
|
|
/// <summary>Caches Extents Files</summary>
|
|
|
|
|
|
Dictionary<short, ExtentFile> extentCache;
|
|
|
|
|
|
/// <summary>Caches system files</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
|
Dictionary<short, byte[]> systemFileCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
/// <summary>Caches user files files</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
|
Dictionary<short, byte[]> fileCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
/// <summary>Caches catalogs</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
|
List<CatalogEntry> catalogCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
/// <summary>Caches file size</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
|
Dictionary<short, int> fileSizeCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
/// <summary>Lists Extents Files already printed in debug mode to not repeat them</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
|
List<short> printedExtents;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
/// <summary>Caches the creation times for subdirectories as to not have to traverse the Catalog File on each stat</summary>
|
2017-12-28 00:29:04 +00:00
|
|
|
|
Dictionary<short, DateTime> directoryDtcCache;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
#endregion Caches
|
2014-04-17 03:45:02 +00:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|