REFACTOR: Final cleanup of DiscImageChef.Filesystems.

This commit is contained in:
2017-12-24 02:37:41 +00:00
parent ec73a6cdc3
commit 4115698ac8
94 changed files with 5196 additions and 5116 deletions

View File

@@ -159,8 +159,14 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{
entry = new PascalFileEntry();
foreach(PascalFileEntry ent in fileEntries.Where(ent => string.Compare(path, StringHandlers.PascalToString(ent.filename, CurrentEncoding),
StringComparison.InvariantCultureIgnoreCase) == 0)) {
foreach(PascalFileEntry ent in fileEntries.Where(ent =>
string.Compare(path,
StringHandlers
.PascalToString(ent.filename,
CurrentEncoding),
StringComparison
.InvariantCultureIgnoreCase) == 0))
{
entry = ent;
return Errno.NoError;
}

View File

@@ -80,13 +80,10 @@ namespace DiscImageChef.Filesystems.UCSDPascal
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.GetSectors()) return false;
// There can be not less than zero files
if(volEntry.files < 0) return false;
return true;
return volEntry.files >= 0;
}
public override void GetInformation(ImagePlugin imagePlugin, Partition partition,
out string information)
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
StringBuilder sbInformation = new StringBuilder();
information = "";

View File

@@ -53,7 +53,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
public short dummy;
/// <summary>0x14, last booted</summary>
public short lastBoot;
/// <summary>0x16, tail to make record same size as <see cref="PascalFileEntry"/></summary>
/// <summary>0x16, tail to make record same size as <see cref="PascalFileEntry" /></summary>
public int tail;
}

View File

@@ -121,13 +121,15 @@ namespace DiscImageChef.Filesystems.UCSDPascal
public override Errno StatFs(ref FileSystemInfo stat)
{
stat = new FileSystemInfo();
stat.Blocks = mountedVolEntry.blocks;
stat.FilenameLength = 16;
stat.Files = (ulong)mountedVolEntry.files;
stat.FreeBlocks = 0;
stat.PluginId = PluginUuid;
stat.Type = "UCSD Pascal";
stat = new FileSystemInfo
{
Blocks = mountedVolEntry.blocks,
FilenameLength = 16,
Files = (ulong)mountedVolEntry.files,
FreeBlocks = 0,
PluginId = PluginUuid,
Type = "UCSD Pascal"
};
stat.FreeBlocks = mountedVolEntry.blocks - (mountedVolEntry.lastBlock - mountedVolEntry.firstBlock);
foreach(PascalFileEntry entry in fileEntries) stat.FreeBlocks -= entry.lastBlock - entry.firstBlock;

View File

@@ -42,14 +42,14 @@ namespace DiscImageChef.Filesystems.UCSDPascal
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
public partial class PascalPlugin : Filesystem
{
bool mounted;
bool debug;
readonly ImagePlugin device;
PascalVolumeEntry mountedVolEntry;
List<PascalFileEntry> fileEntries;
byte[] bootBlocks;
byte[] catalogBlocks;
bool debug;
List<PascalFileEntry> fileEntries;
bool mounted;
PascalVolumeEntry mountedVolEntry;
public PascalPlugin()
{