Gromacs
5.1.4
|
#include <gromacs/utility/fileredirector.h>
Inherited by gmx::test::TestFileOutputRedirector.
Allows capturing stdout
and file output from code that supports it.
The calling code should take in this interface and use the File objects it returns for all output that needs to support this redirection. By default, the code can then use defaultFileOutputRedirector() in case no redirection is needed.
This allows tests to capture the file output without duplicating the knowledge of which files are actually produced. With some further refactoring of the File class, this could support capturing the output into in-memory buffers as well, but for now the current capabilities are sufficient.
Public Member Functions | |
virtual File & | standardOutput ()=0 |
Returns a File object to use for stdout output. | |
virtual FileInitializer | openFileForWriting (const char *filename)=0 |
Returns a File object to use for output to a given file. More... | |
FileInitializer | openFileForWriting (const std::string &filename) |
Convenience method to open a file using an std::string path. | |
|
pure virtual |
Returns a File object to use for output to a given file.
[in] | filename | Requested file name. |