SDL2lazy
SlValueParser.hpp
Go to the documentation of this file.
1 // part of SDL2lazy
2 // author: Ulrike Hager
3 
13 template<typename T> void
14 SlValueParser::stringsToNumbers(const std::vector<std::string>& stringValues, T *values, unsigned int length )
15 {
16  double dvalues[length];
17  stringsToDoubles(stringValues, dvalues, length) ;
18  for (unsigned int i = 0; i < length; ++i ) {
19  values[i] = static_cast<T>(dvalues[i]);
20  }
21 }
22 
23 
void stringsToNumbers(const std::vector< std::string > &stringValues, T *array, unsigned int length)
Definition: SlValueParser.hpp:14
void stringsToDoubles(const std::vector< std::string > &stringValues, double *values, unsigned int length)
Definition: SlValueParser.cc:266