diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2016-10-07T17·20+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2016-10-07T17·20+0200 |
commit | c663b84573edee2c5ece78f4ee269be73ac3ca35 (patch) | |
tree | 652d8fd54ab1dac920da95390a0727f147c53c7c /src/libstore/store-api.cc | |
parent | 35db4f65a0f2ccbcaaef719e52b895fa78cad361 (diff) |
Implement generic Store::queryValidPaths()
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 74014b47e513..a830ae5bbd0c 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -361,6 +361,17 @@ void Store::queryPathInfo(const Path & storePath, } +PathSet Store::queryValidPaths(const PathSet & paths) +{ + PathSet valid; + + for (auto & path : paths) + if (isValidPath(path)) valid.insert(path); + + return valid; +} + + /* Return a string accepted by decodeValidPathInfo() that registers the specified paths as valid. Note: it's the responsibility of the caller to provide a closure. */ |