diff options
| author | David Marcec <dmarcecguzman@gmail.com> | 2018-08-12 01:34:22 +1000 |
|---|---|---|
| committer | David Marcec <dmarcecguzman@gmail.com> | 2018-08-12 01:34:22 +1000 |
| commit | 0b6f8ba51e61792ea23a55394a963d0961a9906f (patch) | |
| tree | 34dda39e990ee3fd9d0f3ec981e8c40eb31ebf34 /src/core/hle/service/acc/profile_manager.h | |
| parent | d0b2950434b8da14f9903e918e568254c9b0b27d (diff) | |
Code cleanup for profile manager
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 |
