26 #ifndef GRINS_STRING_UTILS_H
27 #define GRINS_STRING_UTILS_H
30 #include "libmesh/libmesh_common.h"
39 namespace StringUtilities
45 std::istringstream converter(input);
47 converter >> returnval;
60 std::pair<std::string, int> ret = std::make_pair(std::string(), 0);
61 std::string::size_type colon_position = token.find(
":");
62 libmesh_assert (colon_position != std::string::npos);
63 ret.first = token.substr(0, colon_position);
64 ret.second = std::atoi(token.substr(colon_position + 1).c_str());
76 std::pair<std::string, double> ret = std::make_pair(std::string(), 0.0);
77 std::string::size_type colon_position = token.find(
":");
78 libmesh_assert (colon_position != std::string::npos);
79 ret.first = token.substr(0, colon_position);
80 ret.second = std::atof(token.substr(colon_position + 1).c_str());
85 const std::string& delimiter,
86 std::vector<std::string>& results );
90 #endif // GRINS_STRING_UTILS_H
T string_to_T(const std::string &input)
std::pair< std::string, int > split_string_int_on_colon(const std::string &token)
Split on colon, and return name, int value pair.
void split_string(const std::string &input, const std::string &delimiter, std::vector< std::string > &results)
std::pair< std::string, double > split_string_double_on_colon(const std::string &token)
Split on colon, and return name, double value pair.