Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::FileNameOptionStorage Class Reference

#include <gromacs/options/filenameoptionstorage.h>

+ Inheritance diagram for gmx::FileNameOptionStorage:
+ Collaboration diagram for gmx::FileNameOptionStorage:

Description

Converts, validates, and stores file names.

Public Member Functions

 FileNameOptionStorage (const FileNameOption &settings, FileNameOptionManager *manager)
 Initializes the storage from option settings. More...
 
OptionInfooptionInfo () override
 Returns an option info object corresponding to this option.
 
std::string typeString () const override
 Returns a short string describing the type of the option.
 
std::string formatExtraDescription () const override
 Formats additional description for the option. More...
 
std::string formatSingleValue (const std::string &value) const override
 Formats a single value as a string. More...
 
bool isInputFile () const
 Whether the option specifies an input file. More...
 
bool isOutputFile () const
 Whether the option specifies an output file. More...
 
bool isInputOutputFile () const
 Whether the option specifies a file used for both input and output. More...
 
bool isLibraryFile () const
 Whether the option specifies a library file. More...
 
bool allowMissing () const
 Whether the (input) option allows missing files to be provided. More...
 
bool isDirectoryOption () const
 Whether the option specifies directories. More...
 
bool isTrajectoryOption () const
 Whether the option specifies a generic trajectory file. More...
 
const char * defaultExtension () const
 Returns the default extension for this option. More...
 
std::vector< const char * > extensions () const
 Returns the list of extensions this option accepts. More...
 
bool isValidType (int fileType) const
 Returns whether fileType (from filetypes.h) is accepted for this option. More...
 
ArrayRef< const int > fileTypes () const
 Returns the list of file types this option accepts. More...
 
- Public Member Functions inherited from gmx::OptionStorageTemplate< std::string >
int valueCount () const override
 Returns the number of option values added so far. More...
 
std::vector< AnydefaultValues () const override
 
std::vector< std::string > defaultValuesAsStrings () const override
 
- Public Member Functions inherited from gmx::AbstractOptionStorage
bool isSet () const
 Returns true if the option has been set.
 
bool isBoolean () const
 Returns true if the option is a boolean option. More...
 
bool isHidden () const
 Returns true if the option is a hidden option.
 
bool isRequired () const
 Returns true if the option is required.
 
bool isVector () const
 Returns true if the option is vector-valued.
 
const std::string & name () const
 Returns the name of the option.
 
const std::string & description () const
 Returns the description of the option set by the calling code.
 
bool defaultValueIfSetExists () const
 Returns true if defaultValueIfSet() value is specified.
 
int minValueCount () const
 Returns the minimum number of values required in one set.
 
int maxValueCount () const
 Returns the maximum allowed number of values in one set (-1 = no limit).
 
void startSource ()
 Starts adding values from a new source for the option. More...
 
void startSet ()
 Starts adding a new set of values for the option. More...
 
void appendValue (const Any &value)
 Adds a new value for the option. More...
 
void finishSet ()
 Performs validation and/or actions once a set of values has been added. More...
 
void finish ()
 Performs validation and/or actions once all values have been added. More...
 

Additional Inherited Members

- Public Types inherited from gmx::OptionStorageTemplateSimple< std::string >
typedef
OptionStorageTemplateSimple
< std::string > 
MyBase
 Alias for the template class for use in base classes.
 
- Public Types inherited from gmx::OptionStorageTemplate< std::string >
typedef OptionStorageTemplate
< std::string > 
MyBase
 Alias for the template class for use in base classes.
 
typedef std::vector< std::string > ValueList
 Type of the container that contains the current values.
 
- Protected Types inherited from gmx::OptionStorageTemplateSimple< std::string >
typedef
OptionValueConverterSimple
< std::string > 
ConverterType
 Alias for the converter parameter type for initConverter().
 
- Protected Types inherited from gmx::OptionStorageTemplate< std::string >
typedef std::unique_ptr
< IOptionValueStore
< std::string > > 
StorePointer
 Smart pointer for managing the final storage interface.
 
- Protected Member Functions inherited from gmx::OptionStorageTemplateSimple< std::string >
 OptionStorageTemplateSimple (const OptionTemplate< std::string, U > &settings, OptionFlags staticFlags=OptionFlags())
 Initializes the storage.
 
 OptionStorageTemplateSimple (const AbstractOption &settings, typename OptionStorageTemplate< std::string >::StorePointer store)
 Initializes the storage.
 
std::vector< AnynormalizeValues (const std::vector< Any > &values) const override
 
virtual Any normalizeValue (const std::string &value) const
 Converts a single value to normalized type. More...
 
- Protected Member Functions inherited from gmx::OptionStorageTemplate< std::string >
 OptionStorageTemplate (const OptionTemplate< std::string, U > &settings, OptionFlags staticFlags=OptionFlags())
 Initializes the storage from option settings. More...
 
 OptionStorageTemplate (const AbstractOption &settings, StorePointer store)
 Initializes the storage from base option settings. More...
 
void clearSet () override
 Removes all values from temporary storage for a set. More...
 
virtual void processSetValues (ValueList *values)
 Processes values for a set after all have been converted. More...
 
void processSet () override
 Performs validation and/or actions once a set of values has been added. More...
 
void processAll () override
 Performs validation and/or actions once all values have been added. More...
 
void addValue (const std::string &value)
 Adds a value to a temporary storage. More...
 
void commitValues ()
 Commits values added with addValue(). More...
 
void setDefaultValue (const std::string &value)
 Sets the default value for the option. More...
 
void setDefaultValueIfSet (const std::string &value)
 Sets the default value if set for the option. More...
 
ArrayRef< std::string > values ()
 Provides derived classes access to the current list of values. More...
 
ArrayRef< const std::string > values () const
 Provides derived classes access to the current list of values.
 
- Protected Member Functions inherited from gmx::AbstractOptionStorage
 AbstractOptionStorage (const AbstractOption &settings, OptionFlags staticFlags)
 Initializes the storage object from the settings object. More...
 
void markAsSet ()
 Marks the option as set.
 
bool hasFlag (OptionFlag flag) const
 Returns true if the given flag is set.
 
void setFlag (OptionFlag flag)
 Sets the given flag.
 
void clearFlag (OptionFlag flag)
 Clears the given flag.
 
void setMinValueCount (int count)
 Sets a new minimum number of values required in one set. More...
 
void setMaxValueCount (int count)
 Sets a new maximum number of values required in one set. More...
 

Constructor & Destructor Documentation

gmx::FileNameOptionStorage::FileNameOptionStorage ( const FileNameOption settings,
FileNameOptionManager manager 
)

Initializes the storage from option settings.

Parameters
[in]settingsStorage settings.
managerManager for this object (can be NULL).

Member Function Documentation

bool gmx::FileNameOptionStorage::allowMissing ( ) const
inline

Whether the (input) option allows missing files to be provided.

const char * gmx::FileNameOptionStorage::defaultExtension ( ) const

Returns the default extension for this option.

std::vector< const char * > gmx::FileNameOptionStorage::extensions ( ) const

Returns the list of extensions this option accepts.

ArrayRef< const int > gmx::FileNameOptionStorage::fileTypes ( ) const

Returns the list of file types this option accepts.

std::string gmx::FileNameOptionStorage::formatExtraDescription ( ) const
overridevirtual

Formats additional description for the option.

If this method returns a non-empty string, it is appended to the plain description when printing help texts. The default implementation returns an empty string.

Reimplemented from gmx::AbstractOptionStorage.

std::string gmx::FileNameOptionStorage::formatSingleValue ( const std::string &  value) const
overridevirtual

Formats a single value as a string.

Parameters
[in]valueValue to format.
Returns
value formatted as a string.

The derived class must provide this method to format values a strings. Called by defaultValuesAsStrings() to do the actual formatting.

Implements gmx::OptionStorageTemplate< std::string >.

bool gmx::FileNameOptionStorage::isDirectoryOption ( ) const

Whether the option specifies directories.

bool gmx::FileNameOptionStorage::isInputFile ( ) const
inline

Whether the option specifies an input file.

bool gmx::FileNameOptionStorage::isInputOutputFile ( ) const
inline

Whether the option specifies a file used for both input and output.

bool gmx::FileNameOptionStorage::isLibraryFile ( ) const
inline

Whether the option specifies a library file.

See Also
FileNameOption::libraryFile()
bool gmx::FileNameOptionStorage::isOutputFile ( ) const
inline

Whether the option specifies an output file.

bool gmx::FileNameOptionStorage::isTrajectoryOption ( ) const

Whether the option specifies a generic trajectory file.

bool gmx::FileNameOptionStorage::isValidType ( int  fileType) const

Returns whether fileType (from filetypes.h) is accepted for this option.


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