15 #ifndef A_UTIL_UTIL_STRINGS_STRINGS_CONVERT_DECL_HEADER_INCLUDED
16 #define A_UTIL_UTIL_STRINGS_STRINGS_CONVERT_DECL_HEADER_INCLUDED
32 bool toBool(
const std::string& from,
bool& to);
42 bool toInt8(
const std::string& from, std::int8_t& to);
44 bool toInt16(
const std::string& from, std::int16_t& to);
46 bool toInt32(
const std::string& from, std::int32_t& to);
48 bool toInt64(
const std::string& from, std::int64_t& to);
50 bool toUInt8(
const std::string& from, std::uint8_t& to);
52 bool toUInt16(
const std::string& from, std::uint16_t& to);
54 bool toUInt32(
const std::string& from, std::uint32_t& to);
56 bool toUInt64(
const std::string& from, std::uint64_t& to);
58 bool toFloat(
const std::string& from,
float& to);
60 bool toDouble(
const std::string& from,
double& to);
63 bool toBool(
const char* from,
bool& to);
65 bool toInt8(
const char* from, std::int8_t& to);
67 bool toInt16(
const char* from, std::int16_t& to);
69 bool toInt32(
const char* from, std::int32_t& to);
71 bool toInt64(
const char* from, std::int64_t& to);
73 bool toUInt8(
const char* from, std::uint8_t& to);
75 bool toUInt16(
const char* from, std::uint16_t& to);
77 bool toUInt32(
const char* from, std::uint32_t& to);
79 bool toUInt64(
const char* from, std::uint64_t& to);
81 bool toFloat(
const char* from,
float& to);
92 bool toBool(
const std::string& from);
100 std::int8_t
toInt8(
const std::string& from);
102 std::int16_t
toInt16(
const std::string& from);
104 std::int32_t
toInt32(
const std::string& from);
106 std::int64_t
toInt64(
const std::string& from);
108 std::uint8_t
toUInt8(
const std::string& from);
156 static bool convert(
const char* from,
bool& to);
165 static bool convert(
const char* from, std::int8_t& to);
167 static bool convert(
const char* from, std::int16_t& to);
169 static bool convert(
const char* from, std::int32_t& to);
171 static bool convert(
const char* from, std::int64_t& to);
173 static bool convert(
const char* from, std::uint8_t& to);
175 static bool convert(
const char* from, std::uint16_t& to);
177 static bool convert(
const char* from, std::uint32_t& to);
179 static bool convert(
const char* from, std::uint64_t& to);
181 static bool convert(
const char* from,
float& to);
183 static bool convert(
const char* from,
double& to);
195 template <
typename Numeric>
196 bool toNumeric(
const std::string& from, Numeric& to);
199 template <
typename Numeric>
200 bool toNumeric(
const char* from, Numeric& to);
209 template <
typename Numeric>
210 Numeric
toNumeric(
const std::string& from);
213 template <
typename Numeric>
bool toInt8(const std::string &from, std::int8_t &to)
Safely convert a string to a numeric value.
bool toNumeric(const char *from, Numeric &to)
Safely convert a string to a value of type Numeric in a generic manner.
bool toFloat(const std::string &from, float &to)
Safely convert a string to a numeric value.
bool toInt32(const std::string &from, std::int32_t &to)
Safely convert a string to a numeric value.
bool toUInt16(const std::string &from, std::uint16_t &to)
Safely convert a string to a numeric value.
bool toUInt32(const std::string &from, std::uint32_t &to)
Safely convert a string to a numeric value.
bool toInt16(const std::string &from, std::int16_t &to)
Safely convert a string to a numeric value.
bool toDouble(const std::string &from, double &to)
Safely convert a string to a numeric value.
bool toUInt8(const std::string &from, std::uint8_t &to)
Safely convert a string to a numeric value.
bool toInt64(const std::string &from, std::int64_t &to)
Safely convert a string to a numeric value.
bool toUInt64(const std::string &from, std::uint64_t &to)
Safely convert a string to a numeric value.
bool toBool(const std::string &from, bool &to)
Safely convert a string to a boolean value.
Serves as the root component, with common functionality documented in core functionality.
Private implementation for string conversion functions.
Safe convenience string-to-numeric conversion methods for generic programming.
static bool convert(const char *from, std::int8_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, double &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::uint64_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::uint32_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::int16_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::uint16_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::uint8_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, bool &to)
Safely convert a string to a boolean value.
static bool convert(const char *from, float &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::int32_t &to)
Safely convert a string to a numeric value.
static bool convert(const char *from, std::int64_t &to)
Safely convert a string to a numeric value.