Skip to content
Snippets Groups Projects
Commit db2e5e5f authored by Zach Hilman's avatar Zach Hilman
Browse files

registered_cache: Add getter to determine source slot in content provider union

Used to determine StorageId source for application data.
parent a4682732
No related branches found
No related tags found
No related merge requests found
...@@ -645,6 +645,20 @@ ContentProviderUnion::ListEntriesFilterOrigin(std::optional<ContentProviderUnion ...@@ -645,6 +645,20 @@ ContentProviderUnion::ListEntriesFilterOrigin(std::optional<ContentProviderUnion
return out; 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; ManualContentProvider::~ManualContentProvider() = default;
void ManualContentProvider::AddEntry(TitleType title_type, ContentRecordType content_type, void ManualContentProvider::AddEntry(TitleType title_type, ContentRecordType content_type,
......
...@@ -199,6 +199,9 @@ public: ...@@ -199,6 +199,9 @@ public:
std::optional<TitleType> title_type = {}, std::optional<ContentRecordType> record_type = {}, std::optional<TitleType> title_type = {}, std::optional<ContentRecordType> record_type = {},
std::optional<u64> title_id = {}) const; std::optional<u64> title_id = {}) const;
std::optional<ContentProviderUnionSlot> GetSlotForEntry(u64 title_id,
ContentRecordType type) const;
private: private:
std::map<ContentProviderUnionSlot, ContentProvider*> providers; std::map<ContentProviderUnionSlot, ContentProvider*> providers;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment