mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Ensure all FS shim classes are updated for 14.0.0
This commit is contained in:
parent
366aa51912
commit
c2e4b80bac
24 changed files with 69 additions and 36 deletions
|
@ -14,7 +14,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting application packages.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class Application
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting BCAT save data.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class BcatSaveData
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// Contains functions for mounting built-in-storage partition file systems
|
||||
/// and opening the raw partitions as <see cref="IStorage"/>s.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class Bis
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting code file systems.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class Code
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting content file systems.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class Content
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting the directories where content is stored.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class ContentStorage
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting custom storage file systems.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class CustomStorage
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ public enum DebugOptionKey : uint
|
|||
/// <summary>
|
||||
/// Contains debug-related functions for the FS service.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class DebugShim
|
||||
{
|
||||
public static Result CreatePaddingFile(this FileSystemClient fs, long size)
|
||||
|
|
|
@ -10,12 +10,18 @@ namespace LibHac.Fs.Impl
|
|||
/// <summary>
|
||||
/// Handles getting scoped read access to the global file data cache.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
internal struct GlobalFileDataCacheAccessorReadableScopedPointer : IDisposable
|
||||
{
|
||||
private FileDataCacheAccessor _accessor;
|
||||
private ReaderWriterLock _lock;
|
||||
|
||||
public GlobalFileDataCacheAccessorReadableScopedPointer()
|
||||
{
|
||||
_accessor = null;
|
||||
_lock = null;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_lock?.ReleaseReadLock();
|
||||
|
@ -36,6 +42,10 @@ namespace LibHac.Fs.Impl
|
|||
|
||||
namespace LibHac.Fs.Shim
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains functions for configuring the global file data cache.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class FileDataCacheShim
|
||||
{
|
||||
internal struct Globals : IDisposable
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
using System;
|
||||
using LibHac.Fs.Fsa;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace LibHac.Fs.Impl;
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to an <see cref="IFileDataCache"/>.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
internal class FileDataCacheAccessor
|
||||
{
|
||||
private readonly IFileDataCache _cache;
|
|
@ -21,7 +21,7 @@ namespace LibHac.Fs.Impl;
|
|||
/// An adapter for using an <see cref="IFileSf"/> service object as an <see cref="IFile"/>. Used
|
||||
/// when receiving a Horizon IPC file object so it can be used as an <see cref="IFile"/> locally.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
internal class FileServiceObjectAdapter : IFile
|
||||
{
|
||||
private SharedRef<IFileSf> _baseFile;
|
||||
|
@ -87,7 +87,7 @@ internal class FileServiceObjectAdapter : IFile
|
|||
/// An adapter for using an <see cref="IDirectorySf"/> service object as an <see cref="IDirectory"/>. Used
|
||||
/// when receiving a Horizon IPC directory object so it can be used as an <see cref="IDirectory"/> locally.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
internal class DirectoryServiceObjectAdapter : IDirectory
|
||||
{
|
||||
private SharedRef<IDirectorySf> _baseDirectory;
|
||||
|
@ -119,7 +119,7 @@ internal class DirectoryServiceObjectAdapter : IDirectory
|
|||
/// An adapter for using an <see cref="IFileSystemSf"/> service object as an <see cref="IFileSystem"/>. Used
|
||||
/// when receiving a Horizon IPC file system object so it can be used as an <see cref="IFileSystem"/> locally.
|
||||
/// </summary>
|
||||
/// <remarks>Based on FS 13.1.0 (nnSdk 13.4.0)</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
internal class FileSystemServiceObjectAdapter : IFileSystem, IMultiCommitTarget
|
||||
{
|
||||
private SharedRef<IFileSystemSf> _baseFs;
|
||||
|
|
|
@ -14,6 +14,10 @@ using IStorageSf = LibHac.FsSrv.Sf.IStorage;
|
|||
|
||||
namespace LibHac.Fs.Shim;
|
||||
|
||||
/// <summary>
|
||||
/// Contains functions used for mounting and interacting with the game card.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class GameCard
|
||||
{
|
||||
|
@ -32,13 +36,13 @@ public static class GameCard
|
|||
|
||||
private class GameCardCommonMountNameGenerator : ICommonMountNameGenerator
|
||||
{
|
||||
private GameCardHandle Handle { get; }
|
||||
private GameCardPartition PartitionId { get; }
|
||||
private readonly GameCardHandle _handle;
|
||||
private readonly GameCardPartition _partitionId;
|
||||
|
||||
public GameCardCommonMountNameGenerator(GameCardHandle handle, GameCardPartition partitionId)
|
||||
{
|
||||
Handle = handle;
|
||||
PartitionId = partitionId;
|
||||
_handle = handle;
|
||||
_partitionId = partitionId;
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
|
@ -50,7 +54,7 @@ public static class GameCard
|
|||
// Determine how much space we need.
|
||||
int requiredNameBufferSize =
|
||||
StringUtils.GetLength(CommonMountNames.GameCardFileSystemMountName, PathTool.MountNameLengthMax) +
|
||||
StringUtils.GetLength(GetGameCardMountNameSuffix(PartitionId), PathTool.MountNameLengthMax) +
|
||||
StringUtils.GetLength(GetGameCardMountNameSuffix(_partitionId), PathTool.MountNameLengthMax) +
|
||||
handleDigitCount + 2;
|
||||
|
||||
Assert.SdkRequiresGreaterEqual(nameBuffer.Length, requiredNameBufferSize);
|
||||
|
@ -58,8 +62,8 @@ public static class GameCard
|
|||
// Generate the name.
|
||||
var sb = new U8StringBuilder(nameBuffer);
|
||||
sb.Append(CommonMountNames.GameCardFileSystemMountName)
|
||||
.Append(GetGameCardMountNameSuffix(PartitionId))
|
||||
.AppendFormat(Handle.Value, 'x', (byte)handleDigitCount)
|
||||
.Append(GetGameCardMountNameSuffix(_partitionId))
|
||||
.AppendFormat(_handle.Value, 'x', (byte)handleDigitCount)
|
||||
.Append(StringTraits.DriveSeparator);
|
||||
|
||||
Assert.SdkEqual(sb.Length, requiredNameBufferSize - 1);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting file systems from a host computer.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class Host
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for use by the Loader service.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class LoaderApi
|
||||
{
|
||||
public static Result IsArchivedProgram(this FileSystemClient fs, out bool isArchived, ProcessId processId)
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for setting the current time used by FS.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class PosixTimeShim
|
||||
{
|
||||
public static Result SetCurrentPosixTime(this FileSystemClient fs, Time.PosixTime currentPosixTime,
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// Contains functions for registering multi-program application
|
||||
/// information of the currently running application with FS.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class ProgramIndexMapInfoShim
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// Contains functions for registering and unregistering currently running
|
||||
/// processes and their permissions in the FS program registry.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class ProgramRegistry
|
||||
{
|
||||
/// <inheritdoc cref="ProgramRegistryImpl.RegisterProgram"/>
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for working with rights IDs and external keys for NCA encryption.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class RightsIdShim
|
||||
{
|
||||
public static Result GetRightsId(this FileSystemClient fs, out RightsId rightsId, ProgramId programId,
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace LibHac.Fs.Impl;
|
|||
/// An adapter for interacting with an <see cref="FsSrv.Sf.ISaveDataChunkIterator"/>
|
||||
/// IPC service object via the non-IPC <see cref="ISaveDataChunkIterator"/> interface.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataChunkIterator : ISaveDataChunkIterator
|
||||
{
|
||||
private SharedRef<FsSrv.Sf.ISaveDataChunkIterator> _baseInterface;
|
||||
|
@ -61,7 +61,7 @@ public class SaveDataChunkIterator : ISaveDataChunkIterator
|
|||
/// An adapter for interacting with an <see cref="FsSrv.Sf.ISaveDataChunkExporter"/>
|
||||
/// IPC service object via the non-IPC <see cref="ISaveDataChunkExporter"/> interface.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataChunkExporter : ISaveDataChunkExporter
|
||||
{
|
||||
private SharedRef<FsSrv.Sf.ISaveDataChunkExporter> _baseInterface;
|
||||
|
@ -108,7 +108,7 @@ public class SaveDataChunkExporter : ISaveDataChunkExporter
|
|||
/// An adapter for interacting with an <see cref="FsSrv.Sf.ISaveDataChunkImporter"/>
|
||||
/// IPC service object via the non-IPC <see cref="ISaveDataChunkImporter"/> interface.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataChunkImporter : ISaveDataChunkImporter
|
||||
{
|
||||
private SharedRef<FsSrv.Sf.ISaveDataChunkImporter> _baseInterface;
|
||||
|
@ -141,7 +141,7 @@ public class SaveDataChunkImporter : ISaveDataChunkImporter
|
|||
/// An adapter for interacting with an <see cref="FsSrv.Sf.ISaveDataDivisionExporter"/>
|
||||
/// IPC service object via the non-IPC <see cref="ISaveDataDivisionExporter"/> interface.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataExporterVersion2 : ISaveDataDivisionExporter
|
||||
{
|
||||
private SharedRef<FsSrv.Sf.ISaveDataDivisionExporter> _baseInterface;
|
||||
|
@ -320,7 +320,7 @@ public class SaveDataExporterVersion2 : ISaveDataDivisionExporter
|
|||
/// An adapter for interacting with an <see cref="FsSrv.Sf.ISaveDataDivisionImporter"/>
|
||||
/// IPC service object via the non-IPC <see cref="ISaveDataDivisionImporter"/> interface.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataImporterVersion2 : ISaveDataDivisionImporter
|
||||
{
|
||||
private SharedRef<FsSrv.Sf.ISaveDataDivisionImporter> _baseInterface;
|
||||
|
|
|
@ -14,6 +14,11 @@ using static LibHac.Fs.SaveData;
|
|||
// ReSharper disable once CheckNamespace
|
||||
namespace LibHac.Fs
|
||||
{
|
||||
/// <summary>
|
||||
/// An adapter for interacting with an <see cref="FsSrv.Sf.ISaveDataTransferManagerWithDivision"/>
|
||||
/// IPC service object.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataTransferManagerVersion2 : IDisposable
|
||||
{
|
||||
private SharedRef<ISaveDataTransferManagerWithDivision> _baseInterface;
|
||||
|
@ -253,6 +258,11 @@ namespace LibHac.Fs
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An adapter that automatically closes a given <see cref="FsSrv.Sf.ISaveDataTransferProhibiter"/>
|
||||
/// IPC service object when disposed.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public class SaveDataTransferProhibiterForCloudBackUp : IDisposable
|
||||
{
|
||||
private SharedRef<ISaveDataTransferProhibiter> _prohibiter;
|
||||
|
@ -271,6 +281,10 @@ namespace LibHac.Fs
|
|||
|
||||
namespace LibHac.Fs.Shim
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains functions used when doing save data cloud backup.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class SaveDataTransferVersion2Shim
|
||||
{
|
||||
public static Result OpenSaveDataTransferProhibiterForCloudBackUp(this FileSystemClientImpl fs,
|
||||
|
|
|
@ -12,6 +12,10 @@ using IFileSystemSf = LibHac.FsSrv.Sf.IFileSystem;
|
|||
|
||||
namespace LibHac.Fs.Shim;
|
||||
|
||||
/// <summary>
|
||||
/// Contains functions used for mounting and interacting with the SD card.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class SdCard
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for suspending, resuming, and checking sdmmc status.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class SdmmcControl
|
||||
{
|
||||
public static Result GetSdmmcConnectionStatus(this FileSystemClient fs, out SdmmcSpeedMode speedMode,
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for checking if a mounted file system was created from a signed system partition.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
public static class SignedSystemPartition
|
||||
{
|
||||
public static bool IsValidSignedSystemPartitionOnSdCard(this FileSystemClient fs, U8Span path)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace LibHac.Fs.Shim;
|
|||
/// <summary>
|
||||
/// Contains functions for mounting system save data file systems.
|
||||
/// </summary>
|
||||
/// <remarks>Based on nnSdk 13.4.0</remarks>
|
||||
/// <remarks>Based on nnSdk 14.3.0</remarks>
|
||||
[SkipLocalsInit]
|
||||
public static class SystemSaveData
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue