5#include "../utility/utility.hpp"
6#include "../macros.hpp"
12#include <system_error>
14hi_export_module(hikogui.settings.user_settings : intf);
16hi_export
namespace hi {
inline namespace v1 {
18[[nodiscard]] std::expected<std::string, std::error_code>
get_user_setting_string(std::string_view key)
noexcept;
19[[nodiscard]] std::expected<long long, std::error_code> get_user_setting_integral(std::string_view key)
noexcept;
32[[nodiscard]] std::expected<T, std::error_code>
get_user_setting(std::string_view key)
noexcept =
delete;
76template<std::
integral T>
77[[nodiscard]]
inline std::expected<T, std::error_code>
get_user_setting(std::string_view key)
noexcept
79 if (
auto const value = get_user_setting_integral(key)) {
80 if (can_narrow_cast<T>(*value)) {
81 return narrow_cast<T>(*value);
83 return std::unexpected{std::make_error_code(std::errc::result_out_of_range)};
The HikoGUI namespace.
Definition array_generic.hpp:20
std::error_code delete_user_settings() noexcept
Delete all user-setting for the application.
Definition user_settings_win32_impl.hpp:80
std::expected< T, std::error_code > get_user_setting(std::string_view key) noexcept=delete
Get a user-setting for the application.
Definition user_settings_intf.hpp:77
std::expected< std::string, std::error_code > get_user_setting_string(std::string_view key) noexcept
Definition user_settings_win32_impl.hpp:29
std::error_code delete_user_setting(std::string_view key) noexcept
Delete a user-setting for the application.
Definition user_settings_win32_impl.hpp:75
std::error_code set_user_setting(std::string_view key, std::string_view value) noexcept
Set a user-setting for the application.
Definition user_settings_win32_impl.hpp:65
DOXYGEN BUG.
Definition algorithm_misc.hpp:20