2023-01-11 21:32:30 +00:00
|
|
|
#pragma once
|
2023-04-01 03:18:41 +00:00
|
|
|
///@file
|
2023-01-11 21:32:30 +00:00
|
|
|
|
|
|
|
#include "nlohmann/json_fwd.hpp"
|
|
|
|
|
|
|
|
// Following https://github.com/nlohmann/json#how-can-i-use-get-for-non-default-constructiblenon-copyable-types
|
|
|
|
#define JSON_IMPL(TYPE) \
|
|
|
|
namespace nlohmann { \
|
|
|
|
using namespace nix; \
|
|
|
|
template <> \
|
|
|
|
struct adl_serializer<TYPE> { \
|
|
|
|
static TYPE from_json(const json & json); \
|
|
|
|
static void to_json(json & json, TYPE t); \
|
|
|
|
}; \
|
|
|
|
}
|