From 54c60d9a18d103011a12939c5029dd35a8e9e200 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 22 Aug 2024 21:44:06 +0200 Subject: Start on file chooser, page stack --- src/Config.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Config.cpp') diff --git a/src/Config.cpp b/src/Config.cpp index b4825a3..8f28c89 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -12,6 +12,13 @@ #define CONFIG_FILE_VERSION 1 namespace gsr { + static std::optional parse_key_value(std::string_view line) { + const size_t space_index = line.find(' '); + if(space_index == std::string_view::npos) + return std::nullopt; + return KeyValue{line.substr(0, space_index), line.substr(space_index + 1)}; + } + using ConfigValue = std::variant*>; static std::map get_config_options(Config &config) { -- cgit v1.2.3