Represents an interface for an object that can optionally implement functions for converting to and from nlohmann::json. The methods are only present if the actual object also has those methods.
More...
|
template<typename U = T, typename = decltype(std::declval<U&>().fill_from_json_impl(std::declval<nlohmann::json*>()))> |
T & | fill_from_json (nlohmann::json *j) |
| Convert object from nlohmann::json. More...
|
|
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))> |
auto | to_json (bool with_id=false) const |
| Convert object to nlohmann::json. More...
|
|
template<typename U = T, typename = decltype(std::declval<U&>().to_json_impl(bool{}))> |
std::string | build_json (bool with_id=false) const |
| Convert object to json string. More...
|
|
template<typename T>
struct dpp::json_interface< T >
Represents an interface for an object that can optionally implement functions for converting to and from nlohmann::json. The methods are only present if the actual object also has those methods.
- Template Parameters
-
T | Type of class that implements the interface |