Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
context.hh
Go to the documentation of this file.
1#pragma once
3
7
8namespace nix {
9
10class BadNixStringContextElem : public Error
11{
12public:
13 std::string_view raw;
14
15 template<typename... Args>
16 BadNixStringContextElem(std::string_view raw_, const Args & ... args)
17 : Error("")
18 {
19 raw = raw_;
20 auto hf = HintFmt(args...);
21 err.msg = HintFmt("Bad String Context element: %1%: %2%", Uncolored(hf.str()), raw);
22 }
23};
24
31 using Opaque = SingleDerivedPath::Opaque;
32
42 struct DrvDeep {
43 StorePath drvPath;
44
45 GENERATE_CMP(DrvDeep, me->drvPath);
46 };
47
53 using Built = SingleDerivedPath::Built;
54
55 using Raw = std::variant<
56 Opaque,
57 DrvDeep,
58 Built
59 >;
60
61 Raw raw;
62
64
66
76 std::string_view s,
77 const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings);
78 std::string to_string() const;
79};
80
81typedef std::set<NixStringContextElem> NixStringContext;
82
83}
Definition args.hh:31
Definition fmt.hh:157
Definition path.hh:21
#define GENERATE_CMP(args...)
Definition comparator.hh:65
Definition context.hh:42
Definition context.hh:25
static NixStringContextElem parse(std::string_view s, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
Definition context.cc:5
SingleDerivedPath::Built Built
Definition context.hh:53
SingleDerivedPath::Opaque Opaque
Definition context.hh:31
Definition fmt.hh:44
#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME)
Definition variant-wrapper.hh:27