aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/registered_cache.h
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-07-05 09:37:50 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-07-15 13:27:04 -0400
commita82fdea1ac84693288ed5656f3ff89ceaaaeea1b (patch)
treeb2b362dce4013d5254d06ccfa105ea83956d84e2 /src/core/file_sys/registered_cache.h
parent263200f982f1c8509450721cf5fa9d8639c198ef (diff)
registered_cache: Remove previous update/dlc if it exists on install
- This checks for and removes old updates or dlc based on title id. If a content meta nca exists within the registered cache, it will attempt to remove all the ncas associated with the content meta before installing a new update/dlc
Diffstat (limited to 'src/core/file_sys/registered_cache.h')
-rw-r--r--src/core/file_sys/registered_cache.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h
index f339cd17b..8598f0543 100644
--- a/src/core/file_sys/registered_cache.h
+++ b/src/core/file_sys/registered_cache.h
@@ -34,6 +34,7 @@ using VfsCopyFunction = std::function<bool(const VirtualFile&, const VirtualFile
enum class InstallResult {
Success,
+ OverwriteExisting,
ErrorAlreadyExists,
ErrorCopyFailed,
ErrorMetaFailed,
@@ -132,9 +133,9 @@ public:
// Parsing function defines the conversion from raw file to NCA. If there are other steps
// besides creating the NCA from the file (e.g. NAX0 on SD Card), that should go in a custom
// parsing function.
- explicit RegisteredCache(VirtualDir dir,
- ContentProviderParsingFunction parsing_function =
- [](const VirtualFile& file, const NcaID& id) { return file; });
+ explicit RegisteredCache(
+ VirtualDir dir, ContentProviderParsingFunction parsing_function =
+ [](const VirtualFile& file, const NcaID& id) { return file; });
~RegisteredCache() override;
void Refresh() override;
@@ -154,6 +155,9 @@ public:
std::optional<TitleType> title_type = {}, std::optional<ContentRecordType> record_type = {},
std::optional<u64> title_id = {}) const override;
+ // Removes an existing entry based on title id
+ bool RemoveExistingEntry(const u64 title_id);
+
// 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(const XCI& xci, bool overwrite_if_exists = false,