SOFA API  f82e2e00
Open source framework for multi-physics simuation
sofa::type::hardening Namespace Reference

Functions

template<typename IndexType >
requires constexpr std::is_integral_v< IndexType > bool checkOverflow (IndexType a, IndexType b)
 
bool safeStrToInt (const std::string &s, int &result)
 
bool safeStrToUInt (const std::string &s, unsigned int &result)
 
template<typename ScalarType >
requires std::is_scalar_v< ScalarType > bool safeStrToScalar (const std::string &s, ScalarType &result)
 
std::string escapeForShell (const std::string &input)
 

Function Documentation

◆ checkOverflow()

template<typename IndexType >
requires constexpr std::is_integral_v<IndexType> bool sofa::type::hardening::checkOverflow ( IndexType  a,
IndexType  b 
)
constexpr

◆ escapeForShell()

std::string sofa::type::hardening::escapeForShell ( const std::string &  input)
inline

Escape a string for safe use in a shell double-quoted context. Escapes: backslash, backtick, dollar, double-quote, and newline.

◆ safeStrToInt()

bool sofa::type::hardening::safeStrToInt ( const std::string &  s,
int result 
)
inline

◆ safeStrToScalar()

template<typename ScalarType >
requires std::is_scalar_v<ScalarType> bool sofa::type::hardening::safeStrToScalar ( const std::string &  s,
ScalarType &  result 
)

◆ safeStrToUInt()

bool sofa::type::hardening::safeStrToUInt ( const std::string &  s,
unsigned int result 
)
inline