HostInterface: Make helper methods const

This commit is contained in:
Connor McLaughlin 2020-02-16 00:14:25 +09:00
parent 153eded978
commit f0578bb932
2 changed files with 10 additions and 10 deletions

View File

@ -543,7 +543,7 @@ std::string HostInterface::GetGameListDatabaseFileName() const
return GetUserDirectoryRelativePath("cache/redump.dat"); return GetUserDirectoryRelativePath("cache/redump.dat");
} }
std::string HostInterface::GetGameSaveStateFileName(const char* game_code, s32 slot) std::string HostInterface::GetGameSaveStateFileName(const char* game_code, s32 slot) const
{ {
if (slot < 0) if (slot < 0)
return GetUserDirectoryRelativePath("savestates/%s_resume.sav", game_code); return GetUserDirectoryRelativePath("savestates/%s_resume.sav", game_code);
@ -551,7 +551,7 @@ std::string HostInterface::GetGameSaveStateFileName(const char* game_code, s32 s
return GetUserDirectoryRelativePath("savestates/%s_%d.sav", game_code, slot); return GetUserDirectoryRelativePath("savestates/%s_%d.sav", game_code, slot);
} }
std::string HostInterface::GetGlobalSaveStateFileName(s32 slot) std::string HostInterface::GetGlobalSaveStateFileName(s32 slot) const
{ {
if (slot < 0) if (slot < 0)
return GetUserDirectoryRelativePath("savestates/resume.sav"); return GetUserDirectoryRelativePath("savestates/resume.sav");
@ -559,17 +559,17 @@ std::string HostInterface::GetGlobalSaveStateFileName(s32 slot)
return GetUserDirectoryRelativePath("savestates/savestate_%d.sav", slot); return GetUserDirectoryRelativePath("savestates/savestate_%d.sav", slot);
} }
std::string HostInterface::GetSharedMemoryCardPath(u32 slot) std::string HostInterface::GetSharedMemoryCardPath(u32 slot) const
{ {
return GetUserDirectoryRelativePath("memcards/shared_card_%d.mcd", slot + 1); return GetUserDirectoryRelativePath("memcards/shared_card_%d.mcd", slot + 1);
} }
std::string HostInterface::GetGameMemoryCardPath(const char* game_code, u32 slot) std::string HostInterface::GetGameMemoryCardPath(const char* game_code, u32 slot) const
{ {
return GetUserDirectoryRelativePath("memcards/game_card_%s_%d.mcd", game_code, slot + 1); return GetUserDirectoryRelativePath("memcards/game_card_%s_%d.mcd", game_code, slot + 1);
} }
std::vector<HostInterface::SaveStateInfo> HostInterface::GetAvailableSaveStates(const char* game_code) std::vector<HostInterface::SaveStateInfo> HostInterface::GetAvailableSaveStates(const char* game_code) const
{ {
std::vector<SaveStateInfo> si; std::vector<SaveStateInfo> si;
std::string path; std::string path;

View File

@ -108,19 +108,19 @@ protected:
std::string GetGameListDatabaseFileName() const; std::string GetGameListDatabaseFileName() const;
/// Returns the path to a save state file. Specifying an index of -1 is the "resume" save state. /// Returns the path to a save state file. Specifying an index of -1 is the "resume" save state.
std::string GetGameSaveStateFileName(const char* game_code, s32 slot); std::string GetGameSaveStateFileName(const char* game_code, s32 slot) const;
/// Returns the path to a save state file. Specifying an index of -1 is the "resume" save state. /// Returns the path to a save state file. Specifying an index of -1 is the "resume" save state.
std::string GetGlobalSaveStateFileName(s32 slot); std::string GetGlobalSaveStateFileName(s32 slot) const;
/// Returns the default path to a memory card. /// Returns the default path to a memory card.
std::string GetSharedMemoryCardPath(u32 slot); std::string GetSharedMemoryCardPath(u32 slot) const;
/// Returns the default path to a memory card for a specific game. /// Returns the default path to a memory card for a specific game.
std::string GetGameMemoryCardPath(const char* game_code, u32 slot); std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const;
/// Returns a list of save states for the specified game code. /// Returns a list of save states for the specified game code.
std::vector<SaveStateInfo> GetAvailableSaveStates(const char* game_code); std::vector<SaveStateInfo> GetAvailableSaveStates(const char* game_code) const;
/// Loads the current emulation state from file. Specifying a slot of -1 loads the "resume" game state. /// Loads the current emulation state from file. Specifying a slot of -1 loads the "resume" game state.
bool LoadState(bool global, u32 slot); bool LoadState(bool global, u32 slot);