aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/Content/LocationHelper.cs
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2022-03-22 20:46:16 +0100
committerGitHub <noreply@github.com>2022-03-22 20:46:16 +0100
commite3b36db71c62a34a26b30683dd5ad5410c97cc9c (patch)
tree18feea12db46ad2ddcdc207e9fd0e805fd98b7da /Ryujinx.HLE/FileSystem/Content/LocationHelper.cs
parentba0171d05464201c1513386b7d0b69b5ea956426 (diff)
hle: Some cleanup (#3210)1.1.83
* hle: Some cleanup This PR cleaned up a bit the HLE folder and the VirtualFileSystem one, since we use LibHac, we can use some class of it directly instead of duplicate things. The "Content" of VFS folder is removed since it should be handled in the NCM service directly. A larger cleanup should be done later since there is still be duplicated code here and there. * Fix Headless.SDL2 * Addresses gdkchan feedback
Diffstat (limited to 'Ryujinx.HLE/FileSystem/Content/LocationHelper.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/Content/LocationHelper.cs91
1 files changed, 0 insertions, 91 deletions
diff --git a/Ryujinx.HLE/FileSystem/Content/LocationHelper.cs b/Ryujinx.HLE/FileSystem/Content/LocationHelper.cs
deleted file mode 100644
index c522b053..00000000
--- a/Ryujinx.HLE/FileSystem/Content/LocationHelper.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using System;
-using System.IO;
-
-using static Ryujinx.HLE.FileSystem.VirtualFileSystem;
-
-namespace Ryujinx.HLE.FileSystem.Content
-{
- internal static class LocationHelper
- {
- public static string GetRealPath(VirtualFileSystem fileSystem, string switchContentPath)
- {
- string basePath = fileSystem.GetBasePath();
-
- switch (switchContentPath)
- {
- case ContentPath.SystemContent:
- return Path.Combine(basePath, SystemNandPath, "Contents");
- case ContentPath.UserContent:
- return Path.Combine(basePath, UserNandPath, "Contents");
- case ContentPath.SdCardContent:
- return Path.Combine(fileSystem.GetSdCardPath(), "Nintendo", "Contents");
- case ContentPath.System:
- return Path.Combine(basePath, SystemNandPath);
- case ContentPath.User:
- return Path.Combine(basePath, UserNandPath);
- default:
- throw new NotSupportedException($"Content Path `{switchContentPath}` is not supported.");
- }
- }
-
- public static string GetContentPath(ContentStorageId contentStorageId)
- {
- switch (contentStorageId)
- {
- case ContentStorageId.NandSystem:
- return ContentPath.SystemContent;
- case ContentStorageId.NandUser:
- return ContentPath.UserContent;
- case ContentStorageId.SdCard:
- return ContentPath.SdCardContent;
- default:
- throw new NotSupportedException($"Content Storage `{contentStorageId}` is not supported.");
- }
- }
-
- public static string GetContentRoot(StorageId storageId)
- {
- switch (storageId)
- {
- case StorageId.NandSystem:
- return ContentPath.SystemContent;
- case StorageId.NandUser:
- return ContentPath.UserContent;
- case StorageId.SdCard:
- return ContentPath.SdCardContent;
- default:
- throw new NotSupportedException($"Storage Id `{storageId}` is not supported.");
- }
- }
-
- public static StorageId GetStorageId(string contentPathString)
- {
- string cleanedPath = contentPathString.Split(':')[0];
-
- switch (cleanedPath)
- {
- case ContentPath.SystemContent:
- case ContentPath.System:
- return StorageId.NandSystem;
-
- case ContentPath.UserContent:
- case ContentPath.User:
- return StorageId.NandUser;
-
- case ContentPath.SdCardContent:
- return StorageId.SdCard;
-
- case ContentPath.Host:
- return StorageId.Host;
-
- case ContentPath.GamecardApp:
- case ContentPath.GamecardContents:
- case ContentPath.GamecardUpdate:
- return StorageId.GameCard;
-
- default:
- return StorageId.None;
- }
- }
- }
-}