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-21 14:30:38 +00:00
|
|
|
|
using Claunia.Encoding;
|
2017-07-19 16:31:08 +01:00
|
|
|
|
using DiscImageChef.CommonTypes;
|
2017-12-20 17:15:26 +00:00
|
|
|
|
using DiscImageChef.DiscImages;
|
2017-12-21 14:30:38 +00:00
|
|
|
|
using Encoding = System.Text.Encoding;
|
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-07-05 06:54:50 +01:00
|
|
|
|
public partial class LisaFS : Filesystem
|
2014-04-17 03:45:02 +00:00
|
|
|
|
{
|
2016-07-22 02:18:53 +01:00
|
|
|
|
bool mounted;
|
|
|
|
|
|
bool debug;
|
|
|
|
|
|
readonly ImagePlugin device;
|
|
|
|
|
|
|
|
|
|
|
|
MDDF mddf;
|
2016-07-27 22:13:47 +01:00
|
|
|
|
ulong volumePrefix;
|
|
|
|
|
|
int devTagSize;
|
2016-07-28 03:41:57 +01:00
|
|
|
|
SRecord[] srecords;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
|
|
|
|
|
|
#region Caches
|
2016-07-29 02:22:24 +01:00
|
|
|
|
/// <summary>Caches Extents Files</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
Dictionary<short, ExtentFile> extentCache;
|
2016-07-29 02:22:24 +01:00
|
|
|
|
/// <summary>Caches system files</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
Dictionary<short, byte[]> systemFileCache;
|
2016-07-29 02:22:24 +01:00
|
|
|
|
/// <summary>Caches user files files</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
Dictionary<short, byte[]> fileCache;
|
2016-07-29 02:22:24 +01:00
|
|
|
|
/// <summary>Caches catalogs</summary>
|
2016-07-31 01:53:47 +01:00
|
|
|
|
List<CatalogEntry> catalogCache;
|
2016-07-29 02:22:24 +01:00
|
|
|
|
/// <summary>Caches file size</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
Dictionary<short, int> fileSizeCache;
|
2016-07-29 02:22:24 +01:00
|
|
|
|
/// <summary>Lists Extents Files already printed in debug mode to not repeat them</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
List<short> printedExtents;
|
2016-07-31 01:53:47 +01:00
|
|
|
|
/// <summary>Caches the creation times for subdirectories as to not have to traverse the Catalog File on each stat</summary>
|
|
|
|
|
|
Dictionary<short, DateTime> directoryDTCCache;
|
2016-07-22 02:18:53 +01:00
|
|
|
|
#endregion Caches
|
|
|
|
|
|
|
2015-10-05 20:04:05 +01:00
|
|
|
|
public LisaFS()
|
2014-04-17 03:45:02 +00:00
|
|
|
|
{
|
|
|
|
|
|
Name = "Apple Lisa File System";
|
|
|
|
|
|
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
|
2017-12-21 14:30:38 +00:00
|
|
|
|
CurrentEncoding = new LisaRoman();
|
2014-04-17 03:45:02 +00:00
|
|
|
|
}
|
2016-07-22 02:18:53 +01:00
|
|
|
|
|
2017-10-12 23:54:02 +01:00
|
|
|
|
public LisaFS(Encoding encoding)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = "Apple Lisa File System";
|
|
|
|
|
|
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
|
2017-12-21 14:30:38 +00:00
|
|
|
|
CurrentEncoding = new LisaRoman();
|
2017-10-12 23:54:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-07-19 16:31:08 +01:00
|
|
|
|
public LisaFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding)
|
2016-07-22 02:18:53 +01:00
|
|
|
|
{
|
|
|
|
|
|
device = imagePlugin;
|
2016-07-27 13:33:41 +01:00
|
|
|
|
Name = "Apple Lisa File System";
|
|
|
|
|
|
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
|
2017-12-21 14:30:38 +00:00
|
|
|
|
CurrentEncoding = new LisaRoman();
|
2016-07-22 02:18:53 +01:00
|
|
|
|
}
|
2014-04-17 03:45:02 +00:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|