lix/src/libutil/abstract-setting-to-json.hh
eldritch horrors b7e7949035 Merge pull request #9299 from tfc/config-improvements
Improvements in src/libutil/config.*

(cherry picked from commit dea63bb81078d7290410544285c6df1a8e002952)
Change-Id: I8090eb2ad393dd9964cf2d5254ec8c796b1bd367
2024-03-04 05:36:42 +01:00

19 lines
414 B
C++

#pragma once
///@file
#include <nlohmann/json.hpp>
#include "config.hh"
#include "json-utils.hh"
namespace nix {
template<typename T>
std::map<std::string, nlohmann::json> BaseSetting<T>::toJSONObject() const
{
auto obj = AbstractSetting::toJSONObject();
obj.emplace("value", value);
obj.emplace("defaultValue", defaultValue);
obj.emplace("documentDefault", documentDefault);
return obj;
}
}