aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/store-api.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r--src/libstore/store-api.hh16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index e94d975c5..943f08211 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -244,10 +244,12 @@ public:
StorePathWithOutputs followLinksToStorePathWithOutputs(std::string_view path) const;
/* Constructs a unique store path name. */
- StorePath makeStorePath(const string & type,
+ StorePath makeStorePath(std::string_view type,
+ std::string_view hash, std::string_view name) const;
+ StorePath makeStorePath(std::string_view type,
const Hash & hash, std::string_view name) const;
- StorePath makeOutputPath(const string & id,
+ StorePath makeOutputPath(std::string_view id,
const Hash & hash, std::string_view name) const;
StorePath makeFixedOutputPath(FileIngestionMethod method,
@@ -340,10 +342,16 @@ public:
/* Query the outputs of the derivation denoted by `path'. */
virtual StorePathSet queryDerivationOutputs(const StorePath & path);
- /* Query the mapping outputName=>outputPath for the given derivation */
- virtual OutputPathMap queryDerivationOutputMap(const StorePath & path)
+ /* Query the mapping outputName => outputPath for the given derivation. All
+ outputs are mentioned so ones mising the mapping are mapped to
+ `std::nullopt`. */
+ virtual std::map<std::string, std::optional<StorePath>> queryDerivationOutputMap(const StorePath & path)
{ unsupported("queryDerivationOutputMap"); }
+ /* Query the mapping outputName=>outputPath for the given derivation.
+ Assume every output has a mapping and throw an exception otherwise. */
+ OutputPathMap queryDerivationOutputMapAssumeTotal(const StorePath & path);
+
/* Query the full store path given the hash part of a valid store
path, or empty if the path doesn't exist. */
virtual std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) = 0;