Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Teuchos::StringValidator Class Reference

A simple validator that only allows certain string values to be choosen or simply enforces that a particular parameter have a std::string for a value. More...

#include <Teuchos_StandardParameterEntryValidators.hpp>

Inheritance diagram for Teuchos::StringValidator:

Private Members

ValidStringsList validStrings_
 An array containing a list of all the valid string values.

Constructors/Destructor

 StringValidator ()
 Constructs a StringValidator.
 StringValidator (const Teuchos::Array< std::string > &validStrings)
 Constructs a StringValidator.

Setter Functions

ValidStringsList setValidStrings (const Teuchos::Array< std::string > &validStrings)
 Sets the Array of valid strings and returns what the current array of valid string now is.

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

Additional Inherited Members

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

Detailed Description

A simple validator that only allows certain string values to be choosen or simply enforces that a particular parameter have a std::string for a value.

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

Definition at line 1875 of file Teuchos_StandardParameterEntryValidators.hpp.

Constructor & Destructor Documentation

◆ StringValidator() [1/2]

Teuchos::StringValidator::StringValidator ( )

Constructs a StringValidator.

Definition at line 645 of file Teuchos_StandardParameterEntryValidators.cpp.

◆ StringValidator() [2/2]

Teuchos::StringValidator::StringValidator ( const Teuchos::Array< std::string > & validStrings)

Constructs a StringValidator.

Parameters
validStringsA list of valid string values for this validator.

Definition at line 650 of file Teuchos_StandardParameterEntryValidators.cpp.

Member Function Documentation

◆ setValidStrings()

ParameterEntryValidator::ValidStringsList Teuchos::StringValidator::setValidStrings ( const Teuchos::Array< std::string > & validStrings)

Sets the Array of valid strings and returns what the current array of valid string now is.

Parameters
validStringsWhat the array for the valid strings should contain.
Returns
What the arry for the valid strings now conatians.

Definition at line 657 of file Teuchos_StandardParameterEntryValidators.cpp.

◆ validStringValues()

ParameterEntryValidator::ValidStringsList Teuchos::StringValidator::validStringValues ( ) const
virtual

◆ validate()

void Teuchos::StringValidator::validate ( ParameterEntry const & entry,
std::string const & paramName,
std::string const & sublistName ) const
virtual

◆ getXMLTypeName()

const std::string Teuchos::StringValidator::getXMLTypeName ( ) const
virtual

◆ printDoc()

void Teuchos::StringValidator::printDoc ( std::string const & docString,
std::ostream & out ) const
virtual

Member Data Documentation

◆ validStrings_

ValidStringsList Teuchos::StringValidator::validStrings_
private

An array containing a list of all the valid string values.

Definition at line 1934 of file Teuchos_StandardParameterEntryValidators.hpp.


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