]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Save the state of the stream we're going to write into.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 10 Jun 2017 00:28:33 +0000 (18:28 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 10 Jun 2017 00:28:33 +0000 (18:28 -0600)
source/base/parameter_handler.cc

index 9d2f8b99958b4ed2ab8ebfc86edf6dadc5462645..6656ef8ea0648cc8252ded819353e2ac921b5e64 100644 (file)
@@ -24,6 +24,8 @@ DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/xml_parser.hpp>
 #include <boost/property_tree/json_parser.hpp>
+
+#include <boost/io/ios_state.hpp>
 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
 
 #include <fstream>
@@ -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<char> 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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.