简体   繁体   English

替代JSONCPP

[英]Replacement for JSONCPP

The problem is that JSONCPP has a bug. 问题是JSONCPP有一个错误。 It does not read JSON file properly. 它无法正确读取JSON文件。 We store 3D models in JSON and today we got a model that crash our app. 我们将3D模型存储在JSON中,今天我们有了一个使应用程序崩溃的模型。

In short if we load that JSON (120KB) and save it new file we get 80KB. 简而言之,如果我们加载该JSON(120KB)并将其保存为新文件,我们将获得80KB。 All vertexes are missing but normals, tangents, etc is still in file. 所有顶点均缺失,但法线,切线等仍在文件中。

Please, recommend C++ JSON parser that is similar to JSONCPP as much as possible. 请尽可能推荐与JSONCPP类似的C ++ JSON解析器。

Upgrading JSONCPP does not help. 升级JSONCPP没有帮助。

The JSON you are using is invalid. 您使用的JSON无效。 Look at lines 1389 to 1392. 查看第1389至1392行。

                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -0.5321721434593201, 0.0, 0.8466361761093140 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -1.#IND00000000000, -1.#IND00000000000, -1.#IND00000000000 ],
                 [ -0.5321709513664246, 0.0, -0.8466369509696960 ],
                 [ -0.5321709513664246, 0.0, -0.8466369509696960 ],
                 [ -0.5321710109710693, 0.0, -0.8466369509696960 ],
                 [ -0.5321710109710693, 0.0, -0.8466369509696960 ],

Try cJSON , which is a good ultralight weight JSON parser in ANSI C . 尝试使用cJSON ,它是ANSI C中很好的超轻量级JSON解析器。 We use them in commercial deployments for complex data transactions. 我们将它们用于复杂数据交易的商业部署中。 I guess 3D models would come down to complex data, you can give a try. 我想3D模型将归结为复杂的数据,您可以尝试一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM