Nix  2.93.0-dev
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
10#include <iostream>
11
12#include "lix/libutil/fmt.hh"
15
16namespace nix {
17
18struct Expr;
19
20class EvalState;
21struct Value;
22
24std::ostream & printLiteralBool(std::ostream & o, bool b);
25
31std::ostream & printAttributeName(std::ostream & o, std::string_view s);
32
37bool isReservedKeyword(const std::string_view str);
38
48std::ostream & printIdentifier(std::ostream & o, std::string_view s);
49
50void printValue(EvalState & state, std::ostream & str, Value & v, PrintOptions options = PrintOptions {});
51
63 friend std::ostream & operator << (std::ostream & output, const ValuePrinter & printer);
64private:
65 EvalState & state;
66 Value & value;
67 PrintOptions options;
68
69public:
70 ValuePrinter(EvalState & state, Value & value, PrintOptions options = PrintOptions {})
71 : state(state), value(value), options(options) { }
72};
73
74std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer);
75
76
81template<>
82fmt_internal::HintFmt & fmt_internal::HintFmt::operator%(const ValuePrinter & value);
83
84}
Definition eval.hh:673
Definition print.hh:62
Options for printing Nix values.
Definition print-options.hh:38
Definition value.hh:191
Definition fmt.hh:73