Modernize read_inpfile
Used std::string and gmx::TextReader to simplify this. It is likely no
longer as efficient because it now makes several std::string objects
per line, but this is not a significant part of the execution time of
e.g. grompp.
Move COMMENTSIGN to cstringutil.cpp, now that this is an
implementation detail of string-handling code, rather than also used
in readinp.cpp.
Moved responsibility for stripping of comments to TextReader, reworked
its whitespace-trimming behaviour, and introduced some tests for that
class.
Introduced some TODO items to reconsider multiple behaviours where
read_inpfile ignores what could be malformed input. It is used for
grompp, xpm2ps and membed, however, so it is not immediately clear
what fixes might be appropriate, and we might anyway remove this
code shortly.
Introduced catches for exceptions that might be thrown while calling
read_inpfile (and related code that might change soon).
Added tests for newly introduced split-and-trim functionality that
supports read_inpfile.
Refs #2074
Change-Id: Id9c46d60a3ec7ecdcdb9529bba2fdb68ce241914
17 files changed: