我可以使用libjson按名称获取对象吗?
我已经安装了libjson。我很惊讶没有办法通过对象名来获取值。我将不得不编写我自己的函数,或者我遗漏了什么?
发布于 2014-03-27 03:20:15
如果使用的是C++库,则JSONNode类会重载[]运算符。
根据文档:
JSONNode & operator [] (const json_string & name);
const JSONNode & operator [] (const json_string & name) const;
This will give you a reference to a child node either at a specific location or by it’s name. Asking for a
node that is not there will result in undefined behavior.https://stackoverflow.com/questions/21827203
复制相似问题