2022-04-23 10:59:50 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-09-23 15:52:25 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
2021-09-03 03:40:55 +02:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2020-09-23 15:52:25 +02:00
|
|
|
class Config;
|
|
|
|
|
|
|
|
class InputProfiles {
|
|
|
|
|
|
|
|
public:
|
2021-09-03 03:40:55 +02:00
|
|
|
explicit InputProfiles(Core::System& system_);
|
2020-09-23 15:52:25 +02:00
|
|
|
virtual ~InputProfiles();
|
|
|
|
|
|
|
|
std::vector<std::string> GetInputProfileNames();
|
|
|
|
|
|
|
|
static bool IsProfileNameValid(std::string_view profile_name);
|
|
|
|
|
|
|
|
bool CreateProfile(const std::string& profile_name, std::size_t player_index);
|
|
|
|
bool DeleteProfile(const std::string& profile_name);
|
|
|
|
bool LoadProfile(const std::string& profile_name, std::size_t player_index);
|
|
|
|
bool SaveProfile(const std::string& profile_name, std::size_t player_index);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool ProfileExistsInMap(const std::string& profile_name) const;
|
|
|
|
|
|
|
|
std::unordered_map<std::string, std::unique_ptr<Config>> map_profiles;
|
2021-09-03 03:40:55 +02:00
|
|
|
|
|
|
|
Core::System& system;
|
2020-09-23 15:52:25 +02:00
|
|
|
};
|