Gromacs
2025.0-dev-20241011-013a99c
|
#include <gromacs/utility/include/gromacs/utility/datafilefinder.h>
Search parameters for DataFileFinder.
This class implements a named parameter idiom for DataFileFinder::findFile() and DataFileFinder::openFile() to support an easily readable and customizable way of searching data files.
By default, the search first considers the current directory, followed by specified and default data directories, and an exception is thrown if the file could not be found. To skip searching in the current directory, use includeCurrentDir().
Methods in this class do not throw.
Public Member Functions | |
DataFileOptions (const std::filesystem::path &filename) | |
Constructs default options for searching for a file with the specified name. More... | |
DataFileOptions & | includeCurrentDir (bool bInclude) |
Sets whether to search first in the current (working) directory. | |
DataFileOptions & | throwIfNotFound (bool bThrow) |
Sets whether an exception is thrown if the file could not be found. | |
Friends | |
class | DataFileFinder |
Needed to access the members without otherwise unnecessary accessors. | |
|
inline |
Constructs default options for searching for a file with the specified name.
[in] | filename | File name to search for. |
This constructor is not explicit to allow passing a simple string to DataFileFinder methods to search for the string with the default parameters.