diff options
author | Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> | 2023-01-11 07:09:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 07:09:37 +0100 |
commit | a3ba80357d3a792eb1690011f253c64840c6ae72 (patch) | |
tree | 4f151ec354a73e44adf0131808fbab314f7fb3a9 /src/libstore/path-with-outputs.hh | |
parent | f58c30111261a3ad50a6cb462cb2df7c49aa82e4 (diff) | |
parent | 5576d5e987e907bf13ae6c7fe79ececce4e86e2d (diff) |
Merge pull request #7543 from obsidiansystems/typed-string-context
Parse string context elements properly
Diffstat (limited to 'src/libstore/path-with-outputs.hh')
-rw-r--r-- | src/libstore/path-with-outputs.hh | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/src/libstore/path-with-outputs.hh b/src/libstore/path-with-outputs.hh index 0cb5eb223..ed55cc333 100644 --- a/src/libstore/path-with-outputs.hh +++ b/src/libstore/path-with-outputs.hh @@ -1,13 +1,18 @@ #pragma once -#include <variant> - #include "path.hh" #include "derived-path.hh" #include "nlohmann/json_fwd.hpp" namespace nix { +/* This is a deprecated old type just for use by the old CLI, and older + versions of the RPC protocols. In new code don't use it; you want + `DerivedPath` instead. + + `DerivedPath` is better because it handles more cases, and does so more + explicitly without devious punning tricks. +*/ struct StorePathWithOutputs { StorePath path; @@ -33,25 +38,4 @@ StorePathWithOutputs parsePathWithOutputs(const Store & store, std::string_view StorePathWithOutputs followLinksToStorePathWithOutputs(const Store & store, std::string_view pathWithOutputs); -typedef std::set<std::string> OutputNames; - -struct AllOutputs { - bool operator < (const AllOutputs & _) const { return false; } -}; - -struct DefaultOutputs { - bool operator < (const DefaultOutputs & _) const { return false; } -}; - -typedef std::variant<DefaultOutputs, AllOutputs, OutputNames> OutputsSpec; - -/* Parse a string of the form 'prefix^output1,...outputN' or - 'prefix^*', returning the prefix and the outputs spec. */ -std::pair<std::string, OutputsSpec> parseOutputsSpec(const std::string & s); - -std::string printOutputsSpec(const OutputsSpec & outputsSpec); - -void to_json(nlohmann::json &, const OutputsSpec &); -void from_json(const nlohmann::json &, OutputsSpec &); - } |