From: bangerth Date: Sun, 25 Aug 2013 22:31:38 +0000 (+0000) Subject: Make MultipleParameterLoop work again following yesterday's changes. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1b746b4094c3649ae5143b00c6acef286e4edec;p=dealii-svn.git Make MultipleParameterLoop work again following yesterday's changes. git-svn-id: https://svn.dealii.org/trunk@30487 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/parameter_handler.h b/deal.II/include/deal.II/base/parameter_handler.h index 70712ea751..0e6acd4ed0 100644 --- a/deal.II/include/deal.II/base/parameter_handler.h +++ b/deal.II/include/deal.II/base/parameter_handler.h @@ -2246,7 +2246,28 @@ public: */ virtual ~MultipleParameterLoop (); - virtual bool read_input (std::istream &Input); + /** + * Read input from a stream until the stream returns the eof condition + * or error. The second argument can be used to denote the name of the file + * (if that's what the input stream represents) we are reading from; this + * is only used when creating output for error messages. + * + * Return whether the read was successful. + */ + virtual bool read_input (std::istream &input, + const std::string &filename = "input file"); + + /** + * Read input from a file the name of which is given. The PathSearch + * class "PARAMETERS" is used to find the file. + * + * Return whether the read was successful. + * + * Unless optional is true, this function will + * automatically generate the requested file with default values if the + * file did not exist. This file will not contain additional comments if + * write_stripped_file is true. + */ virtual bool read_input (const std::string &FileName, const bool optional = false, const bool write_stripped_file = false); diff --git a/deal.II/source/base/parameter_handler.cc b/deal.II/source/base/parameter_handler.cc index eb0bde28f4..267fef855e 100644 --- a/deal.II/source/base/parameter_handler.cc +++ b/deal.II/source/base/parameter_handler.cc @@ -2491,11 +2491,12 @@ MultipleParameterLoop::~MultipleParameterLoop () -bool MultipleParameterLoop::read_input (std::istream &input) +bool MultipleParameterLoop::read_input (std::istream &input, + const std::string &filename) { AssertThrow (input, ExcIO()); - bool x = ParameterHandler::read_input (input); + bool x = ParameterHandler::read_input (input, filename); if (x) init_branches (); return x;