diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2018-08-11 17:34:22 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2018-08-11 17:34:22 +0200 |
commit | 0b6f8ba51e61792ea23a55394a963d0961a9906f (patch) | |
tree | 34dda39e990ee3fd9d0f3ec981e8c40eb31ebf34 /src/core/hle/service/acc/profile_manager.h | |
parent | Removed const from ProfileBase Invalidate (diff) | |
download | yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.tar yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.tar.gz yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.tar.bz2 yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.tar.lz yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.tar.xz yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.tar.zst yuzu-0b6f8ba51e61792ea23a55394a963d0961a9906f.zip |
Diffstat (limited to 'src/core/hle/service/acc/profile_manager.h')
-rw-r--r-- | src/core/hle/service/acc/profile_manager.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index 1815d520d..d86a7a226 100644 --- a/src/core/hle/service/acc/profile_manager.h +++ b/src/core/hle/service/acc/profile_manager.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include "boost/optional.hpp" #include "common/common_types.h" #include "common/swap.h" #include "core/hle/result.h" @@ -82,15 +83,17 @@ public: ResultCode AddUser(ProfileInfo user); ResultCode CreateNewUser(UUID uuid, std::array<u8, 0x20>& username); ResultCode CreateNewUser(UUID uuid, const std::string& username); - size_t GetUserIndex(const UUID& uuid) const; - size_t GetUserIndex(ProfileInfo user) const; - bool GetProfileBase(size_t index, ProfileBase& profile) const; + boost::optional<size_t> GetUserIndex(const UUID& uuid) const; + boost::optional<size_t> GetUserIndex(ProfileInfo user) const; + bool GetProfileBase(boost::optional<size_t> index, ProfileBase& profile) const; bool GetProfileBase(UUID uuid, ProfileBase& profile) const; bool GetProfileBase(ProfileInfo user, ProfileBase& profile) const; - bool GetProfileBaseAndData(size_t index, ProfileBase& profile, std::array<u8, MAX_DATA>& data); - bool GetProfileBaseAndData(UUID uuid, ProfileBase& profile, std::array<u8, MAX_DATA>& data); + bool GetProfileBaseAndData(boost::optional<size_t> index, ProfileBase& profile, + std::array<u8, MAX_DATA>& data) const; + bool GetProfileBaseAndData(UUID uuid, ProfileBase& profile, + std::array<u8, MAX_DATA>& data) const; bool GetProfileBaseAndData(ProfileInfo user, ProfileBase& profile, - std::array<u8, MAX_DATA>& data); + std::array<u8, MAX_DATA>& data) const; size_t GetUserCount() const; size_t GetOpenUserCount() const; bool UserExists(UUID uuid) const; @@ -105,10 +108,9 @@ public: private: std::array<ProfileInfo, MAX_USERS> profiles{}; size_t user_count = 0; - size_t AddToProfiles(const ProfileInfo& profile); - bool RemoveProfileAtIdx(size_t index); + boost::optional<size_t> AddToProfiles(const ProfileInfo& profile); + bool RemoveProfileAtIndex(size_t index); UUID last_opened_user{0, 0}; }; -using ProfileManagerPtr = std::unique_ptr<ProfileManager>; }; // namespace Service::Account |