mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Add a few more method definitions to IFileSystemProxy
This commit is contained in:
parent
4bbfa057d2
commit
7222c7d469
7 changed files with 90 additions and 9 deletions
|
@ -59,4 +59,24 @@
|
|||
User = 0,
|
||||
SdCard = 1
|
||||
}
|
||||
|
||||
public enum FileSystemType
|
||||
{
|
||||
Code = 0,
|
||||
Data = 1,
|
||||
Logo = 2,
|
||||
ContentControl = 3,
|
||||
ContentManual = 4,
|
||||
ContentMeta = 5,
|
||||
ContentData = 6,
|
||||
ApplicationPackage = 7,
|
||||
RegisteredUpdate = 8
|
||||
}
|
||||
|
||||
public enum SaveMetaType : byte
|
||||
{
|
||||
None = 0,
|
||||
Thumbnail = 1,
|
||||
ExtensionInfo = 2
|
||||
}
|
||||
}
|
||||
|
|
|
@ -280,13 +280,13 @@ namespace LibHac.Fs.Save
|
|||
}
|
||||
}
|
||||
|
||||
public enum SaveDataType
|
||||
public enum SaveDataType : byte
|
||||
{
|
||||
SystemSaveData,
|
||||
SaveData,
|
||||
BcatDeliveryCacheStorage,
|
||||
DeviceSaveData,
|
||||
TemporaryStorage,
|
||||
CacheStorage
|
||||
SystemSaveData = 0,
|
||||
SaveData = 1,
|
||||
BcatDeliveryCacheStorage = 2,
|
||||
DeviceSaveData = 3,
|
||||
TemporaryStorage = 4,
|
||||
CacheStorage = 5
|
||||
}
|
||||
}
|
||||
|
|
16
src/LibHac/Fs/SaveDataAttribute2.cs
Normal file
16
src/LibHac/Fs/SaveDataAttribute2.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using LibHac.Fs.Save;
|
||||
|
||||
namespace LibHac.Fs
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 0x40)]
|
||||
public struct SaveDataAttribute2
|
||||
{
|
||||
[FieldOffset(0x00)] public ulong TitleId;
|
||||
[FieldOffset(0x08)] public UserId UserId;
|
||||
[FieldOffset(0x18)] public ulong SaveDataId;
|
||||
[FieldOffset(0x20)] public SaveDataType Type;
|
||||
[FieldOffset(0x21)] public byte Rank;
|
||||
[FieldOffset(0x22)] public short Index;
|
||||
}
|
||||
}
|
10
src/LibHac/Fs/SaveDataCreateInfo.cs
Normal file
10
src/LibHac/Fs/SaveDataCreateInfo.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace LibHac.Fs
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 0x40)]
|
||||
public struct SaveDataCreateInfo
|
||||
{
|
||||
// Todo
|
||||
}
|
||||
}
|
11
src/LibHac/Fs/SaveMetaCreateInfo.cs
Normal file
11
src/LibHac/Fs/SaveMetaCreateInfo.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace LibHac.Fs
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 0x10)]
|
||||
public struct SaveMetaCreateInfo
|
||||
{
|
||||
[FieldOffset(0)] public int Size;
|
||||
[FieldOffset(4)] public SaveMetaType Type;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,28 @@
|
|||
using System;
|
||||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
using LibHac.Ncm;
|
||||
|
||||
namespace LibHac.FsService
|
||||
{
|
||||
public interface IFileSystemProxy
|
||||
{
|
||||
Result SetCurrentProcess(long processId);
|
||||
Result OpenBisFileSystem(out IFileSystem fileSystem, string rootPath, BisPartitionId partitionId);
|
||||
Result OpenDataFileSystemByCurrentProcess(out IFileSystem fileSystem);
|
||||
Result OpenFileSystemWithPatch(out IFileSystem fileSystem, TitleId titleId, FileSystemType type);
|
||||
Result OpenFileSystemWithId(out IFileSystem fileSystem, U8Span path, TitleId titleId, FileSystemType type);
|
||||
Result OpenDataFileSystemByProgramId(out IFileSystem fileSystem, TitleId titleId);
|
||||
Result OpenBisFileSystem(out IFileSystem fileSystem, U8Span rootPath, BisPartitionId partitionId);
|
||||
Result OpenBisStorage(out IStorage storage, BisPartitionId partitionId);
|
||||
Result InvalidateBisCache();
|
||||
Result OpenHostFileSystem(out IFileSystem fileSystem, U8Span subPath);
|
||||
Result OpenSdCardFileSystem(out IFileSystem fileSystem);
|
||||
Result FormatSdCardFileSystem();
|
||||
Result DeleteSaveDataFileSystem(long saveDataId);
|
||||
Result CreateSaveDataFileSystem(ref SaveDataAttribute2 attribute, ref SaveDataCreateInfo createInfo, ref SaveMetaCreateInfo metaCreateInfo);
|
||||
Result CreateSaveDataFileSystemBySystemSaveDataId(ref SaveDataAttribute2 attribute, ref SaveDataCreateInfo createInfo);
|
||||
Result RegisterSaveDataFileSystemAtomicDeletion(ReadOnlySpan<ulong> saveDataIds);
|
||||
|
||||
Result OpenGameCardStorage(out IStorage storage, GameCardHandle handle, GameCardPartitionRaw partitionId);
|
||||
Result OpenSaveDataFileSystem(out IFileSystem fileSystem, SaveDataSpaceId spaceId, SaveDataAttribute attribute);
|
||||
Result OpenSaveDataFileSystemBySystemSaveDataId(out IFileSystem fileSystem, SaveDataSpaceId spaceId, SaveDataAttribute attribute);
|
||||
|
@ -15,7 +30,7 @@ namespace LibHac.FsService
|
|||
Result OpenCustomStorageFileSystem(out IFileSystem fileSystem, CustomStorageId storageId);
|
||||
Result SetSdCardEncryptionSeed(ReadOnlySpan<byte> seed);
|
||||
Result SetSaveDataSize(long saveDataSize, long saveDataJournalSize);
|
||||
Result SetSaveDataRootPath(string path);
|
||||
Result SetSaveDataRootPath(U8Span path);
|
||||
Result DisableAutoSaveDataCreation();
|
||||
}
|
||||
}
|
9
src/LibHac/Ncm/TitleId.cs
Normal file
9
src/LibHac/Ncm/TitleId.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
namespace LibHac.Ncm
|
||||
{
|
||||
public struct TitleId
|
||||
{
|
||||
public ulong Value;
|
||||
|
||||
public static explicit operator ulong(TitleId titleId) => titleId.Value;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue