input_profiles.h 980 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include <string_view>
  7. #include <unordered_map>
  8. namespace Core {
  9. class System;
  10. }
  11. class Config;
  12. class InputProfiles {
  13. public:
  14. explicit InputProfiles(Core::System& system_);
  15. virtual ~InputProfiles();
  16. std::vector<std::string> GetInputProfileNames();
  17. static bool IsProfileNameValid(std::string_view profile_name);
  18. bool CreateProfile(const std::string& profile_name, std::size_t player_index);
  19. bool DeleteProfile(const std::string& profile_name);
  20. bool LoadProfile(const std::string& profile_name, std::size_t player_index);
  21. bool SaveProfile(const std::string& profile_name, std::size_t player_index);
  22. private:
  23. bool ProfileExistsInMap(const std::string& profile_name) const;
  24. std::unordered_map<std::string, std::unique_ptr<Config>> map_profiles;
  25. Core::System& system;
  26. };