title: C++ Boost Library - trying to get proper format of my property tree
body: <p>I am trying to write Json using property tree. This is what I have tried:</p>
  
  <pre><code>boost::property_tree::propTree propTree1, propTree2, propTree3, propTree4, propTree5, propTree6, propTree7, propTree8, propTree9, propTree10;
  
  
  propTree1.put( "a", "" );
  propTree1.put( "b", "" );
  propTree1.put( "c", "" );
  propTree2.push_back(std::make_pair("", propTree1)); 
  
  propTree3.put("l", "");
  propTree3.put("m", "");
  propTree4.push_back(std::make_pair("", propTree3));
  propTree1.add_child("Msg", propTree4);
  
  propTree5.put("r", "");
  propTree5.put("s", "");
  propTree6.push_back(std::make_pair("", propTree5));
  
  propTree1.add_child("Msg1", propTree6);
  propTree1.add_child("Msg2", propTree8);
  
  propTree9.put("t", "");
  propTree9.put("u", "");
  propTree10.push_back(std::make_pair("", propTree9));
  propTree1.add_child("Msg3", propTree10);
  
  boost::property_tree::write_json( "OUTPUT", propTree1 );    
  </code></pre>
  
  <p><strong>The Output I am getting is below:</strong></p>
  
  <pre><code>{
  "a": "",
  "b": "",
  "Msg": [
      {
          "l": "",
          "m": ""
      }
  ],
  "Msg1": [
      {
          "r": "",
          "s": ""
      }
  ],
  "Msg2": "",
  "Msg3": [
      {
          "t": "",
          "u": ""
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Expected output is below: (Commented are the questions)</strong></p>
  
  <pre><code>{  "Msg0":{     //Missing in my output
  "a": "",
  "b": "",
  "Msg": [
      {
          "l": "",
          "m": ""
      }
  ],
  "Msg1": [
      {
          "r": "",
          "s": "",
      "abc": [    // Missing this "abc" array within Msg1 array
      "note1", //Output with values (no keys like "r" &amp; "s")
      "note2",  // Can we pass setlist/stringstream in "abc" array?
      "note3",
      ]
      }
  ],
  "Msg2": "",
  "Msg3": [
      {
          "t": "",
          "u": ""
      }
  ]
  </code></pre>
  
  <p>} 
  }</p>
  
  <p>1) I am not able to get the format of JSON which is mentioned above. Please check the comments.</p>
  
  <p>2) How should I add string/stringstream/setofnames in "abc" array? Which data type can be passed here and how to achieve that?</p>
  
  <p>3) Also is there any efficient way of doing the above work?</p>
  
  <p>Can anyone help me with the above 3 questions? Thanks.</p>