mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 12:34:47 +00:00
fs: improve unsupportedoperation results
This commit is contained in:
parent
dbfcbf55c7
commit
259a1a7513
5 changed files with 29 additions and 29 deletions
|
@ -63,7 +63,7 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
return fs::ResultUnsupportedMemoryStorageSetSize();
|
||||
return fs::ResultUnsupportedOperationInMemoryStorageA();
|
||||
}
|
||||
|
||||
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
|
@ -76,7 +76,7 @@ namespace ams::fs {
|
|||
reinterpret_cast<QueryRangeInfo *>(dst)->Clear();
|
||||
return ResultSuccess();
|
||||
default:
|
||||
return fs::ResultUnsupportedMemoryStorageOperateRange();
|
||||
return fs::ResultUnsupportedOperationInMemoryStorageB();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -103,13 +103,13 @@ namespace ams::fs {
|
|||
virtual Result SetSize(s64 size) override {
|
||||
/* Ensure we're initialized and validate arguments. */
|
||||
R_UNLESS(this->IsValid(), fs::ResultNotInitialized());
|
||||
R_UNLESS(this->resizable, fs::ResultUnsupportedSubStorageSetSizeA());
|
||||
R_UNLESS(this->resizable, fs::ResultUnsupportedOperationInSubStorageA());
|
||||
R_UNLESS(IStorage::IsOffsetAndSizeValid(this->offset, size), fs::ResultInvalidSize());
|
||||
|
||||
/* Ensure that we're allowed to set size. */
|
||||
s64 cur_size;
|
||||
R_TRY(this->base_storage->GetSize(std::addressof(cur_size)));
|
||||
R_UNLESS(cur_size == this->offset + this->size, fs::ResultUnsupportedSubStorageSetSizeB());
|
||||
R_UNLESS(cur_size == this->offset + this->size, fs::ResultUnsupportedOperationInSubStorageB());
|
||||
|
||||
/* Set the size. */
|
||||
R_TRY(this->base_storage->SetSize(this->offset + size));
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace ams::fs {
|
|||
R_UNLESS(IStorage::IsOffsetAndSizeValid(offset, size), fs::ResultOutOfRange());
|
||||
return this->base_file->OperateRange(dst, dst_size, op_id, offset, size, src, src_size);
|
||||
default:
|
||||
return fs::ResultUnsupportedFileStorageOperateRange();
|
||||
return fs::ResultUnsupportedOperationInFileStorageA();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -223,11 +223,11 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
virtual Result WriteImpl(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override {
|
||||
return fs::ResultUnsupportedRomFsFileWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileA();
|
||||
}
|
||||
|
||||
virtual Result SetSizeImpl(s64 size) override {
|
||||
return fs::ResultUnsupportedRomFsFileWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileA();
|
||||
}
|
||||
|
||||
virtual Result OperateRangeImpl(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
|
@ -239,7 +239,7 @@ namespace ams::fs {
|
|||
R_UNLESS(this->GetSize() >= 0, fs::ResultOutOfRange());
|
||||
}
|
||||
default:
|
||||
return fs::ResultUnsupportedRomFsFileOperateRange();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileB();
|
||||
}
|
||||
}
|
||||
public:
|
||||
|
@ -438,31 +438,31 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
Result RomFsFileSystem::CreateFileImpl(const char *path, s64 size, int flags) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DeleteFileImpl(const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::CreateDirectoryImpl(const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DeleteDirectoryImpl(const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::DeleteDirectoryRecursivelyImpl(const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::RenameFileImpl(const char *old_path, const char *new_path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::RenameDirectoryImpl(const char *old_path, const char *new_path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::GetEntryTypeImpl(fs::DirectoryEntryType *out, const char *path) {
|
||||
|
@ -519,19 +519,19 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
Result RomFsFileSystem::GetFreeSpaceSizeImpl(s64 *out, const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemGetSize();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemC();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::GetTotalSpaceSizeImpl(s64 *out, const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemGetSize();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemC();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::CleanDirectoryRecursivelyImpl(const char *path) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemWrite();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::CommitProvisionallyImpl(s64 counter) {
|
||||
return fs::ResultUnsupportedRomFsFileSystemCommitProvisionally();
|
||||
return fs::ResultUnsupportedOperationInRomFsFileSystemB();
|
||||
}
|
||||
|
||||
Result RomFsFileSystem::RollbackImpl() {
|
||||
|
|
|
@ -232,16 +232,16 @@ namespace ams::fs {
|
|||
R_DEFINE_ERROR_RESULT(FileExtensionWithoutOpenModeAllowAppend, 6201);
|
||||
|
||||
R_DEFINE_ERROR_RANGE(UnsupportedOperation, 6300, 6399);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedSubStorageSetSizeA, 6302);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedSubStorageSetSizeB, 6303);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedMemoryStorageSetSize, 6304);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedMemoryStorageOperateRange, 6305);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedFileStorageOperateRange, 6306);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedRomFsFileSystemWrite, 6364);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedRomFsFileSystemCommitProvisionally, 6365);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedRomFsFileSystemGetSize, 6366);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedRomFsFileWrite, 6367);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedRomFsFileOperateRange, 6368);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInSubStorageA, 6302);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInSubStorageB, 6303);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInMemoryStorageA, 6304);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInMemoryStorageB, 6305);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInFileStorageA, 6306);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileSystemA, 6364);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileSystemB, 6365);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileSystemC, 6366);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileA, 6367);
|
||||
R_DEFINE_ERROR_RESULT(UnsupportedOperationInRomFsFileB, 6368);
|
||||
|
||||
R_DEFINE_ERROR_RANGE(PermissionDenied, 6400, 6449);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue