Skip to content
Snippets Groups Projects
Commit a3379c62 authored by Max Kahnt's avatar Max Kahnt
Browse files

Fix NumProc::VerbosityMode enum parser.

parent 40cc3a03
No related branches found
No related tags found
No related merge requests found
......@@ -32,21 +32,18 @@ class SolverError : public Dune::Exception {};
std::istream& operator>>(std::istream &lhs, NumProc::VerbosityMode &e)
{
try {
std::string s;
lhs >> s;
if (s == "full" || s == "2")
e = NumProc::FULL;
if (s == "reduced" || s == "1")
e = NumProc::REDUCED;
if (s == "quiet" || s == "0")
e = NumProc::QUIET;
DUNE_THROW(Dune::Exception, "Failed to parse value for enum NumProc::VerbosityMode.");
} catch (typename Dune::Exception) {
std::string s;
lhs >> s;
if (s == "full" || s == "2")
e = NumProc::FULL;
else if (s == "reduced" || s == "1")
e = NumProc::REDUCED;
else if (s == "quiet" || s == "0")
e = NumProc::QUIET;
else
lhs.setstate(std::ios_base::failbit);
}
return lhs;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment