9 #ifndef Tempus_String_Utilities_hpp
10 #define Tempus_String_Utilities_hpp
14 #include "Teuchos_RCP.hpp"
15 #include "Teuchos_ParameterList.hpp"
20 void trim(std::string& str);
24 const std::string& str,
25 const std::string delimiter =
",",
bool trim=
false);
29 const std::vector<std::string> & tokens);
33 const std::vector<std::string> & tokens);
38 template <
typename ScalarT>
40 const Teuchos::ParameterList & plist)
42 return plist.get<
double>(field);
46 #endif // Tempus_String_Utilities_hpp
ScalarT getScalarParameter(const std::string &field, const Teuchos::ParameterList &plist)
void TokensToDoubles(std::vector< double > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of doubles.
void trim(std::string &str)
Removes whitespace at beginning and end of string.
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.
void TokensToInts(std::vector< int > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of ints.