20#define DD_JSON_DECLARE_CONVERTER(Type) \
21 [[nodiscard]] std::string toJson(const Type &obj, const std::optional<unsigned int> &indent = 2u, bool *success = nullptr); \
22 [[nodiscard]] bool fromJson(const std::string &string, Type &obj, std::string *error_message = nullptr);
25namespace display_device {
29 extern const std::optional<unsigned int> JSON_COMPACT;
38 [[nodiscard]] std::string toJson(
const EdidData &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
47 [[nodiscard]]
bool fromJson(
const std::string &
string, EdidData &obj, std::string *error_message =
nullptr);
56 [[nodiscard]] std::string toJson(
const EnumeratedDevice &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
65 [[nodiscard]]
bool fromJson(
const std::string &
string, EnumeratedDevice &obj, std::string *error_message =
nullptr);
74 [[nodiscard]] std::string toJson(
const EnumeratedDeviceList &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
83 [[nodiscard]]
bool fromJson(
const std::string &
string, EnumeratedDeviceList &obj, std::string *error_message =
nullptr);
92 [[nodiscard]] std::string toJson(
const SingleDisplayConfiguration &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
101 [[nodiscard]]
bool fromJson(
const std::string &
string, SingleDisplayConfiguration &obj, std::string *error_message =
nullptr);
110 [[nodiscard]] std::string toJson(
const StringSet &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
119 [[nodiscard]]
bool fromJson(
const std::string &
string, StringSet &obj, std::string *error_message =
nullptr);
128 [[nodiscard]] std::string toJson(
const std::string &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
137 [[nodiscard]]
bool fromJson(
const std::string &
string, std::string &obj, std::string *error_message =
nullptr);
146 [[nodiscard]] std::string toJson(
const bool &obj,
const std::optional<unsigned int> &indent = 2u,
bool *success =
nullptr);
155 [[nodiscard]]
bool fromJson(
const std::string &
string,
bool &obj, std::string *error_message =
nullptr);
Declarations for common display device types.