Skip to content

Commit 89b6962

Browse files
committed
Update README.md
1 parent 9210aac commit 89b6962

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ will correctly parse and the object's "test1" member will have the byte sequence
1818

1919
Here is a simple example of the usage of this library:
2020

21+
```c++
2122
#include "cpp-json/json.h"
2223
#include <fstream>
2324
#include <iostream>
@@ -44,9 +45,11 @@ Here is a simple example of the usage of this library:
4445
std::cout << to_string(v["servlet-name"]) << std::endl;
4546
}
4647
}
47-
48+
```
49+
4850
You can also programmatically create `json::value` objects like this:
4951
52+
```c++
5053
int main(int argc, char *argv[]) {
5154
json::array arr = {
5255
1,
@@ -59,11 +62,13 @@ You can also programmatically create `json::value` objects like this:
5962
}
6063
};
6164
62-
std::cout << stringify(arr) << std::endl;
65+
std::cout << stringify(arr) << std::endl;
6366
}
64-
67+
```
68+
6569
Which of course results in a object representing the following JSON:
6670

71+
```json
6772
[
6873
1,
6974
2,
@@ -74,5 +79,6 @@ Which of course results in a object representing the following JSON:
7479
"world" : 5678
7580
}
7681
]
77-
82+
```
83+
7884
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

Comments
 (0)