Opened 10 years ago

Closed 9 years ago

#7072 closed Bugs (duplicate)

Extra whitespace in write_json

Reported by: talk@… Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.51.0 Severity: Cosmetic
Keywords: Cc: n.sakisaka@…

Description

#include <boost/regex.hpp> using boost::property_tree::ptree; stringstream sstream; ptree tree; ptree arrayTree;

arrayTree.push_back(make_pair("", "arrayItem")); tree.add_child("root", arrayTree); write_json(sstream, tree, false); std::cout << sstream.str() << std::endl;{"root":} should be {"root":arrayItem}

Attachments (1)

json_parser_write.hpp.patch (430 bytes ) - added by Nana Sakisaka <n.sakisaka@…> 10 years ago.

Download all attachments as: .zip

Change History (4)

by Nana Sakisaka <n.sakisaka@…>, 10 years ago

Attachment: json_parser_write.hpp.patch added

comment:1 by Nana Sakisaka <n.sakisaka@…>, 10 years ago

Cc: n.sakisaka@… added

Here's the patch.

This bug seems to be present since rev.37680. I assume many of us has been experiencing strangeness for outputs for quite a long time.

comment:2 by Nana Sakisaka <n.sakisaka@…>, 10 years ago

#7180 is a duplicate of this issue. I'd rather suppose to close this issue instead; since #7180 has more well-written description.

comment:3 by Sebastian Redl, 9 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.