mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
registered_cache: Add getter to determine source slot in content provider union
Used to determine StorageId source for application data.
This commit is contained in:
parent
a468273221
commit
db2e5e5fa6
@ -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:
|
|||||||
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;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user