Gromacs  2025.0-dev-20241011-013a99c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Friends
gmx::DataFileOptions Class Reference

#include <gromacs/utility/include/gromacs/utility/datafilefinder.h>

Description

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...
 
DataFileOptionsincludeCurrentDir (bool bInclude)
 Sets whether to search first in the current (working) directory.
 
DataFileOptionsthrowIfNotFound (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.
 

Constructor & Destructor Documentation

gmx::DataFileOptions::DataFileOptions ( const std::filesystem::path &  filename)
inline

Constructs default options for searching for a file with the specified name.

Parameters
[in]filenameFile 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.


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