mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Make EmulatedSdFileSystemCreator config easier
Also make unintentionally internal classes public and enforce var style
This commit is contained in:
parent
f3b5cad94b
commit
172817a7d5
3 changed files with 20 additions and 8 deletions
|
@ -3,20 +3,26 @@ using LibHac.Fs;
|
|||
|
||||
namespace LibHac.FsService.Creators
|
||||
{
|
||||
class EmulatedSdFileSystemCreator : ISdFileSystemCreator
|
||||
public class EmulatedSdFileSystemCreator : ISdFileSystemCreator
|
||||
{
|
||||
private const string DefaultPath = "/sdcard";
|
||||
|
||||
public IFileSystem RootFileSystem { get; set; }
|
||||
public string Path { get; set; }
|
||||
private IFileSystem RootFileSystem { get; }
|
||||
private string Path { get; }
|
||||
|
||||
public IFileSystem SdCardFileSystem { get; set; }
|
||||
private IFileSystem SdCardFileSystem { get; set; }
|
||||
|
||||
public EmulatedSdFileSystemCreator(IFileSystem rootFileSystem)
|
||||
{
|
||||
RootFileSystem = rootFileSystem;
|
||||
}
|
||||
|
||||
public EmulatedSdFileSystemCreator(IFileSystem rootFileSystem, string path)
|
||||
{
|
||||
RootFileSystem = rootFileSystem;
|
||||
Path = path;
|
||||
}
|
||||
|
||||
public Result Create(out IFileSystem fileSystem)
|
||||
{
|
||||
fileSystem = default;
|
||||
|
@ -37,7 +43,13 @@ namespace LibHac.FsService.Creators
|
|||
|
||||
// Todo: Add ProxyFileSystem?
|
||||
|
||||
return Util.CreateSubFileSystem(out fileSystem, RootFileSystem, path, true);
|
||||
Result rc = Util.CreateSubFileSystem(out IFileSystem sdFileSystem, RootFileSystem, path, true);
|
||||
if (rc.IsFailure()) return rc;
|
||||
|
||||
SdCardFileSystem = sdFileSystem;
|
||||
fileSystem = sdFileSystem;
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
public Result Format(bool closeOpenEntries)
|
||||
|
|
|
@ -3,7 +3,7 @@ using LibHac.Fs;
|
|||
|
||||
namespace LibHac.FsService
|
||||
{
|
||||
class EmulatedDeviceOperator : IDeviceOperator
|
||||
public class EmulatedDeviceOperator : IDeviceOperator
|
||||
{
|
||||
private EmulatedGameCard GameCard { get; set; }
|
||||
|
||||
|
|
|
@ -234,9 +234,9 @@ namespace hactoolnet
|
|||
PrintItem(sb, colLen, "TitleID:", $"{nca.Header.TitleId:X16}");
|
||||
if (nca.CanOpenSection(NcaSectionType.Code)) {
|
||||
IFileSystem fs = nca.OpenFileSystem(NcaSectionType.Code, IntegrityCheckLevel.None);
|
||||
Result r = fs.OpenFile(out var file, "/main.npdm", OpenMode.Read);
|
||||
Result r = fs.OpenFile(out IFile file, "/main.npdm", OpenMode.Read);
|
||||
if (r.IsSuccess()) {
|
||||
NpdmBinary npdm = new NpdmBinary(file.AsStream(), null);
|
||||
var npdm = new NpdmBinary(file.AsStream(), null);
|
||||
PrintItem(sb, colLen, "Title Name:", npdm.TitleName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue