File tree Expand file tree Collapse file tree 1 file changed +0
-33
lines changed
Expand file tree Collapse file tree 1 file changed +0
-33
lines changed Original file line number Diff line number Diff line change 11#include " simdjson.h"
22#include < iostream>
33
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- }
374
385int main (int argc, char *argv[]) {
396 if (argc < 3 ) {
You can’t perform that action at this time.
0 commit comments