bool OEStringToNumber(const std::string &str, short &val, int b = 10) bool OEStringToNumber(const std::string &str, unsigned short &val, int b = 10) bool OEStringToNumber(const std::string &str, int &val, int b = 10) bool OEStringToNumber(const std::string &str, unsigned int &val, int b = 10) bool OEStringToNumber(const std::string &str, OELongLong &val, int b = 10) bool OEStringToNumber(const std::string &str, OEULongLong &val, int b = 10) bool OEStringToNumber(const std::string &str, float &val) bool OEStringToNumber(const std::string &str, double &val)
These functions attempt to convert the specified string (str
) into a
numerical value in the specified base (b
) and store the generated value
in the format appropriate to the passed parameter (val
). The function
returns whether or not this conversion was successful. If the function fails,
val
is set to 0.