2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2016-08-01 00:41:02 +01:00
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : AppleMFS.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : Apple Macintosh File System plugin.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
2016-08-01 00:43:31 +01:00
|
|
|
|
// Constructors and common variables for the Apple Macintosh File System plugin.
|
2016-08-01 00:41:02 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ 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-08-01 00:41:02 +01:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
using System.Collections.Generic;
|
2017-06-06 21:23:20 +01: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-08-01 00:41:02 +01:00
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Filesystems.AppleMFS
|
|
|
|
|
|
{
|
|
|
|
|
|
// Information from Inside Macintosh Volume II
|
2017-12-26 07:23:09 +00:00
|
|
|
|
public partial class AppleMFS : IReadOnlyFilesystem
|
2016-08-01 00:41:02 +01:00
|
|
|
|
{
|
2017-12-27 23:55:59 +00:00
|
|
|
|
bool mounted;
|
|
|
|
|
|
bool debug;
|
2017-12-26 06:05:12 +00:00
|
|
|
|
IMediaImage device;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
ulong partitionStart;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
|
2017-12-27 23:55:59 +00:00
|
|
|
|
Dictionary<uint, string> idToFilename;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
Dictionary<uint, MFS_FileEntry> idToEntry;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
Dictionary<string, uint> filenameToId;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
|
|
|
|
|
|
MFS_MasterDirectoryBlock volMDB;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
byte[] bootBlocks;
|
|
|
|
|
|
byte[] mdbBlocks;
|
|
|
|
|
|
byte[] directoryBlocks;
|
|
|
|
|
|
byte[] blockMapBytes;
|
|
|
|
|
|
uint[] blockMap;
|
|
|
|
|
|
int sectorsPerBlock;
|
|
|
|
|
|
byte[] bootTags;
|
|
|
|
|
|
byte[] mdbTags;
|
|
|
|
|
|
byte[] directoryTags;
|
|
|
|
|
|
byte[] bitmapTags;
|
2017-12-26 06:05:12 +00:00
|
|
|
|
|
2017-12-26 08:01:40 +00:00
|
|
|
|
public FileSystemType XmlFsType { get; private set; }
|
2017-12-27 23:55:59 +00:00
|
|
|
|
public string Name => "Apple Macintosh File System";
|
|
|
|
|
|
public Guid Id => new Guid("36405F8D-0D26-4066-6538-5DBF5D065C3A");
|
|
|
|
|
|
public Encoding Encoding { get; private set; }
|
2018-08-29 22:15:43 +01:00
|
|
|
|
public string Author => "Natalia Portillo";
|
2016-08-01 17:59:22 +01:00
|
|
|
|
|
2017-12-28 18:08:15 +00:00
|
|
|
|
// TODO: Implement Finder namespace (requires decoding Desktop database)
|
|
|
|
|
|
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 18:08:15 +00:00
|
|
|
|
|
2019-04-17 00:11:28 +01:00
|
|
|
|
public Dictionary<string, string> Namespaces => null;
|
|
|
|
|
|
|
2018-08-29 22:15:43 +01:00
|
|
|
|
static Dictionary<string, string> GetDefaultOptions() =>
|
|
|
|
|
|
new Dictionary<string, string> {{"debug", false.ToString()}};
|
2016-08-01 00:41:02 +01:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|