This repository contains a JSON parser and generator written in C++.
#include "json.hpp"
#include <iostream>
int main()
{
std::string json_string = "{\"key\": \"value\"}";
json::json j = json::load(json_string);
std::cout << j["key"] << std::endl;
return 0;
}
#include "json.hpp"
#include <iostream>
int main()
{
json::json j;
j["key"] = "value";
j["number"] = 42;
j["array"] = {1, 2, 3};
j["object"] = {{"key", "value"}};
std::cout << j.dump() << std::endl;
return 0;
}