• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# <small>nlohmann::basic_json::</small>input_format_t
2
3```cpp
4enum class input_format_t {
5    json,
6    cbor,
7    msgpack,
8    ubjson,
9    bson,
10    bjdata
11};
12```
13
14This enumeration is used in the [`sax_parse`](sax_parse.md) function to choose the input format to parse:
15
16json
17:   JSON (JavaScript Object Notation)
18
19cbor
20:   CBOR (Concise Binary Object Representation)
21
22msgpack
23:   MessagePack
24
25ubjson
26:   UBJSON (Universal Binary JSON)
27
28bson
29:   BSON (Binary JSON)
30
31bjdata
32:   BJData (Binary JData)
33
34## Examples
35
36??? example
37
38    The example below shows how an `input_format_t` enum value is passed to `sax_parse` to set the input format to CBOR.
39
40    ```cpp
41    --8<-- "examples/sax_parse__binary.cpp"
42    ```
43
44    Output:
45
46    ```json
47    --8<-- "examples/sax_parse__binary.output"
48    ```
49
50## Version history
51
52- Added in version 3.2.0.
53