about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-10-07T17·20+0200
committerEelco Dolstra <edolstra@gmail.com>2016-10-07T17·20+0200
commitc663b84573edee2c5ece78f4ee269be73ac3ca35 (patch)
tree652d8fd54ab1dac920da95390a0727f147c53c7c /src/libstore/store-api.cc
parent35db4f65a0f2ccbcaaef719e52b895fa78cad361 (diff)
Implement generic Store::queryValidPaths()
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc11
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. */