diff options
author | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-03-17 15:51:08 +0100 |
---|---|---|
committer | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-05-24 14:11:50 +0200 |
commit | 3ebe1341abe1b0ad59bd4925517af18d9200f818 (patch) | |
tree | 66e6ef77c7c60ac559c7aac06f1054427a0afcb1 /src/libstore/path-references.hh | |
parent | 6e4570234d5ac63a9483fb7f7aabaa1d17561a3a (diff) |
Make `RewritingSink` accept a map of rewrites
Giving it the same semantics as `rewriteStrings`.
Also add some tests for it
Diffstat (limited to 'src/libstore/path-references.hh')
-rw-r--r-- | src/libstore/path-references.hh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libstore/path-references.hh b/src/libstore/path-references.hh new file mode 100644 index 000000000..7b44e3261 --- /dev/null +++ b/src/libstore/path-references.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "references.hh" +#include "path.hh" + +namespace nix { + +std::pair<StorePathSet, HashResult> scanForReferences(const Path & path, const StorePathSet & refs); + +StorePathSet scanForReferences(Sink & toTee, const Path & path, const StorePathSet & refs); + +class PathRefScanSink : public RefScanSink +{ + std::map<std::string, StorePath> backMap; + + PathRefScanSink(StringSet && hashes, std::map<std::string, StorePath> && backMap); + +public: + + static PathRefScanSink fromPaths(const StorePathSet & refs); + + StorePathSet getResultPaths(); +}; + +} |