aboutsummaryrefslogtreecommitdiff
path: root/lib/settings/configuration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/settings/configuration.cpp')
-rw-r--r--lib/settings/configuration.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/settings/configuration.cpp b/lib/settings/configuration.cpp
index 9d53581..8af421f 100644
--- a/lib/settings/configuration.cpp
+++ b/lib/settings/configuration.cpp
@@ -80,18 +80,33 @@ bool Configuration::readDefaultConfiguration(const std::string &data)
return true;
}
-std::vector<std::string> Configuration::children(const char* name)
+std::vector<std::string> Configuration::childrenSettings(const char* name)
{
std::vector<std::string> groupNames;
const Setting &root = m_defaultCfg->lookup(name);
- for(auto i = root.begin(); i != root.end(); ++i) {
- groupNames.push_back(std::string(i->getName()));
+ for(const Setting &setting : root) {
+ if(setting.getType() != Setting::TypeGroup) {
+ groupNames.push_back(setting.getName());
+ }
}
return groupNames;
}
+std::vector<std::string> Configuration::childrenGroups(const char* name)
+{
+ std::vector<std::string> groupNames;
+ const Setting &root = m_defaultCfg->lookup(name);
+
+ for(const Setting &setting : root) {
+ if(setting.getType() == Setting::TypeGroup) {
+ groupNames.push_back(setting.getName());
+ }
+ }
+ return groupNames;
+}
+
template<typename T>
std::optional<T> Configuration::value(const char* path) const
{