50 m_warnDefault(warnDefault)
66 "InputParameters: unable to open file " <<
m_fileName
75 for (
CepsUInt iLine=0U; iLine<lines.size(); iLine++)
80 if (line.find(
':')!=line.npos and not line.starts_with(
'#'))
82 std::stringstream ss(line);
90 "In parameters file, key is empty at line " << iLine
93 "Empty value at line " << iLine <<
" of parameter file"
97 if (value.ends_with(
'\\'))
114 if (value.ends_with(
'\\'))
116 readNewEntry =
false;
150 warnNoKey(key,std::to_string(defVal),
"real value");
170 std::stringstream def;
171 def <<
CepsString(
"(") << defVal(0) <<
"," << defVal(1) <<
"," << defVal(2) <<
")";
192 warnNoKey(key,std::to_string(defVal),
"integer value");
257 "No " << type <<
" with key \"" << key <<
"\" found in parameters file"
265 "No " << type <<
" with key \"" << key <<
"\" found in parameters file. Will use default: " << defValue
#define CEPS_SAYS(message)
Writes a message in the debug log and in the terminal (stdio).
#define CEPS_WARNS_IF(condition, message)
If condition is true, writes a warning in the debug log and in the terminal (stderr).
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
#define CEPS_WARNS(message)
Writes a warning in the debug log and in the terminal (stderr).
std::basic_string< CepsChar > CepsString
C++ format string.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
Eigen::Matrix< CepsScalar, 3, 1 > CepsMathVertex
Vertex, eigen format.
int32_t CepsInt
Need 32 bit integer.
Base class that regroups common reader functionalities.
virtual CepsBool open()
Opens the designated file in read mode.
CepsString m_fileName
file to open
std::ifstream m_file
stream
CepsBool contains(const CepsVector< _Type, _Alloc > &vec, const _Type &item)
Tells if vectors contains a given item.
CepsString toString(_Tp value)
Convert a given value to a string (input has to be compatible with std::to_string)
CepsString toKey(const CepsString &s)
Transform to key type a std::string, upper case and no spaces.
CepsVector< CepsString > split(const CepsString &s, const CepsString &delimiters=CepsString(" \t"))
Splits a string using mulitple delimiters in a single string.
CepsInt toInt(const CepsString &s)
Cast CepsString to CepsInt.
CepsMathVertex toMathVertex(const CepsVector< CepsString > &vec)
Cast a CepsVector of CepsString to CepsMathVertex.
CepsString trim(const CepsString &s)
Removes trailing and preceeding spaces.
CepsReal toReal(const CepsString &s)
Cast CepsString to CepsReal.