mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Provide default implementations for a couple of Store methods
This commit is contained in:
parent
ddb5577f2e
commit
fa07558a06
4 changed files with 20 additions and 26 deletions
|
@ -285,6 +285,19 @@ bool Store::isValidPath(const Path & storePath)
|
|||
}
|
||||
|
||||
|
||||
/* Default implementation for stores that only implement
|
||||
queryPathInfoUncached(). */
|
||||
bool Store::isValidPathUncached(const Path & path)
|
||||
{
|
||||
try {
|
||||
queryPathInfo(path);
|
||||
return true;
|
||||
} catch (InvalidPath &) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ref<const ValidPathInfo> Store::queryPathInfo(const Path & storePath)
|
||||
{
|
||||
std::promise<ref<ValidPathInfo>> promise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue