#ifndef BASE_INCLUDE_STRING_STRING_NUMBER_CONVERT_H_
#define BASE_INCLUDE_STRING_STRING_NUMBER_CONVERT_H_
#include <cstdint>
#include <string>
#include "base/include/base_export.h"
namespace lynx {
namespace base {
BASE_EXPORT bool StringToInt(const std::string& input, int64_t& output,
uint8_t base = 10);
BASE_EXPORT bool StringToInt(const std::string& input, int* output,
uint8_t base = 10);
BASE_EXPORT bool StringToUInt64(const std::string& input, uint64_t& output,
uint8_t base = 10);
* Convert from string to double.
* @param input, the string to be converted.
* @param ouput, output the conversion result, will remain as it was if string
* is not a valid number.
* @param error_on_nan_or_inf, treat inf or nan as invalid value if set to true.
* @return if string is a valid double number.
*/
BASE_EXPORT bool StringToDouble(const std::string& input, double& output,
bool error_on_nan_or_inf = false);
BASE_EXPORT bool StringToFloat(const std::string& input, float& output,
bool error_on_nan_or_inf = false);
}
}
#endif