From acd1a17082bc35fc2a6c744413e2b03dfe4dc38b Mon Sep 17 00:00:00 2001 From: Thomas Knoll Date: Thu, 11 Jan 2024 22:05:55 +0100 Subject: [PATCH] renamed index --- util/ConfigYaml.cpp | 6 +++--- util/ConfigYaml.h | 6 +++--- util/Grid.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/util/ConfigYaml.cpp b/util/ConfigYaml.cpp index 57226d0..ecb5337 100644 --- a/util/ConfigYaml.cpp +++ b/util/ConfigYaml.cpp @@ -104,10 +104,10 @@ bool YAML::convert::decode(const YAML::Node& node, Command& rhs) { } if (node["index"]) { try { - rhs.index_ = node["index"].as>(); + rhs.indexes_ = node["index"].as>(); } catch(const std::exception& e) { - rhs.index_ = {node["index"].as()}; + rhs.indexes_ = {node["index"].as()}; } } @@ -250,7 +250,7 @@ YamlConfigParseResult YamlConfigParser::parseConfiguration() { } for (auto& module : modules) { for (auto& command : module.commands_) { - configuration.push_back({command.createExpression(), command.action_, ConfigType::Module, command.overwrite_, module.module_, command.index_}); + configuration.push_back({command.createExpression(), command.action_, ConfigType::Module, command.overwrite_, module.module_, command.indexes_}); } } for (auto& constant : constants) { diff --git a/util/ConfigYaml.h b/util/ConfigYaml.h index bfdbc44..16b34b6 100644 --- a/util/ConfigYaml.h +++ b/util/ConfigYaml.h @@ -22,7 +22,7 @@ struct Configuration std::string module_ {}; std::string expression_{}; std::string identifier_{}; - std::vector index_{0}; + std::vector indexes_{0}; ConfigType type_ {ConfigType::Label}; bool overwrite_ {false}; @@ -33,7 +33,7 @@ struct Configuration , ConfigType type , bool overwrite = false , std::string module = "" - , std::vector index = {0}) : expression_(expression), identifier_(identifier), type_(type), overwrite_(overwrite), module_{module}, index_(index) {} + , std::vector indexes = {0}) : expression_(expression), identifier_(identifier), type_(type), overwrite_(overwrite), module_{module}, indexes_(indexes) {} ~Configuration() = default; Configuration(const Configuration&) = default; @@ -100,7 +100,7 @@ struct Command { std::string action_; std::string guard_; std::string update_; - std::vector index_{0}; + std::vector indexes_{0}; bool overwrite_ {false}; std::string createExpression() const; diff --git a/util/Grid.cpp b/util/Grid.cpp index ac22546..6f057cc 100644 --- a/util/Grid.cpp +++ b/util/Grid.cpp @@ -104,7 +104,7 @@ void Grid::applyOverwrites(std::string& str, std::vector& configu if (!config.overwrite_) { continue; } - for (auto& index : config.index_) { + for (auto& index : config.indexes_) { size_t start_pos; std::string search;