【问题标题】:String to JSON in Poco/JSON or rapidjsonPoco/JSON 或 rapidjson 中的字符串到 JSON
【发布时间】:2019-03-14 21:06:12
【问题描述】:

我想将以下 std::string 消息转换为 json 对象,以便我可以轻松地遍历对象并根据需要获取键/值对。

我更喜欢使用 rapidjson 或 Poco::JSON

std::string request;
std::cout << request << std::endl;

This is the output of request:    {"USER_ID":"1","Exchange":"NASDAQ","ActionType":"BUY","OrderType":"MARKET","Quantity":"100","TimeInForce":"GTC"}

【问题讨论】:

标签: c++ json poco-libraries rapidjson


【解决方案1】:

将字符串转换为文档,然后解析

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-25
    • 1970-01-01
    • 2022-08-14
    • 2012-08-07
    • 1970-01-01
    • 2020-02-15
    • 2016-12-04
    • 1970-01-01
    相关资源
    最近更新 更多