mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
6641109d94
Makes all current FS shims more accurate, including using rewritten access log and system tick handling code.
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using LibHac.Common.Keys;
|
|
using LibHac.Fs;
|
|
using LibHac.Fs.Fsa;
|
|
using LibHac.FsSrv;
|
|
|
|
namespace LibHac.Tests.Fs.FileSystemClientTests
|
|
{
|
|
public static class FileSystemServerFactory
|
|
{
|
|
private static FileSystemClient CreateClientImpl(bool sdCardInserted, out IFileSystem rootFs)
|
|
{
|
|
rootFs = new InMemoryFileSystem();
|
|
|
|
var defaultObjects = DefaultFsServerObjects.GetDefaultEmulatedCreators(rootFs, new KeySet());
|
|
|
|
defaultObjects.SdCard.SetSdCardInsertionStatus(sdCardInserted);
|
|
|
|
var config = new FileSystemServerConfig();
|
|
config.FsCreators = defaultObjects.FsCreators;
|
|
config.DeviceOperator = defaultObjects.DeviceOperator;
|
|
config.ExternalKeySet = new ExternalKeySet();
|
|
|
|
Horizon horizon = LibHac.HorizonFactory.CreateWithFsConfig(new HorizonConfiguration(), config);
|
|
|
|
HorizonClient horizonClient = horizon.CreatePrivilegedHorizonClient();
|
|
|
|
return horizonClient.Fs;
|
|
}
|
|
|
|
public static FileSystemClient CreateClient(bool sdCardInserted)
|
|
{
|
|
return CreateClientImpl(sdCardInserted, out _);
|
|
}
|
|
|
|
public static FileSystemClient CreateClient(out IFileSystem rootFs)
|
|
{
|
|
return CreateClientImpl(false, out rootFs);
|
|
}
|
|
}
|
|
}
|