Gromacs  2021-sycl
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::test::TestFileInputRedirector Class Reference

#include <testutils/testfileredirector.h>

+ Inheritance diagram for gmx::test::TestFileInputRedirector:
+ Collaboration diagram for gmx::test::TestFileInputRedirector:

Description

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...
 
bool fileExists (const char *filename, File::NotFoundHandler onNotFound) const override
 Checks whether the provided path exists (and is a file). More...
 
bool fileExists (const std::string &filename, File::NotFoundHandler onNotFound) const
 Convenience method to check file existence using an std::string path.
 

Member Function Documentation

void gmx::test::TestFileInputRedirector::addExistingFile ( const char *  filename)

Marks the provided path as an existing file.

Exceptions
std::bad_allocif out of memory.

Further checks for existence of the given path will return true.

bool gmx::test::TestFileInputRedirector::fileExists ( const char *  filename,
File::NotFoundHandler  onNotFound 
) const
overridevirtual

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.


The documentation for this class was generated from the following files: