Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
deprecated-features.hh
Go to the documentation of this file.
1#pragma once
3
5#include "lix/libutil/json-fwd.hh"
7#include <type_traits>
8
9namespace nix {
10
18{
19 #include "deprecated-features.gen.inc"
20 NumDepFeatures, // number of available deprecated features, do not use
21};
22
23template<>
24struct json::avoids_null<DeprecatedFeature> : std::true_type
25{};
26
27enum struct DeprecatedFeatures {};
28
29inline DeprecatedFeatures operator| (DeprecatedFeatures a, DeprecatedFeatures b) {
30 return static_cast<DeprecatedFeatures>(static_cast<size_t>(a) | static_cast<size_t>(b));
31}
32
33inline DeprecatedFeatures operator| (DeprecatedFeatures a, DeprecatedFeature b) {
34 return a | static_cast<DeprecatedFeatures>(1 << static_cast<size_t>(b));
35}
36
37inline DeprecatedFeatures operator& (DeprecatedFeatures a, DeprecatedFeature b) {
38 return static_cast<DeprecatedFeatures>(static_cast<size_t>(a) & (1 << static_cast<size_t>(b)));
39}
40
45
50const std::optional<DeprecatedFeature> parseDeprecatedFeature(
51 const std::string_view & name);
52
57std::string_view showDeprecatedFeature(const DeprecatedFeature);
58
62std::ostream & operator<<(
63 std::ostream & str,
64 const DeprecatedFeature & feature);
65
70DeprecatedFeatures parseDeprecatedFeatures(const std::set<std::string> &);
71
77JSON documentDeprecatedFeatures();
78
83void to_json(JSON &, const DeprecatedFeature &);
84void from_json(const JSON &, DeprecatedFeature &);
85
86void to_json(JSON &, const DeprecatedFeatures &);
87void from_json(const JSON &, DeprecatedFeatures &);
88
93class MissingDeprecatedFeature : public Error
94{
95public:
100
101 MissingDeprecatedFeature(DeprecatedFeature missingFeature);
102};
103
104}
DeprecatedFeature missingFeature
Definition deprecated-features.hh:99
DeprecatedFeature
Definition deprecated-features.hh:18
DeprecatedFeature Dep
Definition deprecated-features.hh:44
This file defines two main structs/classes used in nix error handling.
Definition json.hh:39