2017-07-09 09:51:38 +00:00
|
|
|
#include <iostream>
|
2017-04-21 20:07:07 +00:00
|
|
|
#include "json.hpp"
|
2015-07-08 14:55:29 +00:00
|
|
|
|
2016-01-30 19:23:14 +00:00
|
|
|
using json = nlohmann::json;
|
2015-07-08 14:55:29 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
// create JSON values
|
|
|
|
json array = {1, 2, 3, 4, 5};
|
|
|
|
json null;
|
|
|
|
|
|
|
|
// print values
|
|
|
|
std::cout << array << '\n';
|
|
|
|
std::cout << null << '\n';
|
|
|
|
|
|
|
|
// add values
|
|
|
|
array.push_back(6);
|
|
|
|
array += 7;
|
|
|
|
null += "first";
|
|
|
|
null += "second";
|
|
|
|
|
|
|
|
// print values
|
|
|
|
std::cout << array << '\n';
|
|
|
|
std::cout << null << '\n';
|
|
|
|
}
|