Gromacs
2018.1
|
#include <testutils/testfileredirector.h>
In-memory implementation for IFileInputRedirector for tests.
By default, this implementation will return false
for all file existence checks. To return true
for a specific path, use addExistingFile().
Public Member Functions | |
void | addExistingFile (const char *filename) |
Marks the provided path as an existing file. More... | |
virtual bool | fileExists (const char *filename, File::NotFoundHandler onNotFound) const |
Checks whether the provided path exists (and is a file). More... | |
Public Member Functions inherited from gmx::IFileInputRedirector | |
bool | fileExists (const std::string &filename, File::NotFoundHandler onNotFound) const |
Convenience method to check file existence using an std::string path. | |
void gmx::test::TestFileInputRedirector::addExistingFile | ( | const char * | filename | ) |
Marks the provided path as an existing file.
std::bad_alloc | if out of memory. |
Further checks for existence of the given path will return true
.
|
virtual |
Checks whether the provided path exists (and is a file).
The onNotFound
can be used to influence the behavior on error conditions. Functions to pass as this parameter are provided as members of gmx::File.
Implements gmx::IFileInputRedirector.