From d8f380961e2c7165ba296c246e002d16598942d4 Mon Sep 17 00:00:00 2001 From: t895 Date: Tue, 21 Nov 2023 20:46:27 -0500 Subject: frontend_common: Add option to read unsigned integers --- src/frontend_common/config.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/frontend_common/config.h') diff --git a/src/frontend_common/config.h b/src/frontend_common/config.h index f741aa8bb..20a1a8056 100644 --- a/src/frontend_common/config.h +++ b/src/frontend_common/config.h @@ -137,6 +137,8 @@ protected: bool ReadBooleanSetting(const std::string& key, std::optional default_value = std::nullopt); s64 ReadIntegerSetting(const std::string& key, std::optional default_value = std::nullopt); + u64 ReadUnsignedIntegerSetting(const std::string& key, + std::optional default_value = std::nullopt); double ReadDoubleSetting(const std::string& key, std::optional default_value = std::nullopt); std::string ReadStringSetting(const std::string& key, @@ -170,6 +172,8 @@ protected: return value_.has_value() ? std::to_string(*value_) : "none"; } else if constexpr (std::is_same_v) { return value_ ? "true" : "false"; + } else if constexpr (std::is_same_v) { + return std::to_string(static_cast(value_)); } else { return std::to_string(static_cast(value_)); } -- cgit v1.2.3