Files
json/api/macros/json_no_io/index.md
T
2026-10-27 12:14:00 +00:00

40 lines
1.1 KiB
Markdown

# JSON_NO_IO
```
#define JSON_NO_IO
```
When defined, headers `<cstdio>`, `<ios>`, `<iosfwd>`, `<istream>`, and `<ostream>` are not included and parse functions relying on these headers are excluded. This is relevant for environments where these I/O functions are disallowed for security reasons (e.g., Intel Software Guard Extensions (SGX)).
## Default definition
By default, `JSON_NO_IO` is not defined.
```
#undef JSON_NO_IO
```
## Examples
Example
The code below forces the library not to use the headers `<cstdio>`, `<ios>`, `<iosfwd>`, `<istream>`, and `<ostream>`.
```
#define JSON_NO_IO 1
#include <nlohmann/json.hpp>
...
```
## See also
- [`operator<<`](https://json.nlohmann.me/api/operator_ltlt/index.md) - serialize to stream
- [`operator>>`](https://json.nlohmann.me/api/operator_gtgt/index.md) - deserialize from stream
- [Serialization](https://json.nlohmann.me/features/serialization/index.md) - pretty-printing, UTF-8 handling, and number output
- [Parsing](https://json.nlohmann.me/features/parsing/index.md) - overview of the parsing functions
## Version history
- Added in version 3.10.0.