Gromacs  2016.4
 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/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 char *filename)
 Constructs default options for searching for a file with the specified name. More...
 
 DataFileOptions (const std::string &filename)
 Constructs default options for searching for a file with the specified name. More...
 
DataFileOptionsincludeCurrentDir (bool bInclude)
 Sets whether to search 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 char *  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.

gmx::DataFileOptions::DataFileOptions ( const std::string &  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: