Loading src/config/BootstrapConfig.cpp +7 −5 Changes for src/config/BootstrapConfig.cpp: 7 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -115,11 +115,13 @@ bool readBool(confplus::Config &conf, const std::string &path, bool def) { std::vector<std::string> readStringList(confplus::Config &conf, const std::string &path) { std::vector<std::string> out; for (int i = 0;; ++i) { std::string p = path + "/" + std::to_string(i); auto *k = conf.getKey(p); if (!k) break; try { out.push_back(conf.getValue(k, 0)); } catch (const confplus::ConfException &) { break; } // A YAML scalar list ("targets: [a, b]") is one ConfigData node with N stacked values, // not N separate "path/0", "path/1" child keys -- confirmed against confplus's actual // tree shape (see knownLeafPatterns()'s entries for these same paths, no trailing "/#"). auto *k = conf.getKey(path); if (!k) return out; for (size_t i = 0; i < k->getElements(); ++i) { try { out.push_back(conf.getValue(k, i)); } catch (const confplus::ConfException &) { break; } } return out; } Loading Loading
src/config/BootstrapConfig.cpp +7 −5 Changes for src/config/BootstrapConfig.cpp: 7 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -115,11 +115,13 @@ bool readBool(confplus::Config &conf, const std::string &path, bool def) { std::vector<std::string> readStringList(confplus::Config &conf, const std::string &path) { std::vector<std::string> out; for (int i = 0;; ++i) { std::string p = path + "/" + std::to_string(i); auto *k = conf.getKey(p); if (!k) break; try { out.push_back(conf.getValue(k, 0)); } catch (const confplus::ConfException &) { break; } // A YAML scalar list ("targets: [a, b]") is one ConfigData node with N stacked values, // not N separate "path/0", "path/1" child keys -- confirmed against confplus's actual // tree shape (see knownLeafPatterns()'s entries for these same paths, no trailing "/#"). auto *k = conf.getKey(path); if (!k) return out; for (size_t i = 0; i < k->getElements(); ++i) { try { out.push_back(conf.getValue(k, i)); } catch (const confplus::ConfException &) { break; } } return out; } Loading