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: lix-project/lix#498

Change-Id: I8bf7dfff98609d1774fdb36d63e57d787bcc829f
This commit is contained in:
Justin ! 2024-10-07 23:13:02 -04:00
parent f6077314fa
commit 5a06b17b91
No known key found for this signature in database

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)