File tree 1 file changed +0
-33
lines changed
1 file changed +0
-33
lines changed Original file line number Diff line number Diff line change 1
1
#include " simdjson.h"
2
2
#include < iostream>
3
3
4
- void compute_dump (simdjson::ParsedJson::Iterator &pjh) {
5
- if (pjh.is_object ()) {
6
- std::cout << " {" ;
7
- if (pjh.down ()) {
8
- pjh.print (std::cout); // must be a string
9
- std::cout << " :" ;
10
- pjh.next ();
11
- compute_dump (pjh); // let us recurse
12
- while (pjh.next ()) {
13
- std::cout << " ," ;
14
- pjh.print (std::cout);
15
- std::cout << " :" ;
16
- pjh.next ();
17
- compute_dump (pjh); // let us recurse
18
- }
19
- pjh.up ();
20
- }
21
- std::cout << " }" ;
22
- } else if (pjh.is_array ()) {
23
- std::cout << " [" ;
24
- if (pjh.down ()) {
25
- compute_dump (pjh); // let us recurse
26
- while (pjh.next ()) {
27
- std::cout << " ," ;
28
- compute_dump (pjh); // let us recurse
29
- }
30
- pjh.up ();
31
- }
32
- std::cout << " ]" ;
33
- } else {
34
- pjh.print (std::cout); // just print the lone value
35
- }
36
- }
37
4
38
5
int main (int argc, char *argv[]) {
39
6
if (argc < 3 ) {
You can’t perform that action at this time.
0 commit comments