12 #ifndef TURI_JSON_INCLUDE 13 #define TURI_JSON_INCLUDE 15 #define JSON_ISO_STRICT 19 #pragma GCC diagnostic push 20 #pragma GCC diagnostic ignored "-Wreorder" 24 #pragma clang diagnostic push 25 #pragma clang diagnostic ignored "-Wreorder" 29 #include <libjson/libjson.h> 31 #pragma GCC diagnostic pop 35 #pragma clang diagnostic pop 56 JSONNode to_json_node(
const std::string& key,
57 const std::vector<T>&
values) {
58 JSONNode ret(JSON_ARRAY);
60 for (
size_t i = 0; i < values.size(); ++i) {
61 ret.push_back(JSONNode(
"", values[i]));
73 inline JSONNode to_json_node<size_t>(
const std::string& key,
74 const std::vector<size_t>&
values) {
75 JSONNode ret(JSON_ARRAY);
77 for (
size_t i = 0; i < values.size(); ++i) {
78 ret.push_back(JSONNode(
"", (
unsigned long)values[i]));
98 JSONNode to_json_node(
const std::string& key,
99 const std::map<std::string, T>& values) {
100 JSONNode ret(JSON_NODE);
102 for(
const auto& map_entry : values) {
103 ret.push_back(JSONNode(map_entry.first, map_entry.second));
std::set< T > values(const std::map< Key, T > &map)