diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-02-07 19:22:48 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-02-07 19:29:21 +0100 |
commit | fa07558a069b974769e22ac944cfe21a69fb4485 (patch) | |
tree | 5456379ae95587db7766c14d31b2c313b09ee372 /src/libstore/store-api.cc | |
parent | ddb5577f2eb158279ee40219de409dcf1230aacc (diff) |
Provide default implementations for a couple of Store methods
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index a42d11834..f98ba3840 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -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; |