Add a few more method definitions to IFileSystemProxy

This commit is contained in:
Alex Barney 2019-09-16 22:05:22 -05:00
parent 4bbfa057d2
commit 7222c7d469
7 changed files with 90 additions and 9 deletions

View file

@ -59,4 +59,24 @@
User = 0, User = 0,
SdCard = 1 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
}
} }

View file

@ -280,13 +280,13 @@ namespace LibHac.Fs.Save
} }
} }
public enum SaveDataType public enum SaveDataType : byte
{ {
SystemSaveData, SystemSaveData = 0,
SaveData, SaveData = 1,
BcatDeliveryCacheStorage, BcatDeliveryCacheStorage = 2,
DeviceSaveData, DeviceSaveData = 3,
TemporaryStorage, TemporaryStorage = 4,
CacheStorage CacheStorage = 5
} }
} }

View 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;
}
}

View file

@ -0,0 +1,10 @@
using System.Runtime.InteropServices;
namespace LibHac.Fs
{
[StructLayout(LayoutKind.Explicit, Size = 0x40)]
public struct SaveDataCreateInfo
{
// Todo
}
}

View 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;
}
}

View file

@ -1,13 +1,28 @@
using System; using System;
using LibHac.Common;
using LibHac.Fs; using LibHac.Fs;
using LibHac.Ncm;
namespace LibHac.FsService namespace LibHac.FsService
{ {
public interface IFileSystemProxy public interface IFileSystemProxy
{ {
Result SetCurrentProcess(long processId); 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 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 OpenGameCardStorage(out IStorage storage, GameCardHandle handle, GameCardPartitionRaw partitionId);
Result OpenSaveDataFileSystem(out IFileSystem fileSystem, SaveDataSpaceId spaceId, SaveDataAttribute attribute); Result OpenSaveDataFileSystem(out IFileSystem fileSystem, SaveDataSpaceId spaceId, SaveDataAttribute attribute);
Result OpenSaveDataFileSystemBySystemSaveDataId(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 OpenCustomStorageFileSystem(out IFileSystem fileSystem, CustomStorageId storageId);
Result SetSdCardEncryptionSeed(ReadOnlySpan<byte> seed); Result SetSdCardEncryptionSeed(ReadOnlySpan<byte> seed);
Result SetSaveDataSize(long saveDataSize, long saveDataJournalSize); Result SetSaveDataSize(long saveDataSize, long saveDataJournalSize);
Result SetSaveDataRootPath(string path); Result SetSaveDataRootPath(U8Span path);
Result DisableAutoSaveDataCreation(); Result DisableAutoSaveDataCreation();
} }
} }

View file

@ -0,0 +1,9 @@
namespace LibHac.Ncm
{
public struct TitleId
{
public ulong Value;
public static explicit operator ulong(TitleId titleId) => titleId.Value;
}
}