libutil: implement PathsSetting<PathSet>

By implementing the `PathSet` specialization for `PathsSetting`, we'll
be able to use `PathsSetting` for the `sandboxPaths` setting in
`src/libstore/globals.hh`.

Fixes: https://git.lix.systems/lix-project/lix/issues/498

Change-Id: I8bf7dfff98609d1774fdb36d63e57d787bcc829f
This commit is contained in:
Justin !
2024-10-14 20:31:04 -04:00
parent f6077314fa
commit 5a06b17b91
+13
View File
@@ -474,9 +474,22 @@ template<> Paths PathsSetting<Paths>::parse(const std::string & str, const Apply
return parsed;
}
template<> PathSet PathsSetting<PathSet>::parse(const std::string &str, const ApplyConfigOptions & options) const
{
auto strings = tokenizeString<Strings>(str);
PathSet parsed;
for (auto str : strings) {
parsed.insert(parsePath(*this, str, options));
}
return parsed;
}
template class PathsSetting<Path>;
template class PathsSetting<std::optional<Path>>;
template class PathsSetting<Paths>;
template class PathsSetting<PathSet>;
bool GlobalConfig::set(const std::string & name, const std::string & value, const ApplyConfigOptions & options)