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/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Copyright © 2011-2018 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;
|
2017-12-20 17:15:26 +00:00
|
|
|
|
using DiscImageChef.DiscImages;
|
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-24 02:37:41 +00:00
|
|
|
|
bool debug;
|
2017-12-26 08:01:40 +00:00
|
|
|
|
IMediaImage device;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
int devTagSize;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
|
|
|
|
|
|
MDDF mddf;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
bool mounted;
|
2016-07-28 03:41:57 +01:00
|
|
|
|
SRecord[] srecords;
|
2017-12-24 02:37:41 +00:00
|
|
|
|
ulong volumePrefix;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
|
public string Name => "Apple Lisa File System";
|
|
|
|
|
|
public Guid Id => new Guid("7E6034D1-D823-4248-A54D-239742B28391");
|
2017-12-26 08:01:40 +00:00
|
|
|
|
public Encoding Encoding { get; private set; }
|
|
|
|
|
|
public FileSystemType XmlFsType { get; private set; }
|
2017-12-24 02:37:41 +00:00
|
|
|
|
|
|
|
|
|
|
#region Caches
|
|
|
|
|
|
/// <summary>Caches Extents Files</summary>
|
|
|
|
|
|
Dictionary<short, ExtentFile> extentCache;
|
|
|
|
|
|
/// <summary>Caches system files</summary>
|
|
|
|
|
|
Dictionary<short, byte[]> systemFileCache;
|
|
|
|
|
|
/// <summary>Caches user files files</summary>
|
|
|
|
|
|
Dictionary<short, byte[]> fileCache;
|
|
|
|
|
|
/// <summary>Caches catalogs</summary>
|
|
|
|
|
|
List<CatalogEntry> catalogCache;
|
|
|
|
|
|
/// <summary>Caches file size</summary>
|
|
|
|
|
|
Dictionary<short, int> fileSizeCache;
|
|
|
|
|
|
/// <summary>Lists Extents Files already printed in debug mode to not repeat them</summary>
|
|
|
|
|
|
List<short> printedExtents;
|
|
|
|
|
|
/// <summary>Caches the creation times for subdirectories as to not have to traverse the Catalog File on each stat</summary>
|
|
|
|
|
|
Dictionary<short, DateTime> directoryDtcCache;
|
|
|
|
|
|
#endregion Caches
|
2014-04-17 03:45:02 +00:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|