Opened 13 years ago
Closed 13 years ago
#3981 closed Bugs (invalid)
json writer generates invalid output for bool values
Reported by: | Owned by: | Sebastian Redl | |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | property_tree |
Version: | Boost 1.42.0 | Severity: | Problem |
Keywords: | Cc: |
Description
This piece of code should produce the string ( cr and lf removed) { "success" : false }. It wrongly generates { "success" : "false" }
std::ostringstream output; using namespace boost::property_tree; ptree pt; pt.put("success", false); json_parser::write_json(output, pt); std::string result = output.str();
Note:
See TracTickets
for help on using tickets.
The ptree typedef of property tree contains strings. Only strings. Therefore, all properties are written out as strings.