Does Boost Property Tree have methods for defining rules for the data to be parsed?

有些话、适合烂在心里 提交于 2019-12-08 10:54:28

Property Tree didn't take long for me to give up on due to lack of types (as sehe pointed out).

To take sehe's recommendation further, if you are dealing with JSON, I would recommend a user-friendly library like nlohmann's library instead. It is reasonably fast and intuitive.

There is also RapidJSON, which obsesses over every bit of memory allocation, etc, impacting usability, but the best performer in (its own) tests. I encountered difficulty with its handling of single-item arrays before moving to nlohmann's.

None of the capabilities specified are supported.

Worse, Property Tree doesn't even support JSON data types. On the JSON side, everything will be string, no matter what.

Oh and arrays aren't directly supported: prepare for an ugly kludge.

All of these are in the 20 or so lines of documentation that explain JSON backend of Property Tree.

Because of these limitations, be smart and choose for a JSON library to build your requirements upon.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!