Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
print.hh
Go to the documentation of this file.
1#pragma once
9
10#include <iostream>
11
12#include "lix/libutil/fmt.hh"
14
15namespace nix {
16
17struct Expr;
18
19class EvalState;
20struct Value;
21
23std::ostream & printLiteralBool(std::ostream & o, bool b);
24
30std::ostream & printAttributeName(std::ostream & o, std::string_view s);
31
36bool isReservedKeyword(const std::string_view str);
37
47std::ostream & printIdentifier(std::ostream & o, std::string_view s);
48
49void printValue(EvalState & state, std::ostream & str, Value & v, PrintOptions options = PrintOptions {});
50
61class ValuePrinter {
62 friend std::ostream & operator << (std::ostream & output, const ValuePrinter & printer);
63private:
64 EvalState & state;
65 Value & value;
66 PrintOptions options;
67
68public:
69 ValuePrinter(EvalState & state, Value & value, PrintOptions options = PrintOptions {})
70 : state(state), value(value), options(options) { }
71};
72
73std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer);
74
75
80template<>
81fmt_internal::HintFmt & fmt_internal::HintFmt::operator%(const ValuePrinter & value);
82
83}
Definition eval.hh:685
Definition print.hh:61
Options for printing Nix values.
Definition nixexpr.hh:104
Definition print-options.hh:39
Definition value.hh:190
Definition fmt.hh:73