mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-23 15:22:45 +01: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
2 changed files with 17 additions and 0 deletions
|
@ -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 a new issue