Gromacs
5.1
|
#include <gromacs/utility/fileredirector.h>
Allows overriding file existence checks from code that supports it.
The calling code should take in this interface and use the methods in it all file system operations that need to support this redirection. By default, the code can then use defaultFileInputRedirector() in case no redirection is needed.
This allows tests to override the file existence checks without actually using the file system.
With some further refactoring of the File class, this could also support redirecting input files from in-memory buffers as well, but for now the current capabilities are sufficient.
Public Member Functions | |
virtual bool | fileExists (const char *filename) const =0 |
Checks whether the provided path exists (and is a file). | |
bool | fileExists (const std::string &filename) const |
Convenience method to check file existence using an std::string path. | |