19 const std::string & delim,
20 std::vector<std::string> & output)
44 const std::string & paramName,
45 const std::string & sublistName)
const
53 "Sorry but it looks like the \"" << paramName <<
"\"" <<
54 " parameter in the \"" << sublistName <<
55 "\" sublist does not exist." << std::endl << std::endl <<
56 "Error: The value that you entered was the wrong type." << std::endl <<
57 "Parameter: " << paramName << std::endl <<
58 "Type specified: " << entryName << std::endl <<
59 "Type accepted: " <<
typeid(std::string).name() <<
60 std::endl << std::endl);
62 const std::string & value = Teuchos::any_cast<std::string>(anyValue);
64 std::vector<std::string> tokens;
65 split(value,
",",tokens);
68 const std::string errorStr =
"The value for \"string-list\" type parameter in sublist \""+sublistName+
"\" named \""+paramName+
"\" "
69 "is incorrectly formatted. The expected format is\n"
70 " \"<string>[, <string>]*\" "
71 "your value is \""+value+
"\"";
81 std::string
const &docString, std::ostream &out)
const
84 out <<
"# Validator Used: " << std::endl;
85 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.