16 std::cerr <<
"[trivialParser] no value for " <<
name <<
" found\n";
30 std::string valuestring(linea, linea.find(
'=', 0) + 1, linea.size() - linea.find(
'=', 0) - 1);
32 double value = strtod(valuestring.c_str(),
nullptr);
34 }
while (!
input.eof());
43 getline(
input, singleLine,
'\n');
45 }
while ((singleLine.find(
'#', 0) != std::string::npos || singleLine.find(
'=', 0) == std::string::npos ||
46 singleLine.size() < 3) &&
55 std::cerr <<
"read parameters: " << std::endl;
56 for (std::map<std::string, double>::const_iterator mapIT =
m_config.begin(); mapIT !=
m_config.end(); ++mapIT) {
64 while (
word.find(
' ', 0) != std::string::npos) {
void print(std::string prefix="")
print the read params
static std::string const input
double getVal(std::string name)
return the value for that parameter
trivialParser(std::string configFile)
ctor
void parse(std::string configFile)
parse the cfg file
std::string getNextLine(std::ifstream &input)
returns the next not commented line
std::map< std::string, double > m_config
container for the output
void eraseSpaces(std::string &word)
get rid of spaces