json/doc/mkdocs/docs/integration/index.md

19 lines
749 B
Markdown
Raw Normal View History

2021-07-17 14:44:54 +03:00
# Header only
2020-05-24 14:03:04 +03:00
2022-01-09 16:32:38 +03:00
[`json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) is the single required
file in `single_include/nlohmann` or [released here](https://github.com/nlohmann/json/releases). You need to add
2020-05-24 14:03:04 +03:00
```cpp
#include <nlohmann/json.hpp>
// for convenience
using json = nlohmann::json;
```
2022-01-09 16:32:38 +03:00
to the files you want to process JSON and set the necessary switches to enable C++11 (e.g., `-std=c++11` for GCC and
Clang).
2020-05-24 14:03:04 +03:00
2022-01-09 16:32:38 +03:00
You can further use file [`include/nlohmann/json_fwd.hpp`](https://github.com/nlohmann/json/blob/develop/include/nlohmann/json_fwd.hpp)
for forward-declarations. The installation of `json_fwd.hpp` (as part of CMake's install step), can be achieved by
setting `-DJSON_MultipleHeaders=ON`.