GameList: Add GetEntryBySerialAndHash()

This commit is contained in:
Stenzek 2023-05-15 23:47:22 +10:00
parent 1b29212d6c
commit d8e980887f
2 changed files with 12 additions and 0 deletions

View file

@ -590,6 +590,17 @@ const GameList::Entry* GameList::GetEntryBySerial(const std::string_view& serial
return nullptr;
}
const GameList::Entry* GameList::GetEntryBySerialAndHash(const std::string_view& serial, u64 hash)
{
for (const Entry& entry : s_entries)
{
if (entry.serial == serial && entry.hash == hash)
return &entry;
}
return nullptr;
}
u32 GameList::GetEntryCount()
{
return static_cast<u32>(s_entries.size());

View file

@ -71,6 +71,7 @@ std::unique_lock<std::recursive_mutex> GetLock();
const Entry* GetEntryByIndex(u32 index);
const Entry* GetEntryForPath(const char* path);
const Entry* GetEntryBySerial(const std::string_view& serial);
const Entry* GetEntryBySerialAndHash(const std::string_view& serial, u64 hash);
u32 GetEntryCount();
bool IsGameListLoaded();