How to read a JSON file containing multiple root elements?

前端 未结 4 1340
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 00:10

If I had a file whose contents looked like:

{\"one\": 1}
{\"two\": 2}

I could simply parse each separate line as a separate JSON object (us

4条回答
  •  失恋的感觉
    2020-12-02 00:51

    Rob Kennedy is right. Calling it a second time would extract the next object, and so on.Most of the json lib can not help you to do all in a single root. Unless you are using more high end framework in QT.

提交回复
热议问题