[Boost-bugs] [Boost C++ Libraries] #7088: Error with property_tree

Subject: [Boost-bugs] [Boost C++ Libraries] #7088: Error with property_tree
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-07-05 16:42:42


#7088: Error with property_tree
---------------------------+------------------------------------------------
 Reporter: dix75@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.50.0
 Severity: Problem | Keywords:
---------------------------+------------------------------------------------
 json
 {
   cool : ["hp"]
 }

 I have Simple example:
 typedef boost::property_tree::basic_ptree< string_t, string_t >
 ptree;
 boost::property_tree::json_parser::read_json("path_out", pt);
 ptree pt;

 auto result = pt.get_child(_T("cool"));
 result.add(_T(" "), _T("33333"));

 std::for_each(result.begin(), result.end(), [&](ptree::value_type const&
 val) {
    std::wcout << val.first << _T(" ") << val.second.data() << std::endl;
 });

 pt.put_child(_T("cool"), result);
 boost::property_tree::json_parser::write_json("path_out", pt);

 i have:

 json
 {
   cool :
             {
                 "": "hp",
                 " ": "33333"
             }
 }

 Why. I need array

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7088>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC