omni::extras::stringToInteger
Defined in omni/extras/StringHelpers.h
-
inline bool omni::extras::stringToInteger(const std::string &str, int32_t &outResult)
Converts a given string to a 32-bit signed integer value.
Warning
This function will truncate values and may lose information even though
trueis returned. It’s use is not recommended.- Parameters
str – The string to convert. May be a decimal, hexadecimal (
0xprefix) or octal (0prefix) number. A floating point value may also be given including with exponential notation, though floating point values will be casted to an integer and may lose precision.outResult – [out] The reference that receives the integer result
- Returns
trueifstrtollorstrtodparsestrin its entirety;falseotherwise. NOTE a return value oftruedoes not mean that information or precision is not lost!