Implement support for parsing/interacting with NCAs. (#942)

* fs: implement support for interacting with ncas.

* spl: extend to use virtual keyslots
This commit is contained in:
SciresM 2020-05-11 15:04:51 -07:00 committed by GitHub
parent 3a1ccdd919
commit 81f91803ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 13301 additions and 405 deletions

View file

@ -90,6 +90,18 @@ namespace ams::fs {
}
}
Result FileStorageBasedFileSystem::Initialize(std::shared_ptr<fs::fsa::IFileSystem> base_file_system, const char *path, fs::OpenMode mode) {
/* Open the file. */
std::unique_ptr<fs::fsa::IFile> base_file;
R_TRY(base_file_system->OpenFile(std::addressof(base_file), path, mode));
/* Set the file. */
this->SetFile(std::move(base_file));
this->base_file_system = std::move(base_file_system);
return ResultSuccess();
}
Result FileHandleStorage::UpdateSize() {
R_SUCCEED_IF(this->size != InvalidSize);
return GetFileSize(std::addressof(this->size), this->handle);