Max Max - 5 months ago 15
JSON Question

Replacement for JSONCPP

The problem is that JSONCPP has a bug. It does not read JSON file properly.
We store 3D models in JSON and today we got a model that crash our app.

In short if we load that JSON (120KB) and save it new file we get 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.

Upgrading JSONCPP does not help.

Answer

The JSON you are using is invalid. Look at lines 1389 to 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 ],
Comments