aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/deprecated-features-json.hh
diff options
context:
space:
mode:
authorpiegames <git@piegames.de>2024-07-13 05:24:41 +0200
committerpiegames <git@piegames.de>2024-08-17 19:47:51 +0200
commit49d61b2e4bf338042364c85d3c2ead0b33963e65 (patch)
tree09ffba6841df5a3990aa2d1c6bb9e19e0e355b14 /src/libutil/deprecated-features-json.hh
parent1c080a8239f1be5a61d9fb2121ca958542ec183f (diff)
libexpr: Introduce Deprecated features
They are like experimental features, but opt-in instead of opt-out. They will allow us to gracefully remove language features. See #437 Change-Id: I9ca04cc48e6926750c4d622c2b229b25cc142c42
Diffstat (limited to 'src/libutil/deprecated-features-json.hh')
-rw-r--r--src/libutil/deprecated-features-json.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/libutil/deprecated-features-json.hh b/src/libutil/deprecated-features-json.hh
new file mode 100644
index 000000000..787be40dc
--- /dev/null
+++ b/src/libutil/deprecated-features-json.hh
@@ -0,0 +1,29 @@
+#pragma once
+///@file
+
+#include "deprecated-features.hh"
+#include "json-utils.hh"
+
+namespace nix {
+
+/**
+ * Compute the documentation of all deprecated features.
+ *
+ * See `doc/manual` for how this information is used.
+ */
+nlohmann::json documentDeprecatedFeatures();
+
+/**
+ * Semi-magic conversion to and from json.
+ * See the nlohmann/json readme for more details.
+ */
+void to_json(nlohmann::json &, const DeprecatedFeature &);
+void from_json(const nlohmann::json &, DeprecatedFeature &);
+
+/**
+ * It is always rendered as a string
+ */
+template<>
+struct json_avoids_null<DeprecatedFeature> : std::true_type {};
+
+};