51 const std::string & delim,
52 std::vector<std::string> & output)
76 const std::string & paramName,
77 const std::string & sublistName)
const
85 "Sorry but it looks like the \"" << paramName <<
"\"" <<
86 " parameter in the \"" << sublistName <<
87 "\" sublist does not exist." << std::endl << std::endl <<
88 "Error: The value that you entered was the wrong type." << std::endl <<
89 "Parameter: " << paramName << std::endl <<
90 "Type specified: " << entryName << std::endl <<
91 "Type accepted: " <<
typeid(std::string).name() <<
92 std::endl << std::endl);
94 const std::string & value = Teuchos::any_cast<std::string>(anyValue);
96 std::vector<std::string> tokens;
97 split(value,
",",tokens);
100 const std::string errorStr =
"The value for \"string-list\" type parameter in sublist \""+sublistName+
"\" named \""+paramName+
"\" "
101 "is incorrectly formatted. The expected format is\n"
102 " \"<string>[, <string>]*\" "
103 "your value is \""+value+
"\"";
113 std::string
const &docString, std::ostream &out)
const
116 out <<
"# Validator Used: " << std::endl;
117 out <<
"# CommaSeparatedEntry Validator" << std::endl;
void printDoc(const std::string &docString, std::ostream &out) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
static std::ostream & printLines(std::ostream &os, const std::string &linePrefix, const std::string &lines)
void validate(const Teuchos::ParameterEntry &entry, const std::string ¶mName, const std::string &sublistName) const
any & getAny(bool activeQry=true)
std::string typeName() const
void StringTokenizer(std::vector< std::string > &tokens, const std::string &str, const std::string delimiters, bool trim)
Tokenize a string, put tokens in a vector.
const std::type_info & type() const
static void split(const std::string &str, const std::string &delim, std::vector< std::string > &tokens)
Utility function for tokenizing.