From: Wolfgang Bangerth Date: Sat, 10 Jun 2017 00:28:33 +0000 (-0600) Subject: Save the state of the stream we're going to write into. X-Git-Tag: v9.0.0-rc1~1509^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e13cfb57260fe2828f9ff40b0f1eaebfe22ad1fe;p=dealii.git Save the state of the stream we're going to write into. --- diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index 9d2f8b9995..6656ef8ea0 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -24,6 +24,8 @@ DEAL_II_DISABLE_EXTRA_DIAGNOSTICS #include #include #include + +#include DEAL_II_ENABLE_EXTRA_DIAGNOSTICS #include @@ -2265,6 +2267,14 @@ ParameterHandler::print_parameters (std::ostream &out, { AssertThrow (out, ExcIO()); + // we'll have to print some text that is padded with spaces; + // set the appropriate fill character, but also make sure that + // we will restore the previous setting (and all other stream + // flags) when we exit this function + boost::io::ios_flags_saver restore_flags(out); + boost::io::basic_ios_fill_saver restore_fill_state(out); + out.fill(' '); + // we treat XML and JSON is one step via BOOST, whereas all of the others are // done recursively in our own code. take care of the two special formats // first