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