|  | Home | Libraries | People | FAQ | More | 
boost::property_tree::json_parser::read_json
// In header: <boost/property_tree/json_parser.hpp> template<typename Ptree> void read_json(const std::string & filename, Ptree & pt, const std::locale & loc = std::locale());
Read JSON from a the given file and translate it to a property tree.
| ![[Note]](../../../../../doc/src/images/note.png) | Note | 
|---|---|
| Clears existing contents of property tree. In case of error the property tree unmodified. | 
| ![[Note]](../../../../../doc/src/images/note.png) | Note | 
|---|---|
| Items of JSON arrays are translated into ptree keys with empty names. Members of objects are translated into named keys. | 
| ![[Note]](../../../../../doc/src/images/note.png) | Note | 
|---|---|
| JSON data can be a string, a numeric value, or one of literals "null", "true" and "false". During parse, any of the above is copied verbatim into ptree data string. | 
| Parameters: | 
 | ||||||
| Throws: | json_parser_error In case of error deserializing the property tree. |