//解析barcode回调信息 boost::property_tree::ptree ReturnInformation; stringstream stream(buffer_barcode); read_json(stream, ReturnInformation); int CodeNumber = ReturnInformation.get<int>("code"); String Msg = ReturnInformation.get<string>("msg");
时间: 2024-03-28 17:40:52 浏览: 100
这段代码使用了 Boost 库中的 property_tree 模块,用于解析 JSON 格式的回调信息。首先将回调信息转化为 stringstream 对象,然后使用 read_json 函数将其解析为一个 property_tree 对象,最后从中获取了 code 和 msg 两个字段的值。其中,CodeNumber 获取了 code 字段的值,而 Msg 获取了 msg 字段的值。
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)