add std::to_string method for json object
This commit is contained in:
parent
d9446b0e6e
commit
57db153ea7
12
src/json.hpp
12
src/json.hpp
@ -15289,6 +15289,18 @@ inline nlohmann::json operator "" _json(const char* s, std::size_t n)
|
||||
return nlohmann::json::parse(s, s + n);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief user-defined to_string function for JSON values
|
||||
|
||||
This function implements a user-defined to_string for JSON objects.
|
||||
|
||||
@param[in] j a JSON object
|
||||
@return a std::string object
|
||||
*/
|
||||
inline std::string to_string(const nlohmann::json& j) {
|
||||
return j.dump();
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief user-defined string literal for JSON pointer
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user