1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-15 07:41:50 +03:00

Reorganize directories (#3462)

* 🚚 move files
* 🚚 rename doc folder to docs
* 🚚 rename test folder to tests
This commit is contained in:
Niels Lohmann
2022-05-01 09:41:50 +02:00
committed by GitHub
parent 5352856f04
commit b21c345179
865 changed files with 52 additions and 51 deletions

View File

@ -0,0 +1,21 @@
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON values
json j_object = {{"one", 1}, {"two", 2}};
json j_array = {1, 2, 4, 8, 16};
// serialize without indentation
std::cout << j_object << "\n\n";
std::cout << j_array << "\n\n";
// serialize with indentation
std::cout << std::setw(4) << j_object << "\n\n";
std::cout << std::setw(2) << j_array << "\n\n";
std::cout << std::setw(1) << std::setfill('\t') << j_object << "\n\n";
}