diff --git a/functions.cc b/functions.cc new file mode 100644 index 0000000000000000000000000000000000000000..f8d4d598b38d9ef0e54fd20b68601a56a13f43e5 --- /dev/null +++ b/functions.cc @@ -0,0 +1,24 @@ +#include "options.h" + +namespace Utilities { + + void string_to_T(bool &b, const string& s) { + if(s == "NO ARG") + b = !b; + else + b = (s == "true"); + } + + void string_to_T(string& d, const string& s) { + d = s; + } + + void string_to_T(int& i, const string& s) { + i = atoi(s.c_str()); + } + + void string_to_T(float& v, const string& s) { + v = atof(s.c_str()); + } + +}