【发布时间】: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++结构。 github.com/Loki-Astari/ThorsSerializer/blob/master/doc/…
标签: c++ json poco-libraries rapidjson