Modernize write_inpfile
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 1 Jan 2017 10:13:13 +0000 (10:13 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 13 Mar 2017 16:09:05 +0000 (17:09 +0100)
commit7373cf841e7471f8fe8f3b2634e97f87a7dc03d2
tree4b250970d3e30237578277fd239e293dd7eaa77d
parentc69bdc60aea80edc753825a1781a0832632bc526
Modernize write_inpfile

Used std::string, gmx::TextOutputFile and gmx::TextWriter to simplify
and permit testing.

To do so, modified the interface of various helper functionality so
that it can use a TextWriter that the caller could build with
something other than a FILE stream if they wanted to. This would also
be more convenient for testing them, if we ever do that.

Moved nice_header to utility/niceheader.h, renamed it
niceHeader, and permitted its caller to specify the comment character.

Moved string-handling behaviour out of cuda_version_information,
while ensuring no C++11 functionality is needed.

Updated documentation of intended scope of sysinfo.h, and removed c++
guard.

Change-Id: I6ab250c982a8e9e9ee3dacb6575ccc04f17e689c
15 files changed:
src/gromacs/fileio/readinp.cpp
src/gromacs/fileio/readinp.h
src/gromacs/gmxana/gmx_xpm2ps.cpp
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/utility/binaryinformation.cpp
src/gromacs/utility/binaryinformation.h
src/gromacs/utility/cstringutil.cpp
src/gromacs/utility/cstringutil.h
src/gromacs/utility/cuda_version_information.cu
src/gromacs/utility/cuda_version_information.h
src/gromacs/utility/niceheader.cpp [new file with mode: 0644]
src/gromacs/utility/niceheader.h [new file with mode: 0644]
src/gromacs/utility/sysinfo.h
src/programs/mdrun/membed.cpp