mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 12:36:01 +01:00
parent
14d82baba4
commit
54bf5ba422
11 changed files with 67 additions and 43 deletions
|
|
@ -96,4 +96,19 @@ StorePathSet singleton(const StorePath & path)
|
|||
return res;
|
||||
}
|
||||
|
||||
std::pair<std::string_view, StringSet> parsePathWithOutputs(std::string_view s)
|
||||
{
|
||||
size_t n = s.find("!");
|
||||
return n == s.npos
|
||||
? std::make_pair(s, std::set<string>())
|
||||
: std::make_pair(((std::string_view) s).substr(0, n),
|
||||
tokenizeString<std::set<string>>(((std::string_view) s).substr(n + 1), ","));
|
||||
}
|
||||
|
||||
StorePathWithOutputs Store::parsePathWithOutputs(const std::string & s)
|
||||
{
|
||||
auto [path, outputs] = nix::parsePathWithOutputs(s);
|
||||
return {parseStorePath(path), std::move(outputs)};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue