Restructure fatal error formatting.
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 22 Aug 2012 17:52:57 +0000 (20:52 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Fri, 7 Sep 2012 09:32:46 +0000 (12:32 +0300)
commit8ae8e1a3fdade041152cea63d28e15f38fda6524
treede3367759b0c572ee22dfbd206b49cedcb47ca5d
parent3ffcfd69a4b9a0e7289e947489e69d3d35c25403
Restructure fatal error formatting.

Split printFatalError() in errorformat.h to separate functions that
print the error header, (part of) the actual message, and the footer.
This makes it possible to print the message in calling code
incrementally instead of formatting it into a string buffer.
It is easier to print the message in parts this way, and there is also
less complications in handling possible std::bad_alloc errors from
manipulating a std::string.

Also added line wrapping functionality to the message writing function,
and improved the appearance of the header.

Part of #838 and #985.

Change-Id: Ief7399d8c7c2c0529e0bc8492726bff827e18c4c
src/gromacs/utility/errorcodes.cpp
src/gromacs/utility/errorformat.cpp
src/gromacs/utility/errorformat.h
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/gmxassert.cpp
src/gromacs/utility/stringutil.h
src/gromacs/utility/tests/stringutil.cpp