diff options
Diffstat (limited to 'Ryujinx.HLE/FileSystem/VirtualFileSystem.cs')
-rw-r--r-- | Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index eed5953f..bde6f69f 100644 --- a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -18,40 +18,40 @@ namespace Ryujinx.HLE.FileSystem public Stream RomFs { get; private set; } - public void LoadRomFs(string fileName) + public void LoadRomFs(string FileName) { - RomFs = new FileStream(fileName, FileMode.Open, FileAccess.Read); + RomFs = new FileStream(FileName, FileMode.Open, FileAccess.Read); } - public void SetRomFs(Stream romfsStream) + public void SetRomFs(Stream RomfsStream) { RomFs?.Close(); - RomFs = romfsStream; + RomFs = RomfsStream; } - public string GetFullPath(string basePath, string fileName) + public string GetFullPath(string BasePath, string FileName) { - if (fileName.StartsWith("//")) + if (FileName.StartsWith("//")) { - fileName = fileName.Substring(2); + FileName = FileName.Substring(2); } - else if (fileName.StartsWith('/')) + else if (FileName.StartsWith('/')) { - fileName = fileName.Substring(1); + FileName = FileName.Substring(1); } else { return null; } - string fullPath = Path.GetFullPath(Path.Combine(basePath, fileName)); + string FullPath = Path.GetFullPath(Path.Combine(BasePath, FileName)); - if (!fullPath.StartsWith(GetBasePath())) + if (!FullPath.StartsWith(GetBasePath())) { return null; } - return fullPath; + return FullPath; } public string GetSdCardPath() => MakeDirAndGetFullPath(SdCardPath); @@ -60,84 +60,84 @@ namespace Ryujinx.HLE.FileSystem public string GetSystemPath() => MakeDirAndGetFullPath(SystemPath); - public string GetGameSavePath(SaveInfo save, ServiceCtx context) + public string GetGameSavePath(SaveInfo Save, ServiceCtx Context) { - return MakeDirAndGetFullPath(SaveHelper.GetSavePath(save, context)); + return MakeDirAndGetFullPath(SaveHelper.GetSavePath(Save, Context)); } - public string GetFullPartitionPath(string partitionPath) + public string GetFullPartitionPath(string PartitionPath) { - return MakeDirAndGetFullPath(partitionPath); + return MakeDirAndGetFullPath(PartitionPath); } - public string SwitchPathToSystemPath(string switchPath) + public string SwitchPathToSystemPath(string SwitchPath) { - string[] parts = switchPath.Split(":"); + string[] Parts = SwitchPath.Split(":"); - if (parts.Length != 2) + if (Parts.Length != 2) { return null; } - return GetFullPath(MakeDirAndGetFullPath(parts[0]), parts[1]); + return GetFullPath(MakeDirAndGetFullPath(Parts[0]), Parts[1]); } - public string SystemPathToSwitchPath(string systemPath) + public string SystemPathToSwitchPath(string SystemPath) { - string baseSystemPath = GetBasePath() + Path.DirectorySeparatorChar; + string BaseSystemPath = GetBasePath() + Path.DirectorySeparatorChar; - if (systemPath.StartsWith(baseSystemPath)) + if (SystemPath.StartsWith(BaseSystemPath)) { - string rawPath = systemPath.Replace(baseSystemPath, ""); - int firstSeparatorOffset = rawPath.IndexOf(Path.DirectorySeparatorChar); + string RawPath = SystemPath.Replace(BaseSystemPath, ""); + int FirstSeparatorOffset = RawPath.IndexOf(Path.DirectorySeparatorChar); - if (firstSeparatorOffset == -1) + if (FirstSeparatorOffset == -1) { - return $"{rawPath}:/"; + return $"{RawPath}:/"; } - string basePath = rawPath.Substring(0, firstSeparatorOffset); - string fileName = rawPath.Substring(firstSeparatorOffset + 1); + string BasePath = RawPath.Substring(0, FirstSeparatorOffset); + string FileName = RawPath.Substring(FirstSeparatorOffset + 1); - return $"{basePath}:/{fileName}"; + return $"{BasePath}:/{FileName}"; } return null; } - private string MakeDirAndGetFullPath(string dir) + private string MakeDirAndGetFullPath(string Dir) { // Handles Common Switch Content Paths - switch (dir) + switch (Dir) { case ContentPath.SdCard: case "@Sdcard": - dir = SdCardPath; + Dir = SdCardPath; break; case ContentPath.User: - dir = UserNandPath; + Dir = UserNandPath; break; case ContentPath.System: - dir = SystemNandPath; + Dir = SystemNandPath; break; case ContentPath.SdCardContent: - dir = Path.Combine(SdCardPath, "Nintendo", "Contents"); + Dir = Path.Combine(SdCardPath, "Nintendo", "Contents"); break; case ContentPath.UserContent: - dir = Path.Combine(UserNandPath, "Contents"); + Dir = Path.Combine(UserNandPath, "Contents"); break; case ContentPath.SystemContent: - dir = Path.Combine(SystemNandPath, "Contents"); + Dir = Path.Combine(SystemNandPath, "Contents"); break; } - string fullPath = Path.Combine(GetBasePath(), dir); + string FullPath = Path.Combine(GetBasePath(), Dir); - if (!Directory.Exists(fullPath)) + if (!Directory.Exists(FullPath)) { - Directory.CreateDirectory(fullPath); + Directory.CreateDirectory(FullPath); } - return fullPath; + return FullPath; } public DriveInfo GetDrive() @@ -147,9 +147,9 @@ namespace Ryujinx.HLE.FileSystem public string GetBasePath() { - string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + string AppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - return Path.Combine(appDataPath, BasePath); + return Path.Combine(AppDataPath, BasePath); } public void Dispose() |