Auto-format SaveDataManagement

This commit is contained in:
Alex Barney 2021-05-12 01:45:00 -07:00
parent 5c6f78e751
commit 9f3e6db545

View file

@ -176,8 +176,8 @@ namespace LibHac.Fs.Shim
return Result.Success; return Result.Success;
} }
public static Result CreateSaveData(this FileSystemClientImpl fs, Ncm.ApplicationId applicationId, UserId userId, public static Result CreateSaveData(this FileSystemClientImpl fs, Ncm.ApplicationId applicationId,
ulong ownerId, long size, long journalSize, SaveDataFlags flags) UserId userId, ulong ownerId, long size, long journalSize, SaveDataFlags flags)
{ {
using ReferenceCountedDisposable<IFileSystemProxy> fsProxy = fs.GetFileSystemProxyServiceObject(); using ReferenceCountedDisposable<IFileSystemProxy> fsProxy = fs.GetFileSystemProxyServiceObject();
@ -195,7 +195,8 @@ namespace LibHac.Fs.Shim
return fsProxy.Target.CreateSaveDataFileSystem(in attribute, in creationInfo, in metaInfo); return fsProxy.Target.CreateSaveDataFileSystem(in attribute, in creationInfo, in metaInfo);
} }
public static Result CreateBcatSaveData(this FileSystemClientImpl fs, Ncm.ApplicationId applicationId, long size) public static Result CreateBcatSaveData(this FileSystemClientImpl fs, Ncm.ApplicationId applicationId,
long size)
{ {
using ReferenceCountedDisposable<IFileSystemProxy> fsProxy = fs.GetFileSystemProxyServiceObject(); using ReferenceCountedDisposable<IFileSystemProxy> fsProxy = fs.GetFileSystemProxyServiceObject();
@ -298,6 +299,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.DeleteSaveData(saveDataId); rc = fs.Impl.DeleteSaveData(saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -325,6 +327,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.DeleteSaveData(spaceId, saveDataId); rc = fs.Impl.DeleteSaveData(spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -354,6 +357,7 @@ namespace LibHac.Fs.Shim
{ {
rc = Delete(fs, spaceId, saveDataId, userId); rc = Delete(fs, spaceId, saveDataId, userId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -389,6 +393,7 @@ namespace LibHac.Fs.Shim
{ {
rc = Delete(fs, applicationId); rc = Delete(fs, applicationId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -606,6 +611,7 @@ namespace LibHac.Fs.Shim
{ {
rc = CreateSave(fs, applicationId, userId, ownerId, size, journalSize, in hashSalt, flags); rc = CreateSave(fs, applicationId, userId, ownerId, size, journalSize, in hashSalt, flags);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -898,6 +904,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.ExtendSaveData(spaceId, saveDataId, saveDataSize, journalSize); rc = fs.Impl.ExtendSaveData(spaceId, saveDataId, saveDataSize, journalSize);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -928,6 +935,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.ExtendSaveData(spaceId, saveDataId, saveDataSize, journalSize); rc = fs.Impl.ExtendSaveData(spaceId, saveDataId, saveDataSize, journalSize);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -995,6 +1003,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetOwnerId(fs, out ownerId, saveDataId); rc = GetOwnerId(fs, out ownerId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1034,6 +1043,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetOwnerId(fs, out ownerId, spaceId, saveDataId); rc = GetOwnerId(fs, out ownerId, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1070,6 +1080,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetFlags(fs, out flags, saveDataId); rc = GetFlags(fs, out flags, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1109,6 +1120,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetFlags(fs, out flags, spaceId, saveDataId); rc = GetFlags(fs, out flags, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1151,6 +1163,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetFlags(fs, out flags, spaceId, saveDataId, userId); rc = GetFlags(fs, out flags, spaceId, saveDataId, userId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1201,6 +1214,7 @@ namespace LibHac.Fs.Shim
{ {
rc = SetFlags(fs, saveDataId, spaceId, flags); rc = SetFlags(fs, saveDataId, spaceId, flags);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1242,6 +1256,7 @@ namespace LibHac.Fs.Shim
{ {
rc = SetFlags(fs, spaceId, saveDataId, userId, flags); rc = SetFlags(fs, spaceId, saveDataId, userId, flags);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1282,6 +1297,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetTimeStamp(fs, out timeStamp, saveDataId); rc = GetTimeStamp(fs, out timeStamp, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1322,6 +1338,7 @@ namespace LibHac.Fs.Shim
{ {
rc = SetTimeStamp(fs, spaceId, saveDataId, timeStamp); rc = SetTimeStamp(fs, spaceId, saveDataId, timeStamp);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1362,6 +1379,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetTimeStamp(fs, out timeStamp, spaceId, saveDataId); rc = GetTimeStamp(fs, out timeStamp, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1453,6 +1471,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.GetSaveDataAvailableSize(out availableSize, spaceId, saveDataId); rc = fs.Impl.GetSaveDataAvailableSize(out availableSize, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -1501,6 +1520,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.GetSaveDataJournalSize(out journalSize, saveDataId); rc = fs.Impl.GetSaveDataJournalSize(out journalSize, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -1529,6 +1549,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.GetSaveDataJournalSize(out journalSize, spaceId, saveDataId); rc = fs.Impl.GetSaveDataJournalSize(out journalSize, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -1557,6 +1578,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetCommitId(fs, out commitId, spaceId, saveDataId); rc = GetCommitId(fs, out commitId, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1595,6 +1617,7 @@ namespace LibHac.Fs.Shim
{ {
rc = SetCommitId(fs, spaceId, saveDataId, commitId); rc = SetCommitId(fs, spaceId, saveDataId, commitId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1644,6 +1667,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.QuerySaveDataInternalStorageTotalSize(out size, spaceId, saveDataId); rc = fs.Impl.QuerySaveDataInternalStorageTotalSize(out size, spaceId, saveDataId);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
} }
@ -1738,6 +1762,7 @@ namespace LibHac.Fs.Shim
{ {
rc = Delete(fs, index); rc = Delete(fs, index);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1776,6 +1801,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetSize(fs, out saveSize, out journalSize, index); rc = GetSize(fs, out saveSize, out journalSize, index);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1845,6 +1871,7 @@ namespace LibHac.Fs.Shim
{ {
rc = fs.Impl.Find(out fileSystem, mountName); rc = fs.Impl.Find(out fileSystem, mountName);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
if (rc.IsFailure()) return rc; if (rc.IsFailure()) return rc;
@ -1868,6 +1895,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetRestoreFlagValue(fs, out isRestoreFlagSet, fileSystem); rc = GetRestoreFlagValue(fs, out isRestoreFlagSet, fileSystem);
} }
fs.Impl.AbortIfNeeded(rc); fs.Impl.AbortIfNeeded(rc);
return rc; return rc;
@ -1921,6 +1949,7 @@ namespace LibHac.Fs.Shim
{ {
rc = GetSize(fs, out saveSize, out journalSize, applicationId); rc = GetSize(fs, out saveSize, out journalSize, applicationId);
} }
fs.AbortIfNeeded(rc); fs.AbortIfNeeded(rc);
return rc; return rc;