diff options
| author | 2019-06-24 19:10:17 -0400 | |
|---|---|---|
| committer | 2019-06-24 19:10:17 -0400 | |
| commit | db2e5e5fa6731c02a016ae583732ce1df8fae3b3 (patch) | |
| tree | 180dd7b98313f3db6134ef76e12ee78a6d17d4c9 /src | |
| parent | patch_manager: Add getter for title version (diff) | |
| download | yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.gz yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.tar.xz yuzu-db2e5e5fa6731c02a016ae583732ce1df8fae3b3.zip | |
registered_cache: Add getter to determine source slot in content provider union
Used to determine StorageId source for application data.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/registered_cache.cpp | 14 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.h | 3 |
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 | |||
| 645 | return out; | 645 | return out; |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | std::optional<ContentProviderUnionSlot> ContentProviderUnion::GetSlotForEntry( | ||
| 649 | u64 title_id, ContentRecordType type) const { | ||
| 650 | for (const auto& [slot, provider] : providers) { | ||
| 651 | if (provider == nullptr) | ||
| 652 | continue; | ||
| 653 | |||
| 654 | if (provider->HasEntry(title_id, type)) { | ||
| 655 | return slot; | ||
| 656 | } | ||
| 657 | } | ||
| 658 | |||
| 659 | return std::nullopt; | ||
| 660 | } | ||
| 661 | |||
| 648 | ManualContentProvider::~ManualContentProvider() = default; | 662 | ManualContentProvider::~ManualContentProvider() = default; |
| 649 | 663 | ||
| 650 | void ManualContentProvider::AddEntry(TitleType title_type, ContentRecordType content_type, | 664 | 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: | |||
| 199 | std::optional<TitleType> title_type = {}, std::optional<ContentRecordType> record_type = {}, | 199 | std::optional<TitleType> title_type = {}, std::optional<ContentRecordType> record_type = {}, |
| 200 | std::optional<u64> title_id = {}) const; | 200 | std::optional<u64> title_id = {}) const; |
| 201 | 201 | ||
| 202 | std::optional<ContentProviderUnionSlot> GetSlotForEntry(u64 title_id, | ||
| 203 | ContentRecordType type) const; | ||
| 204 | |||
| 202 | private: | 205 | private: |
| 203 | std::map<ContentProviderUnionSlot, ContentProvider*> providers; | 206 | std::map<ContentProviderUnionSlot, ContentProvider*> providers; |
| 204 | }; | 207 | }; |