mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Add a TitleDatabase
Add a TitleDatabase to allow easily querying a title database to get a user-friendly string for a game ID.
This commit is contained in:
38
Source/Core/Core/TitleDatabase.h
Normal file
38
Source/Core/Core/TitleDatabase.h
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
// Reader for title database files.
|
||||
class TitleDatabase final
|
||||
{
|
||||
public:
|
||||
TitleDatabase();
|
||||
~TitleDatabase();
|
||||
|
||||
enum class TitleType
|
||||
{
|
||||
Channel,
|
||||
Other,
|
||||
};
|
||||
|
||||
// Get a user friendly title name for a game ID.
|
||||
// This falls back to returning an empty string if none could be found.
|
||||
std::string GetTitleName(const std::string& game_id, TitleType = TitleType::Other) const;
|
||||
|
||||
// Get a description for a game ID (title name if available + game ID).
|
||||
std::string Describe(const std::string& game_id, TitleType = TitleType::Other) const;
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::string> m_wii_title_map;
|
||||
std::unordered_map<std::string, std::string> m_gc_title_map;
|
||||
};
|
||||
} // namespace Core
|
Reference in New Issue
Block a user