Dev Essential  1.6.3
Loading...
Searching...
No Matches
strings_convert_decl.h
Go to the documentation of this file.
1
14
15#ifndef A_UTIL_UTIL_STRINGS_STRINGS_CONVERT_DECL_HEADER_INCLUDED
16#define A_UTIL_UTIL_STRINGS_STRINGS_CONVERT_DECL_HEADER_INCLUDED
17
18#include <string>
19#include <cstdint>
20
21namespace a_util {
22namespace strings {
32bool toBool(const std::string& from, bool& to);
33
42bool toInt8(const std::string& from, std::int8_t& to);
44bool toInt16(const std::string& from, std::int16_t& to);
46bool toInt32(const std::string& from, std::int32_t& to);
48bool toInt64(const std::string& from, std::int64_t& to);
50bool toUInt8(const std::string& from, std::uint8_t& to);
52bool toUInt16(const std::string& from, std::uint16_t& to);
54bool toUInt32(const std::string& from, std::uint32_t& to);
56bool toUInt64(const std::string& from, std::uint64_t& to);
58bool toFloat(const std::string& from, float& to);
60bool toDouble(const std::string& from, double& to);
61
63bool toBool(const char* from, bool& to);
65bool toInt8(const char* from, std::int8_t& to);
67bool toInt16(const char* from, std::int16_t& to);
69bool toInt32(const char* from, std::int32_t& to);
71bool toInt64(const char* from, std::int64_t& to);
73bool toUInt8(const char* from, std::uint8_t& to);
75bool toUInt16(const char* from, std::uint16_t& to);
77bool toUInt32(const char* from, std::uint32_t& to);
79bool toUInt64(const char* from, std::uint64_t& to);
81bool toFloat(const char* from, float& to);
83bool toDouble(const char* from, double& to);
84
92bool toBool(const std::string& from);
93
100std::int8_t toInt8(const std::string& from);
102std::int16_t toInt16(const std::string& from);
104std::int32_t toInt32(const std::string& from);
106std::int64_t toInt64(const std::string& from);
108std::uint8_t toUInt8(const std::string& from);
110std::uint16_t toUInt16(const std::string& from);
112std::uint32_t toUInt32(const std::string& from);
114std::uint64_t toUInt64(const std::string& from);
116float toFloat(const std::string& from);
118double toDouble(const std::string& from);
119
121bool toBool(const char* from);
123std::int8_t toInt8(const char* from);
125std::int16_t toInt16(const char* from);
127std::int32_t toInt32(const char* from);
129std::int64_t toInt64(const char* from);
131std::uint8_t toUInt8(const char* from);
133std::uint16_t toUInt16(const char* from);
135std::uint32_t toUInt32(const char* from);
137std::uint64_t toUInt64(const char* from);
139float toFloat(const char* from);
141double toDouble(const char* from);
142
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);
184};
185
195template <typename Numeric>
196bool toNumeric(const std::string& from, Numeric& to);
197
199template <typename Numeric>
200bool toNumeric(const char* from, Numeric& to);
201
209template <typename Numeric>
210Numeric toNumeric(const std::string& from);
211
213template <typename Numeric>
214Numeric toNumeric(const char* from);
215
216} // namespace strings
217} // namespace a_util
218
222
223#endif // A_UTIL_UTIL_STRINGS_STRINGS_CONVERT_DECL_HEADER_INCLUDED
Serves as component for string handling and conversion functionality.
Definition strings.h:20
bool toInt8(const std::string &from, std::int8_t &to)
bool toFloat(const std::string &from, float &to)
bool toInt32(const std::string &from, std::int32_t &to)
bool toUInt16(const std::string &from, std::uint16_t &to)
bool toUInt32(const std::string &from, std::uint32_t &to)
bool toInt16(const std::string &from, std::int16_t &to)
bool toDouble(const std::string &from, double &to)
bool toUInt8(const std::string &from, std::uint8_t &to)
bool toInt64(const std::string &from, std::int64_t &to)
bool toNumeric(const char *from, Numeric &to)
Definition strings_convert_impl.h:23
bool toUInt64(const std::string &from, std::uint64_t &to)
bool toBool(const std::string &from, bool &to)
Serves as the root component, with common functionality documented in core functionality.
Definition base.h:24
Definition strings_convert_decl.h:146
static bool convert(const char *from, float &to)
static bool convert(const char *from, double &to)
static bool convert(const char *from, std::int64_t &to)
static bool convert(const char *from, std::int32_t &to)
static bool convert(const char *from, std::int8_t &to)
static bool convert(const char *from, bool &to)
static bool convert(const char *from, std::uint32_t &to)
static bool convert(const char *from, std::uint8_t &to)
static bool convert(const char *from, std::uint16_t &to)
static bool convert(const char *from, std::int16_t &to)
static bool convert(const char *from, std::uint64_t &to)