aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/registered_cache.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-11-27 13:52:13 -0500
committerLioncash <mathew1800@gmail.com>2018-11-27 16:33:14 -0500
commitd72c809030ac74c532dd0126bf2ce7494a01cc9b (patch)
treecdccfa369f2be364e8b58bfad41fa1b1f8093790 /src/core/file_sys/registered_cache.h
parent1cd40f107f2681bf3df84aa148feb20a179d6c23 (diff)
file_sys/registered_cache: Use regular const references instead of std::shared_ptr for InstallEntry()
These parameters don't need to utilize a shared lifecycle directly in the interface. Instead, the caller should provide a regular reference for the function to use. This also allows the type system to flag attempts to pass nullptr and makes it more generic, since it can now be used in contexts where a shared_ptr isn't being used (in other words, we don't constrain the usage of the interface to a particular mode of memory management).
Diffstat (limited to 'src/core/file_sys/registered_cache.h')
-rw-r--r--src/core/file_sys/registered_cache.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h
index 6b89db8de..d2269fd4b 100644
--- a/src/core/file_sys/registered_cache.h
+++ b/src/core/file_sys/registered_cache.h
@@ -104,17 +104,16 @@ public:
// Raw copies all the ncas from the xci/nsp to the csache. Does some quick checks to make sure
// there is a meta NCA and all of them are accessible.
- InstallResult InstallEntry(std::shared_ptr<XCI> xci, bool overwrite_if_exists = false,
+ InstallResult InstallEntry(const XCI& xci, bool overwrite_if_exists = false,
const VfsCopyFunction& copy = &VfsRawCopy);
- InstallResult InstallEntry(std::shared_ptr<NSP> nsp, bool overwrite_if_exists = false,
+ InstallResult InstallEntry(const NSP& nsp, bool overwrite_if_exists = false,
const VfsCopyFunction& copy = &VfsRawCopy);
// Due to the fact that we must use Meta-type NCAs to determine the existance of files, this
// poses quite a challenge. Instead of creating a new meta NCA for this file, yuzu will create a
// dir inside the NAND called 'yuzu_meta' and store the raw CNMT there.
// TODO(DarkLordZach): Author real meta-type NCAs and install those.
- InstallResult InstallEntry(std::shared_ptr<NCA> nca, TitleType type,
- bool overwrite_if_exists = false,
+ InstallResult InstallEntry(const NCA& nca, TitleType type, bool overwrite_if_exists = false,
const VfsCopyFunction& copy = &VfsRawCopy);
private:
@@ -128,7 +127,7 @@ private:
std::optional<NcaID> GetNcaIDFromMetadata(u64 title_id, ContentRecordType type) const;
VirtualFile GetFileAtID(NcaID id) const;
VirtualFile OpenFileOrDirectoryConcat(const VirtualDir& dir, std::string_view path) const;
- InstallResult RawInstallNCA(std::shared_ptr<NCA> nca, const VfsCopyFunction& copy,
+ InstallResult RawInstallNCA(const NCA& nca, const VfsCopyFunction& copy,
bool overwrite_if_exists, std::optional<NcaID> override_id = {});
bool RawInstallYuzuMeta(const CNMT& cnmt);