BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
anonymous_namespace{OutputDataReadStrategy.cpp} Namespace Reference

Functions

std::string trim (const std::string &str, const std::string &whitespace=" \t")
 
bool isDoubleStartChar (char c)
 

Function Documentation

◆ trim()

std::string anonymous_namespace{OutputDataReadStrategy.cpp}::trim ( const std::string &  str,
const std::string &  whitespace = " \t" 
)
inline

Definition at line 25 of file OutputDataReadStrategy.cpp.

26 {
27  const auto strBegin = str.find_first_not_of(whitespace);
28 
29  if (strBegin == std::string::npos)
30  return "";
31 
32  const auto strEnd = str.find_last_not_of(whitespace);
33  const auto strRange = strEnd - strBegin + 1;
34 
35  return str.substr(strBegin, strRange);
36 }

Referenced by OutputDataReadINTStrategy::readOutputData(), OutputDataReadReflectometryStrategy::readOutputData(), and OutputDataReadNumpyTXTStrategy::readOutputData().

◆ isDoubleStartChar()

bool anonymous_namespace{OutputDataReadStrategy.cpp}::isDoubleStartChar ( char  c)
inline

Definition at line 37 of file OutputDataReadStrategy.cpp.

38 {
39  return isdigit(c) || c == '-' || c == '+';
40 }

Referenced by OutputDataReadNumpyTXTStrategy::readOutputData().