Skip to content

Commit 8950568

Browse files
committed
update readme
1 parent 876643f commit 8950568

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
# cppjson
22
![](https://img.shields.io/github/license/mashape/apistatus) ![](https://img.shields.io/github/stars/coderhare/cppjson?style=social) ![](https://img.shields.io/powershellgallery/p/DNS.1.1.1.1)
33

4-
这是一个使用C++17开发的JSON库。使用MIT协议。
5-
它支持UTF-8编码格式。
4+
这是一个使用C++开发的JSON库。使用MIT协议。
5+
6+
它支持主流的`UTF-8`编码格式。
67

78
### 如何使用?
89
cppjson支持从json文件读取数据然后进行解析,详情请见`testexpamle1.json`文件。
910
如果你使用了`testexample1.json`文件,如`main.cpp`所示,便可以进行解析,得到以下输出结果。
1011

1112
![image](cpp_json/images/文件读取序列化.png)
1213

13-
cppjson还支持反序列化操作,即将
14+
cppjson还支持`strinify`操作,即将JSON对象转换为JSON文本。
15+
详情可见`main.cpp`里头的注释部分。该部分即是将解析过的JSON对象重新转换为对应的JSON文本。
16+
结果如下,
17+
![image](cpp_json/images/stringify.png)
1418

1519
### external中的文件
1620
`external`中包含`googletest``benchmark`两个文件夹,对你而言可能并没有帮助,因为它仅作为测试编写以及
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Start testing: May 15 15:16 CST
1+
Start testing: May 15 15:32 CST
22
----------------------------------------------------------
3-
End testing: May 15 15:16 CST
3+
End testing: May 15 15:32 CST

cpp_json/cmake-build-debug/cpp_json

11.2 KB
Binary file not shown.

cpp_json/images/stringify.png

15.9 KB
Loading

cpp_json/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ int main() {
99
Jsonparser::parser p(j);
1010
p.parse_file("../../cpp_json/testexample1.json");
1111
Jsonparser::parser p2(j2);
12-
//cout << j.get_type_format() << ' ' << endl;
13-
//Jsonstringifier::stringifier g;
14-
//cout << g.stringify(j);
12+
cout << j.get_type_format() << ' ' << endl;
13+
Jsonstringifier::stringifier g;
14+
cout << g.stringify(j);
1515
return 0;
1616
}

0 commit comments

Comments
 (0)