aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/PFsProvider.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2019-05-31 19:31:10 -0500
committerAc_K <Acoustik666@gmail.com>2019-06-01 02:31:10 +0200
commit5fc1f6a1af7df0294069cd432c796e6546a4b38d (patch)
tree6c3b9b09dece9594a84f3bbb6fdef8a97f643784 /Ryujinx.HLE/FileSystem/PFsProvider.cs
parent92c1726647964da9230bc4f4c631a233cd064665 (diff)
Update to version 0.4 of LibHac (#689)
* It compiles * Print correct name when loading an exefs * Use DirectorySaveDataFileSystem for savedata * Handle more errors in IFileSystem * Remove structs replaced by LibHac structs * Fix alignment * Fix alignment again * Fix IFile and IFileSystem IPC * Alignment * Use released libhac version
Diffstat (limited to 'Ryujinx.HLE/FileSystem/PFsProvider.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/PFsProvider.cs152
1 files changed, 0 insertions, 152 deletions
diff --git a/Ryujinx.HLE/FileSystem/PFsProvider.cs b/Ryujinx.HLE/FileSystem/PFsProvider.cs
deleted file mode 100644
index 69e7a9b8..00000000
--- a/Ryujinx.HLE/FileSystem/PFsProvider.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-using LibHac;
-using LibHac.IO;
-using Ryujinx.HLE.HOS;
-using Ryujinx.HLE.HOS.Services.FspSrv;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-using static Ryujinx.HLE.HOS.ErrorCode;
-
-namespace Ryujinx.HLE.FileSystem
-{
- class PFsProvider : IFileSystemProvider
- {
- private Pfs _pfs;
-
- public PFsProvider(Pfs pfs)
- {
- _pfs = pfs;
- }
-
- public long CreateDirectory(string name)
- {
- throw new NotSupportedException();
- }
-
- public long CreateFile(string name, long size)
- {
- throw new NotSupportedException();
- }
-
- public long DeleteDirectory(string name, bool recursive)
- {
- throw new NotSupportedException();
- }
-
- public long DeleteFile(string name)
- {
- throw new NotSupportedException();
- }
-
- public DirectoryEntry[] GetDirectories(string path)
- {
- return new DirectoryEntry[0];
- }
-
- public DirectoryEntry[] GetEntries(string path)
- {
- List<DirectoryEntry> entries = new List<DirectoryEntry>();
-
- foreach (PfsFileEntry file in _pfs.Files)
- {
- DirectoryEntry directoryEntry = new DirectoryEntry(file.Name, DirectoryEntryType.File, file.Size);
-
- entries.Add(directoryEntry);
- }
-
- return entries.ToArray();
- }
-
- public DirectoryEntry[] GetFiles(string path)
- {
- List<DirectoryEntry> entries = new List<DirectoryEntry>();
-
- foreach (PfsFileEntry file in _pfs.Files)
- {
- DirectoryEntry directoryEntry = new DirectoryEntry(file.Name, DirectoryEntryType.File, file.Size);
-
- entries.Add(directoryEntry);
- }
-
- return entries.ToArray();
- }
-
- public long GetFreeSpace(ServiceCtx context)
- {
- return 0;
- }
-
- public string GetFullPath(string name)
- {
- return name;
- }
-
- public long GetTotalSpace(ServiceCtx context)
- {
- return _pfs.Files.Sum(x => x.Size);
- }
-
- public bool DirectoryExists(string name)
- {
- return name == "/";
- }
-
- public bool FileExists(string name)
- {
- name = name.TrimStart('/');
-
- return _pfs.FileExists(name);
- }
-
- public long OpenDirectory(string name, int filterFlags, out IDirectory directoryInterface)
- {
- if (name == "/")
- {
- directoryInterface = new IDirectory(name, filterFlags, this);
-
- return 0;
- }
-
- throw new NotSupportedException();
- }
-
- public long OpenFile(string name, out IFile fileInterface)
- {
- name = name.TrimStart('/');
-
- if (_pfs.FileExists(name))
- {
- Stream stream = _pfs.OpenFile(name).AsStream();
- fileInterface = new IFile(stream, name);
-
- return 0;
- }
-
- fileInterface = null;
-
- return MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist);
- }
-
- public long RenameDirectory(string oldName, string newName)
- {
- throw new NotSupportedException();
- }
-
- public long RenameFile(string oldName, string newName)
- {
- throw new NotSupportedException();
- }
-
- public void CheckIfOutsideBasePath(string path)
- {
- throw new NotSupportedException();
- }
-
- public FileTimestamp GetFileTimeStampRaw(string name)
- {
- throw new NotImplementedException();
- }
- }
-}