mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Add new functions to existing classes deriving from IFileSystem
This commit is contained in:
parent
ce54ae111c
commit
0ab96f67bf
@ -128,8 +128,8 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
|
||||
2,4781,,GameCardLogoDataCorrupted,
|
||||
|
||||
2,4791,4799,MultiCommitContextCorrupted,
|
||||
2,4791,,InvalidMultiCommitContextVersion,
|
||||
2,4792,,InvalidMultiCommitContextState,
|
||||
2,4791,,InvalidMultiCommitContextVersion,The version of the multi-commit context file is to high for the current MultiCommitManager implementation.
|
||||
2,4792,,InvalidMultiCommitContextState,The multi-commit has not been provisionally committed.
|
||||
|
||||
# The range name is a guess. 4812 is currently the only result in it
|
||||
2,4811,4819,ZeroBitmapFileCorrupted,
|
||||
@ -186,14 +186,17 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
|
||||
2,6351,,UnsupportedOperationInRoGameCardStorageSetSize,
|
||||
2,6359,,UnsupportedOperationInConcatFsQueryEntry,
|
||||
2,6364,,UnsupportedOperationModifyRomFsFileSystem,
|
||||
2,6365,,UnsupportedOperationInRomFsFileSystem,Called RomFsFileSystem::CommitProvisionally.
|
||||
2,6366,,UnsupportedOperationRomFsFileSystemGetSpace,
|
||||
2,6367,,UnsupportedOperationModifyRomFsFile,
|
||||
2,6369,,UnsupportedOperationModifyReadOnlyFileSystem,
|
||||
2,6371,,UnsupportedOperationReadOnlyFileSystemGetSpace,
|
||||
2,6372,,UnsupportedOperationModifyReadOnlyFile,
|
||||
2,6374,,UnsupportedOperationModifyPartitionFileSystem,
|
||||
2,6375,,UnsupportedOperationInPartitionFileSystem,Called PartitionFileSystemCore::CommitProvisionally.
|
||||
2,6376,,UnsupportedOperationInPartitionFileSetSize,
|
||||
2,6377,,UnsupportedOperationIdInPartitionFileSystem,
|
||||
2,6384,,UnsupportedOperationInDirectorySaveDataFileSystem,Called DirectorySaveDataFileSystem::CommitProvisionally on a non-user savedata.
|
||||
|
||||
2,6400,6449,PermissionDenied,
|
||||
|
||||
@ -201,7 +204,7 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
|
||||
2,6454,,WriteStateUnflushed,
|
||||
2,6457,,WriteModeFileNotClosed,
|
||||
2,6461,,AllocatorAlignmentViolation,
|
||||
2,6463,,MultiCommitFileSystemAlreadyAdded,
|
||||
2,6463,,MultiCommitFileSystemAlreadyAdded,The provided file system has already been added to the multi-commit manager.
|
||||
2,6465,,UserNotExist,
|
||||
|
||||
2,6600,6699,EntryNotFound,
|
||||
@ -211,7 +214,7 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
|
||||
2,6706,,MappingTableFull,
|
||||
2,6707,,AllocationTableInsufficientFreeBlocks,
|
||||
2,6709,,OpenCountLimit,
|
||||
2,6710,,MultiCommitFileSystemLimit,
|
||||
2,6710,,MultiCommitFileSystemLimit,The maximum number of file systems have been added to the multi-commit manager.
|
||||
|
||||
2,6800,6899,MappingFailed,
|
||||
2,6811,,RemapStorageMapFull,
|
||||
|
|
@ -258,9 +258,9 @@ namespace LibHac.Fs
|
||||
|
||||
/// <summary>Error code: 2002-4791; Range: 4791-4799; Inner value: 0x256e02</summary>
|
||||
public static Result.Base MultiCommitContextCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4791, 4799); }
|
||||
/// <summary>Error code: 2002-4791; Inner value: 0x256e02</summary>
|
||||
/// <summary>The version of the multi-commit context file is to high for the current MultiCommitManager implementation.<br/>Error code: 2002-4791; Inner value: 0x256e02</summary>
|
||||
public static Result.Base InvalidMultiCommitContextVersion => new Result.Base(ModuleFs, 4791);
|
||||
/// <summary>Error code: 2002-4792; Inner value: 0x257002</summary>
|
||||
/// <summary>The multi-commit has not been provisionally committed.<br/>Error code: 2002-4792; Inner value: 0x257002</summary>
|
||||
public static Result.Base InvalidMultiCommitContextState => new Result.Base(ModuleFs, 4792);
|
||||
|
||||
/// <summary>Error code: 2002-4811; Range: 4811-4819; Inner value: 0x259602</summary>
|
||||
@ -364,6 +364,8 @@ namespace LibHac.Fs
|
||||
public static Result.Base UnsupportedOperationInConcatFsQueryEntry => new Result.Base(ModuleFs, 6359);
|
||||
/// <summary>Error code: 2002-6364; Inner value: 0x31b802</summary>
|
||||
public static Result.Base UnsupportedOperationModifyRomFsFileSystem => new Result.Base(ModuleFs, 6364);
|
||||
/// <summary>Called RomFsFileSystem::CommitProvisionally.<br/>Error code: 2002-6365; Inner value: 0x31ba02</summary>
|
||||
public static Result.Base UnsupportedOperationInRomFsFileSystem => new Result.Base(ModuleFs, 6365);
|
||||
/// <summary>Error code: 2002-6366; Inner value: 0x31bc02</summary>
|
||||
public static Result.Base UnsupportedOperationRomFsFileSystemGetSpace => new Result.Base(ModuleFs, 6366);
|
||||
/// <summary>Error code: 2002-6367; Inner value: 0x31be02</summary>
|
||||
@ -376,10 +378,14 @@ namespace LibHac.Fs
|
||||
public static Result.Base UnsupportedOperationModifyReadOnlyFile => new Result.Base(ModuleFs, 6372);
|
||||
/// <summary>Error code: 2002-6374; Inner value: 0x31cc02</summary>
|
||||
public static Result.Base UnsupportedOperationModifyPartitionFileSystem => new Result.Base(ModuleFs, 6374);
|
||||
/// <summary>Called PartitionFileSystemCore::CommitProvisionally.<br/>Error code: 2002-6375; Inner value: 0x31ce02</summary>
|
||||
public static Result.Base UnsupportedOperationInPartitionFileSystem => new Result.Base(ModuleFs, 6375);
|
||||
/// <summary>Error code: 2002-6376; Inner value: 0x31d002</summary>
|
||||
public static Result.Base UnsupportedOperationInPartitionFileSetSize => new Result.Base(ModuleFs, 6376);
|
||||
/// <summary>Error code: 2002-6377; Inner value: 0x31d202</summary>
|
||||
public static Result.Base UnsupportedOperationIdInPartitionFileSystem => new Result.Base(ModuleFs, 6377);
|
||||
/// <summary>Called DirectorySaveDataFileSystem::CommitProvisionally on a non-user savedata.<br/>Error code: 2002-6384; Inner value: 0x31e002</summary>
|
||||
public static Result.Base UnsupportedOperationInDirectorySaveDataFileSystem => new Result.Base(ModuleFs, 6384);
|
||||
|
||||
/// <summary>Error code: 2002-6400; Range: 6400-6449; Inner value: 0x320002</summary>
|
||||
public static Result.Base PermissionDenied { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6400, 6449); }
|
||||
@ -392,7 +398,7 @@ namespace LibHac.Fs
|
||||
public static Result.Base WriteModeFileNotClosed => new Result.Base(ModuleFs, 6457);
|
||||
/// <summary>Error code: 2002-6461; Inner value: 0x327a02</summary>
|
||||
public static Result.Base AllocatorAlignmentViolation => new Result.Base(ModuleFs, 6461);
|
||||
/// <summary>Error code: 2002-6463; Inner value: 0x327e02</summary>
|
||||
/// <summary>The provided file system has already been added to the multi-commit manager.<br/>Error code: 2002-6463; Inner value: 0x327e02</summary>
|
||||
public static Result.Base MultiCommitFileSystemAlreadyAdded => new Result.Base(ModuleFs, 6463);
|
||||
/// <summary>Error code: 2002-6465; Inner value: 0x328202</summary>
|
||||
public static Result.Base UserNotExist => new Result.Base(ModuleFs, 6465);
|
||||
@ -410,7 +416,7 @@ namespace LibHac.Fs
|
||||
public static Result.Base AllocationTableInsufficientFreeBlocks => new Result.Base(ModuleFs, 6707);
|
||||
/// <summary>Error code: 2002-6709; Inner value: 0x346a02</summary>
|
||||
public static Result.Base OpenCountLimit => new Result.Base(ModuleFs, 6709);
|
||||
/// <summary>Error code: 2002-6710; Inner value: 0x346c02</summary>
|
||||
/// <summary>The maximum number of file systems have been added to the multi-commit manager.<br/>Error code: 2002-6710; Inner value: 0x346c02</summary>
|
||||
public static Result.Base MultiCommitFileSystemLimit => new Result.Base(ModuleFs, 6710);
|
||||
|
||||
/// <summary>Error code: 2002-6800; Range: 6800-6899; Inner value: 0x352002</summary>
|
||||
|
@ -221,6 +221,16 @@ namespace LibHac.FsSystem
|
||||
return BaseFileSystem.Commit();
|
||||
}
|
||||
|
||||
protected override Result CommitProvisionallyImpl(long commitCount)
|
||||
{
|
||||
return BaseFileSystem.CommitProvisionally(commitCount);
|
||||
}
|
||||
|
||||
protected override Result RollbackImpl()
|
||||
{
|
||||
return BaseFileSystem.Rollback();
|
||||
}
|
||||
|
||||
protected override Result QueryEntryImpl(Span<byte> outBuffer, ReadOnlySpan<byte> inBuffer, QueryId queryId,
|
||||
U8Span path)
|
||||
{
|
||||
|
@ -306,6 +306,16 @@ namespace LibHac.FsSystem
|
||||
return BaseFileSystem.Commit();
|
||||
}
|
||||
|
||||
protected override Result CommitProvisionallyImpl(long commitCount)
|
||||
{
|
||||
return BaseFileSystem.CommitProvisionally(commitCount);
|
||||
}
|
||||
|
||||
protected override Result FlushImpl()
|
||||
{
|
||||
return BaseFileSystem.Flush();
|
||||
}
|
||||
|
||||
protected override Result QueryEntryImpl(Span<byte> outBuffer, ReadOnlySpan<byte> inBuffer, QueryId queryId,
|
||||
U8Span path)
|
||||
{
|
||||
|
@ -299,6 +299,23 @@ namespace LibHac.FsSystem
|
||||
}
|
||||
}
|
||||
|
||||
protected override Result CommitProvisionallyImpl(long commitCount)
|
||||
{
|
||||
if (!IsUserSaveData)
|
||||
return ResultFs.UnsupportedOperationIdInPartitionFileSystem.Log();
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
protected override Result RollbackImpl()
|
||||
{
|
||||
// No old data is kept for temporary save data, so there's nothing to rollback to
|
||||
if (!IsPersistentSaveData)
|
||||
return Result.Success;
|
||||
|
||||
return Initialize(IsPersistentSaveData, IsUserSaveData);
|
||||
}
|
||||
|
||||
private Result ResolveFullPath(Span<byte> outPath, U8Span relativePath)
|
||||
{
|
||||
if (StringUtils.GetLength(relativePath, PathTools.MaxPathLength + 1) > PathTools.MaxPathLength)
|
||||
|
@ -108,6 +108,7 @@ namespace LibHac.FsSystem
|
||||
protected override Result DeleteFileImpl(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result RenameDirectoryImpl(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result RenameFileImpl(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result CommitProvisionallyImpl(long commitCount) => ResultFs.UnsupportedOperationInPartitionFileSystem.Log();
|
||||
|
||||
private class PartitionFile : FileBase
|
||||
{
|
||||
|
@ -92,6 +92,7 @@ namespace LibHac.FsSystem.RomFs
|
||||
protected override Result DeleteFileImpl(U8Span path) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result RenameDirectoryImpl(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result RenameFileImpl(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result CommitProvisionallyImpl(long commitCount) => ResultFs.UnsupportedOperationInRomFsFileSystem.Log();
|
||||
|
||||
protected override Result GetFreeSpaceSizeImpl(out long freeSpace, U8Span path)
|
||||
{
|
||||
|
@ -194,6 +194,16 @@ namespace LibHac.FsSystem
|
||||
return BaseFileSystem.Commit();
|
||||
}
|
||||
|
||||
protected override Result CommitProvisionallyImpl(long commitCount)
|
||||
{
|
||||
return BaseFileSystem.CommitProvisionally(commitCount);
|
||||
}
|
||||
|
||||
protected override Result RollbackImpl()
|
||||
{
|
||||
return BaseFileSystem.Rollback();
|
||||
}
|
||||
|
||||
protected override Result GetFreeSpaceSizeImpl(out long freeSpace, U8Span path)
|
||||
{
|
||||
freeSpace = default;
|
||||
|
Loading…
x
Reference in New Issue
Block a user