diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-22 21:44:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-23 18:53:19 +0200 |
commit | 54c60d9a18d103011a12939c5029dd35a8e9e200 (patch) | |
tree | fefba1d63a13df6c135a6b1f5e8640b12a9c0ff5 /src/Config.cpp | |
parent | ba007c2b69dca6813c86115b2c1834de45c886be (diff) |
Start on file chooser, page stack
Diffstat (limited to 'src/Config.cpp')
-rw-r--r-- | src/Config.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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<KeyValue> 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<bool*, std::string*, int32_t*, ConfigHotkey*, std::vector<std::string>*>; static std::map<std::string_view, ConfigValue> get_config_options(Config &config) { |