Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
Teuchos::FileNameValidator Class Reference

Validate a file name entry. More...

#include <Teuchos_StandardParameterEntryValidators.hpp>

Inheritance diagram for Teuchos::FileNameValidator:
Inheritance graph
[legend]

Public types

static bool mustAlreadyExistDefault ()
 The default value of the mustAlreadyExist parameter in the constructor. More...
 

Constructors/Destructor

 FileNameValidator (bool mustAlreadyExist=mustAlreadyExistDefault())
 Constructs a FileNameValidator. More...
 

Attribute/Query Functions

bool fileMustExist () const
 Gets the variable describing whether or not this validator wants the file that is specified to already exist. More...
 
bool fileEmptyNameOK () const
 Gets the variable describing whether or not this validator is OK with file name being empty (even if fileMustExist() returns true). More...
 

Setter Functions

bool setFileMustExist (bool shouldFileExist)
 Sets whether or not the validator requires the file to already exist. More...
 
bool setFileEmptyNameOK (bool isEmptyNameOK)
 Sets whether or not the validator is OK with empty file name (even if fileMustExist() returns true) More...
 

Overridden from ParameterEntryValidator

ValidStringsList validStringValues () const
 
void validate (ParameterEntry const &entry, std::string const &paramName, std::string const &sublistName) const
 
const std::string getXMLTypeName () const
 
void printDoc (std::string const &docString, std::ostream &out) const
 

Private Members

bool mustAlreadyExist_
 Whether or not the file specified in the parameter should already exist. More...
 
bool EmptyNameOK_
 

Additional Inherited Members

- Public Types inherited from Teuchos::ParameterEntryValidator
typedef unsigned int ValidatorID
 
typedef RCP< const Array
< std::string > > 
ValidStringsList
 
- Public Member Functions inherited from Teuchos::ParameterEntryValidator
 ParameterEntryValidator ()
 Default Constructor. More...
 
virtual void validateAndModify (std::string const &paramName, std::string const &sublistName, ParameterEntry *entry) const
 Validate and perhaps modify a parameter entry's value. More...
 
double convertStringToDouble (std::string str) const
 
int convertStringToInt (std::string str) const
 
int convertStringToLongLong (std::string str) const
 
- Public Member Functions inherited from Teuchos::Describable
virtual std::string description () const
 Return a simple one-line description of this object. More...
 
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 Print the object with some verbosity level to a FancyOStream. More...
 
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 Version of describe() that takes an std::ostream instead of a FancyOStream. More...
 
virtual ~Describable ()
 Destructor (marked virtual for memory safety of derived classes). More...
 
- Public Member Functions inherited from Teuchos::LabeledObject
 LabeledObject ()
 Construct with an empty label. More...
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 Set the object label (see LabeledObject). More...
 
virtual std::string getObjectLabel () const
 Get the object label (see LabeledObject). More...
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default = VERB_DEFAULT
 Default value for the verbLevel argument of describe(). More...
 

Detailed Description

Validate a file name entry.

Simply indicates that the parameter entry with this validator should contain a filename.

Please see FileNameValidatorXMLConverter for documenation regarding the XML representation of this validator.

Definition at line 1723 of file Teuchos_StandardParameterEntryValidators.hpp.

Constructor & Destructor Documentation

Teuchos::FileNameValidator::FileNameValidator ( bool  mustAlreadyExist = mustAlreadyExistDefault())

Constructs a FileNameValidator.

Parameters
mustAlreadyExistTrue if the file the user specifies should already exists, false otherwise.

Definition at line 560 of file Teuchos_StandardParameterEntryValidators.cpp.

Member Function Documentation

static bool Teuchos::FileNameValidator::mustAlreadyExistDefault ( )
inlinestatic

The default value of the mustAlreadyExist parameter in the constructor.

Definition at line 1732 of file Teuchos_StandardParameterEntryValidators.hpp.

bool Teuchos::FileNameValidator::fileMustExist ( ) const

Gets the variable describing whether or not this validator wants the file that is specified to already exist.

Returns
Whether or not the validator requires the file to already exist

Definition at line 566 of file Teuchos_StandardParameterEntryValidators.cpp.

bool Teuchos::FileNameValidator::fileEmptyNameOK ( ) const

Gets the variable describing whether or not this validator is OK with file name being empty (even if fileMustExist() returns true).

Note: This property of the validator is not persistent. It is not saved or retrieved. Its purpose is to work around the fact that an input file name, for which user has not given the name by selecting in a GUI, is empty.

Returns
Whether or not the validator is OK with file name being empty.

Definition at line 571 of file Teuchos_StandardParameterEntryValidators.cpp.

bool Teuchos::FileNameValidator::setFileMustExist ( bool  shouldFileExist)

Sets whether or not the validator requires the file to already exist.

Parameters
shouldFileExistTrue if the file should already exist, false otherwise.
Returns
The new value of the shouldFileExist variable.

Definition at line 576 of file Teuchos_StandardParameterEntryValidators.cpp.

bool Teuchos::FileNameValidator::setFileEmptyNameOK ( bool  isEmptyNameOK)

Sets whether or not the validator is OK with empty file name (even if fileMustExist() returns true)

Parameters
isEmptyNameOKTrue if empty name is all right, false otherwise.
Returns
The new value of the isEmptyNameOK variable.

Definition at line 582 of file Teuchos_StandardParameterEntryValidators.cpp.

ParameterEntryValidator::ValidStringsList Teuchos::FileNameValidator::validStringValues ( ) const
virtual
void Teuchos::FileNameValidator::validate ( ParameterEntry const &  entry,
std::string const &  paramName,
std::string const &  sublistName 
) const
virtual
const std::string Teuchos::FileNameValidator::getXMLTypeName ( ) const
virtual
void Teuchos::FileNameValidator::printDoc ( std::string const &  docString,
std::ostream &  out 
) const
virtual

Member Data Documentation

bool Teuchos::FileNameValidator::mustAlreadyExist_
private

Whether or not the file specified in the parameter should already exist.

Definition at line 1828 of file Teuchos_StandardParameterEntryValidators.hpp.

bool Teuchos::FileNameValidator::EmptyNameOK_
private

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