mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Don't include nlohmann/json.hpp in config.hh
Instead make a separate header with the template implementation of `BaseSetting<T>::toJSONObj` that can be included where needed
This commit is contained in:
parent
93c0e14a30
commit
e0817cbcdc
4 changed files with 19 additions and 8 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "types.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <nlohmann/json_fwd.hpp>
|
||||
|
||||
#pragma once
|
||||
|
||||
|
@ -255,13 +255,7 @@ public:
|
|||
|
||||
void convertToArg(Args & args, const std::string & category) override;
|
||||
|
||||
std::map<std::string, nlohmann::json> toJSONObject() override
|
||||
{
|
||||
auto obj = AbstractSetting::toJSONObject();
|
||||
obj.emplace("value", value);
|
||||
obj.emplace("defaultValue", defaultValue);
|
||||
return obj;
|
||||
}
|
||||
std::map<std::string, nlohmann::json> toJSONObject() override;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue