aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/config.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/config.cc')
-rw-r--r--src/libutil/config.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libutil/config.cc b/src/libutil/config.cc
index 8e76d6d66..81efcd507 100644
--- a/src/libutil/config.cc
+++ b/src/libutil/config.cc
@@ -437,6 +437,34 @@ void OptionalPathSetting::operator =(const std::optional<Path> & v)
this->assign(v);
}
+PathsSetting::PathsSetting(Config * options,
+ const Paths & def,
+ const std::string & name,
+ const std::string & description,
+ const std::set<std::string> & aliases)
+ : BaseSetting<Paths>(def, true, name, description, aliases)
+{
+ options->addSetting(this);
+}
+
+
+Paths PathsSetting::parse(const std::string & str) const
+{
+ auto strings = tokenizeString<Strings>(str);
+ Paths parsed;
+
+ for (auto str : strings) {
+ parsed.push_back(canonPath(str));
+ }
+
+ return parsed;
+}
+
+PathsSetting::operator bool() const noexcept
+{
+ return !get().empty();
+}
+
bool GlobalConfig::set(const std::string & name, const std::string & value)
{
for (auto & config : *configRegistrations)