forked from lix-project/lix
da64f026dd
- Add a comment - Put `OutputsSpec` in a different header (First part of #6815) - Make a few stray uses of it in new code use `DerivedPath` instead.
32 lines
790 B
C++
32 lines
790 B
C++
#pragma once
|
|
|
|
#include <variant>
|
|
|
|
#include "util.hh"
|
|
|
|
#include "nlohmann/json_fwd.hpp"
|
|
|
|
namespace nix {
|
|
|
|
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 &);
|
|
|
|
}
|