Poco/JSON 或 rapidjson 中的 JSON 字符串
String to JSON in Poco/JSON or rapidjson
我想将下面的 std::string 消息转换成一个 json 对象,这样我就可以轻松地遍历该对象并根据需要获取 key/value 对。
我更喜欢使用 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"}
将字符串转换为文档,然后解析
我想将下面的 std::string 消息转换成一个 json 对象,这样我就可以轻松地遍历该对象并根据需要获取 key/value 对。
我更喜欢使用 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"}
将字符串转换为文档,然后解析