summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-06-25 01:10:17 +0200
committerZach Hilman <zachhilman@gmail.com>2019-06-25 01:10:17 +0200
commitdb2e5e5fa6731c02a016ae583732ce1df8fae3b3 (patch)
tree180dd7b98313f3db6134ef76e12ee78a6d17d4c9 /src
parentpatch_manager: Add getter for title version (diff)
downloadyuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar
yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.gz
yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.bz2
yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.lz
yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.xz
yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.zst
yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/registered_cache.cpp14
-rw-r--r--src/core/file_sys/registered_cache.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index 58917e094..3bb921210 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -645,6 +645,20 @@ ContentProviderUnion::ListEntriesFilterOrigin(std::optional<ContentProviderUnion
return out;
}
+std::optional<ContentProviderUnionSlot> ContentProviderUnion::GetSlotForEntry(
+ u64 title_id, ContentRecordType type) const {
+ for (const auto& [slot, provider] : providers) {
+ if (provider == nullptr)
+ continue;
+
+ if (provider->HasEntry(title_id, type)) {
+ return slot;
+ }
+ }
+
+ return std::nullopt;
+}
+
ManualContentProvider::~ManualContentProvider() = default;
void ManualContentProvider::AddEntry(TitleType title_type, ContentRecordType content_type,
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h
index ec9052653..4398d63e1 100644
--- a/src/core/file_sys/registered_cache.h
+++ b/src/core/file_sys/registered_cache.h
@@ -199,6 +199,9 @@ public:
std::optional<TitleType> title_type = {}, std::optional<ContentRecordType> record_type = {},
std::optional<u64> title_id = {}) const;
+ std::optional<ContentProviderUnionSlot> GetSlotForEntry(u64 title_id,
+ ContentRecordType type) const;
+
private:
std::map<ContentProviderUnionSlot, ContentProvider*> providers;
};