Qx v0.7
Qt Extensions Library
Loading...
Searching...
No Matches
QxJson::json_convertible Concept Reference

Specifies that a type is generally convertible to/from JSON. More...

Concept definition

template<typename T>
concept QxJson::json_convertible = requires(T& tValue) {
{ Converter<T>::fromJson(tValue, QJsonValue()) } -> std::same_as<Qx::JsonError>;
{ Converter<T>::toJson(tValue) } -> qjson_type;
}
Specifies that a type is generally convertible to/from JSON.
Definition qx-json.h:259
The Converter template struct acts as an interface that carries details on how to parse/serialize JSO...
Definition qx-json.h:231

Detailed Description

Satisfied if a Converter specialization exists for T that includes functions with the signatures:

  • static Qx::JsonError fromJson(T& value, const QJsonValue& jValue)
  • static R toJson(const T& value)

where R is any type that satisfies the qjson_type concept.