Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

保存json数据到文件 #6

Open
wujiyoung opened this issue Sep 20, 2017 · 2 comments
Open

保存json数据到文件 #6

wujiyoung opened this issue Sep 20, 2017 · 2 comments

Comments

@wujiyoung
Copy link

你好,我看到示例代码中好像没有保存转换后的json数据到文件的操作,我想知道是没有提供这个接口吗?还是说只是样例中没有实现这一部分?
谢谢了!

@armink
Copy link
Owner

armink commented Sep 22, 2017

转换出来 JSON 对象是可以通过 cJSON_PrintcJSON_PrintUnformatted 转换为字符串,再通过文件操作方法保存到文件中。毕竟 struct2json 是一个纯粹的类型转换库,所以关联性不大的功能可能暂时不会加了。

@yuxuebao
Copy link
Contributor

参考下面的分支,已经实现保存转换后的json数据到文件,并提供自动生成转换代码的脚本:)
https://github.com/yuxuebao/struct2json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants