title: Getting values from a json file using boost/property_tree, with multiple elements/arrays/sub-arrays C++
body: <h2>The facts:</h2>
  
  <ul>
  <li>I am using VS2013 and developing in C++.</li>
  <li>I am using boost API to get the values from a standard/legit json file.</li>
  <li>I can't extract <em>name4.js</em>, <em>name5.js</em> and <em>name6.js</em> names.</li>
  <li>I have searched all over stackoverflow/Google and didn't find any explanation for the below json file I am working with.</li>
  </ul>
  
  <h2>json file:</h2>
  
  <pre><code>{
     "background": {
        "scripts": [ "name1.js", "name2.js", "name3.js" ]
     },
        "default_popup": "popup.html",
        "default_title": "__MSG_name__",
     "content_scripts": [ {
        "all_frames": true,
        "js": [ "name4.js", "name5.js", "name6.js" ],
        "match_about_blank": true,
        "matches": [ "http://*/*", "https://*/*" ],
        "run_at": "document_start"
     }, {
        "all_frames": true,
        "js": [ "include.postload.js" ],
        "match_about_blank": true,
        "matches": [ "http://*/*", "https://*/*" ],
        "run_at": "document_end"
     } ]
  }
  </code></pre>
  
  <h2>What works:</h2>
  
  <ul>
  <li><p>As you can see in the code below, I was able to extract "name1.js", "name2.js" and "name3.js" using  "background.scripts" (the example at boost website):</p>
  
  <pre><code>boost::property_tree::ptree doc;
  boost::property_tree::read_json("C:/Temp\\manifest.json", doc);
  std::vector&lt;string&gt; jsFiles;
  try{
      BOOST_FOREACH(boost::property_tree::ptree::value_type&amp; framePair, doc.get_child("background.scripts")){
          jsFiles.push_back(framePair.second.data());
       }
  }
  catch (boost::exception const &amp;ex){}
  </code></pre></li>
  </ul>
  
  <h2>What doesn't work:</h2>
  
  <ul>
  <li>I want to extract the rest of the js names which are:
  <ol>
  <li>name4.js</li>
  <li>name5.js</li>
  <li>name6.js</li>
  </ol></li>
  <li><p>I couldn't get it to work using the below code:</p>
  
  <pre><code>BOOST_FOREACH(boost::property_tree::ptree::value_type&amp; framePair2, doc.get_child("content_scripts")){
  jsFiles.push_back(framePair2.second.data());
  </code></pre></li>
  </ul>
  
  <p>What I get is <code>""</code> in the vector string.</p>
  
  <p>I even tried <code>jsFiles.push_back(framePair2.second.get&lt;std::string&gt;("js"));</code> but it still doesn't work.</p>
  
  <p>I have also tried other methods with no success.</p>
  
  <p>I'd appreciate if I could get a working code because I am out of ideas.</p>