9#include <framework/utilities/Conversion.h>
26 std::string::size_type n;
27 float number = std::stof(str, &n);
28 if (n != str.size()) {
29 throw std::invalid_argument(
"Could only parse a part of the given string " + str);
42 std::string::size_type n;
43 double number = std::stod(str, &n);
44 if (n != str.size()) {
45 throw std::invalid_argument(
"Could only parse a part of the given string " + str);
58 std::string::size_type n;
59 long double number = std::stold(str, &n);
60 if (n != str.size()) {
61 throw std::invalid_argument(
"Could only parse a part of the given string " + str);
74 std::string::size_type n;
75 int number = std::stoi(str, &n);
76 if (n != str.size()) {
77 throw std::invalid_argument(
"Could only parse a part of the given string " + str);
90 std::string::size_type n;
91 long int number = std::stol(str, &n);
92 if (n != str.size()) {
93 throw std::invalid_argument(
"Could only parse a part of the given string " + str);
106 std::string::size_type n;
107 unsigned long int number = std::stoul(str, &n);
108 if (n != str.size()) {
109 throw std::invalid_argument(
"Could only parse a part of the given string " + str);
T convertString(const std::string &str)
Converts a string to type T (one of float, double, long double, int, long int, unsigned long int).
Abstract base class for different kinds of events.