You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also programmatically create `json::value` objects like this:
53
53
54
54
```c++
55
-
int main(int argc, char *argv[]) {
56
-
json::array arr = {
57
-
1,
58
-
2,
59
-
3,
60
-
4,
61
-
"Testing 1 2 3", json::object{
62
-
{ "hello", 1234 },
63
-
{ "world", 5678 }
64
-
}
65
-
};
66
-
67
-
std::cout << stringify(arr) << std::endl;
68
-
}
69
-
```
70
-
71
-
Which of course results in a object representing the following JSON:
72
-
73
-
```json
74
-
[
55
+
intmain(int argc, char *argv[]) {
56
+
json::array arr = {
75
57
1,
76
58
2,
77
59
3,
78
60
4,
79
-
"Testing 1 2 3", {
80
-
"hello" : 1234,
81
-
"world" : 5678
61
+
"Testing 1 2 3", json::object{
62
+
{ "hello", 1234 },
63
+
{ "world", 5678 }
82
64
}
83
-
]
65
+
};
66
+
67
+
std::cout << stringify(arr) << std::endl;
68
+
}
69
+
```
70
+
71
+
Which of course results in a object representing the following JSON:
72
+
73
+
```json
74
+
[
75
+
1,
76
+
2,
77
+
3,
78
+
4,
79
+
"Testing 1 2 3", {
80
+
"hello" : 1234,
81
+
"world" : 5678
82
+
}
83
+
]
84
84
```
85
85
86
86
Finally, this library is very fast, when processing a 190 MB JSON file I randomly selected, parsing took no more than 18 seconds on my machine. For a Qt4 JSON parsing library, you can also checkout my other project: [QJson4](https://github.com/eteran/qjson4)
0 commit comments