首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我可以使用libjson按名称获取对象吗?

我可以使用libjson按名称获取对象吗?
EN

Stack Overflow用户
提问于 2014-02-17 18:57:51
回答 1查看 102关注 0票数 0

我可以使用libjson按名称获取对象吗?

我已经安装了libjson。我很惊讶没有办法通过对象名来获取值。我将不得不编写我自己的函数,或者我遗漏了什么?

EN

回答 1

Stack Overflow用户

发布于 2014-03-27 03:20:15

如果使用的是C++库,则JSONNode类会重载[]运算符。

根据文档:

代码语言:javascript
复制
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.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21827203

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档