Added support for U.C.S.D. Pascal filesystem, closes #31

This commit is contained in:
2016-07-31 20:56:53 +01:00
parent 8de5e47b3b
commit d4fa3b3e1b
13 changed files with 499 additions and 262 deletions

View File

@@ -5,11 +5,11 @@
// Filename : Dir.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Component
// Component : U.C.S.D. Pascal filesystem plugin.
//
// --[ Description ] ----------------------------------------------------------
//
// Description
// Methods to handle show the U.C.S.D. Pascal catalog as a directory.
//
// --[ License ] --------------------------------------------------------------
//
@@ -29,13 +29,35 @@
// ----------------------------------------------------------------------------
// Copyright © 2011-2016 Natalia Portillo
// ****************************************************************************/
using System;
using System.Collections.Generic;
namespace DiscImageChef.Filesystems.UCSDPascal
{
public class Dir
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
public partial class PascalPlugin : Filesystem
{
public Dir()
public override Errno ReadDir(string path, ref List<string> contents)
{
if(!mounted)
return Errno.AccessDenied;
if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
return Errno.NotSupported;
contents = new List<string>();
foreach(PascalFileEntry ent in fileEntries)
contents.Add(StringHandlers.PascalToString(ent.filename));
if(debug)
{
contents.Add("$");
contents.Add("$Boot");
}
contents.Sort();
return Errno.NoError;
}
}
}