3 #include <boost/algorithm/string/split.hpp> 8 std::vector<std::string> results;
9 boost::split(results, str, [delim](
char c) {
return c == delim; });
15 std::int64_t int_val = 0;
18 int_val = std::stoll(s);
20 catch (std::exception& e)
22 std::cerr <<
"conversion of data from string failed: " << s << std::endl;
23 return std::numeric_limits<std::int64_t>::quiet_NaN();
33 float_val = std::stof(s);
35 catch (std::exception& e)
37 std::cerr <<
"conversion of data from string failed " << s << std::endl;
38 return std::numeric_limits<float>::quiet_NaN();
float to_float(const std::string &s)
const std::vector< std::string > split(const std::string &str, const char delim=';')
std::int64_t to_long(const std::string &s)