Working around useless c++ streams.

This commit is contained in:
clemahieu 2016-04-19 21:25:55 -05:00
commit bc222d2cf1

View file

@ -74,10 +74,15 @@ bool fetch_object (T & object, std::iostream & stream_a)
error = object.deserialize_json (updated, tree);
if (!error && updated)
{
auto end (stream_a.tellp ());
stream_a.seekp (0);
try
{
boost::property_tree::write_json (stream_a, tree);
while (stream_a.tellp () != end)
{
stream_a << ' ';
}
}
catch (std::runtime_error const &)
{