REFACTOR: Remove unneeded code.

This commit is contained in:
2017-12-21 14:30:38 +00:00
parent 35ce7db892
commit dcd053b20d
343 changed files with 2842 additions and 2588 deletions

View File

@@ -33,6 +33,7 @@
using System;
using System.IO;
using DiscImageChef.Console;
using DiscImageChef.DiscImages;
namespace DiscImageChef.Filesystems.AppleMFS
{
@@ -45,7 +46,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
if(!mounted) return Errno.AccessDenied;
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1) return Errno.NotSupported;
uint fileID;
@@ -81,7 +82,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
{
if(!mounted) return Errno.AccessDenied;
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1) return Errno.NotSupported;
uint fileID;
@@ -151,7 +152,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
{
if(!mounted) return Errno.AccessDenied;
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1) return Errno.NotSupported;
if(debug)
@@ -236,7 +237,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
if(!mounted) return Errno.AccessDenied;
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1) return Errno.NotSupported;
uint fileID;
@@ -277,7 +278,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
if(tags)
sectors =
device.ReadSectorsTag((ulong)((nextBlock - 2) * sectorsPerBlock) + volMDB.drAlBlSt + partitionStart,
(uint)sectorsPerBlock, DiscImages.SectorTagType.AppleSectorTag);
(uint)sectorsPerBlock, SectorTagType.AppleSectorTag);
else
sectors =
device.ReadSectors((ulong)((nextBlock - 2) * sectorsPerBlock) + volMDB.drAlBlSt + partitionStart,

View File

@@ -33,13 +33,15 @@
using System;
using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using Schemas;
namespace DiscImageChef.Filesystems.AppleMFS
{
// Information from Inside Macintosh Volume II
public partial class AppleMFS : Filesystem
{
public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition)
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
ushort drSigWord;
@@ -54,7 +56,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
return drSigWord == MFS_MAGIC;
}
public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition,
public override void GetInformation(ImagePlugin imagePlugin, Partition partition,
out string information)
{
information = "";
@@ -173,7 +175,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
information = sb.ToString();
xmlFSType = new Schemas.FileSystemType();
xmlFSType = new FileSystemType();
if(MDB.drLsBkUp > 0)
{
xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drLsBkUp);
@@ -193,8 +195,6 @@ namespace DiscImageChef.Filesystems.AppleMFS
xmlFSType.FreeClustersSpecified = true;
xmlFSType.Type = "MFS";
xmlFSType.VolumeName = MDB.drVN;
return;
}
}
}

View File

@@ -31,6 +31,8 @@
// ****************************************************************************/
using System;
using DiscImageChef.DiscImages;
using Schemas;
namespace DiscImageChef.Filesystems.AppleMFS
{
@@ -105,14 +107,14 @@ namespace DiscImageChef.Filesystems.AppleMFS
offset += 12;
}
if(device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag))
if(device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag))
{
mdbTags = device.ReadSectorTag(2 + partitionStart, DiscImages.SectorTagType.AppleSectorTag);
bootTags = device.ReadSectorTag(0 + partitionStart, DiscImages.SectorTagType.AppleSectorTag);
mdbTags = device.ReadSectorTag(2 + partitionStart, SectorTagType.AppleSectorTag);
bootTags = device.ReadSectorTag(0 + partitionStart, SectorTagType.AppleSectorTag);
directoryTags = device.ReadSectorsTag(volMDB.drDirSt + partitionStart, volMDB.drBlLen,
DiscImages.SectorTagType.AppleSectorTag);
SectorTagType.AppleSectorTag);
bitmapTags = device.ReadSectorsTag(partitionStart + 2, (uint)sectorsInWholeMDB,
DiscImages.SectorTagType.AppleSectorTag);
SectorTagType.AppleSectorTag);
}
sectorsPerBlock = (int)(volMDB.drAlBlkSiz / device.ImageInfo.SectorSize);
@@ -125,7 +127,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
if(bbSig != MFSBB_MAGIC) bootBlocks = null;
xmlFSType = new Schemas.FileSystemType();
xmlFSType = new FileSystemType();
if(volMDB.drLsBkUp > 0)
{
xmlFSType.BackupDate = DateHandlers.MacToDateTime(volMDB.drLsBkUp);

View File

@@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using DiscImageChef.DiscImages;
namespace DiscImageChef.Filesystems.AppleMFS
{
@@ -43,7 +44,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
{
if(!mounted) return Errno.AccessDenied;
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1) return Errno.NotSupported;
xattrs = new List<string>();
@@ -54,7 +55,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$MDB", StringComparison.InvariantCulture) == 0)
{
if(device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag))
if(device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag))
xattrs.Add("com.apple.macintosh.tags");
return Errno.NoError;
@@ -70,13 +71,13 @@ namespace DiscImageChef.Filesystems.AppleMFS
if(entry.flRLgLen > 0)
{
xattrs.Add("com.apple.ResourceFork");
if(debug && device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag))
if(debug && device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag))
xattrs.Add("com.apple.ResourceFork.tags");
}
if(!ArrayHelpers.ArrayIsNullOrEmpty(entry.flUsrWds)) xattrs.Add("com.apple.FinderInfo");
if(debug && device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag) &&
if(debug && device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) &&
entry.flLgLen > 0) xattrs.Add("com.apple.macintosh.tags");
xattrs.Sort();
@@ -88,7 +89,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
{
if(!mounted) return Errno.AccessDenied;
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1) return Errno.NotSupported;
if(debug)
@@ -96,7 +97,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
string.Compare(path, "$Bitmap", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$MDB", StringComparison.InvariantCulture) == 0)
if(device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag) &&
if(device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) &&
string.Compare(xattr, "com.apple.macintosh.tags", StringComparison.InvariantCulture) == 0)
{
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0)
@@ -159,7 +160,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
return Errno.NoError;
}
if(!debug || !device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag) ||
if(!debug || !device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) ||
string.Compare(xattr, "com.apple.macintosh.tags", StringComparison.InvariantCulture) != 0)
return Errno.NoSuchExtendedAttribute;