Gromacs  2024.2
 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/include/testutils/testfileredirector.h>

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


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 std::filesystem::path &filename)
 Marks the provided path as an existing file. More...
bool fileExists (const std::filesystem::path &filename, const File::NotFoundHandler &onNotFound) const override
 Checks whether the provided path exists (and is a file). More...

Member Function Documentation

void gmx::test::TestFileInputRedirector::addExistingFile ( const std::filesystem::path &  filename)

Marks the provided path as an existing file.

std::bad_allocif out of memory.

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

bool gmx::test::TestFileInputRedirector::fileExists ( const std::filesystem::path &  filename,
const File::NotFoundHandler &  onNotFound 
) const

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: