上篇博文里我通过RapidJson解析了嵌套的json文本,那么本文章是RapidJson创建嵌套数组Json文本。
代码:
#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include
using namespace rapidjson;
int main() {
// 1. Parse a JSON string into DOM.
const char* json ="{\"Info\":[{\"lots\":10,\"order_algorithm\":\"01\",\"buy_close\":9000,\"spread_shift\":0,\"position_b_sell\":0,\"position_a_buy_today\":0,\"position_a_buy_yesterday\":0,\"sell_open\":-9000,\"list_instrument_id\":[\"rb1705\",\"rb1701\"],\"position_b_buy_today\":0,\"buy_open\":-9000,\"position_a_sell_yesterday\":0,\"strategy_id\":\"02\",\"position_b_buy\":0,\"a_wait_price_tick\":1,\"trade_model\"