diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-09-16 22:35:24 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-09-16 22:35:24 +0000 |
commit | f60b380a7f32406659efee282cde4c1330fc1c65 (patch) | |
tree | 8bd0680b8fafa02c93b29d0934133b0ff5b29e7a /src/libutil/abstractsettingtojson.hh | |
parent | c08c9f08c75bf379439348cccb5b8871a27bf498 (diff) | |
parent | 5080d4e7b2525d1656282c65a217a22ff8381df3 (diff) |
Merge remote-tracking branch 'upstream/master' into remove-storetype-delegate-regStore
Diffstat (limited to 'src/libutil/abstractsettingtojson.hh')
-rw-r--r-- | src/libutil/abstractsettingtojson.hh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libutil/abstractsettingtojson.hh b/src/libutil/abstractsettingtojson.hh new file mode 100644 index 000000000..b3fbc84f7 --- /dev/null +++ b/src/libutil/abstractsettingtojson.hh @@ -0,0 +1,15 @@ +#pragma once + +#include <nlohmann/json.hpp> +#include "config.hh" + +namespace nix { +template<typename T> +std::map<std::string, nlohmann::json> BaseSetting<T>::toJSONObject() +{ + auto obj = AbstractSetting::toJSONObject(); + obj.emplace("value", value); + obj.emplace("defaultValue", defaultValue); + return obj; +} +} |