16 #ifndef IOX_UTILS_CXX_CONVERT_HPP
17 #define IOX_UTILS_CXX_CONVERT_HPP
19 #include "iceoryx_utils/cxx/smart_c.hpp"
53 static constexpr int32_t STRTOULL_BASE = 10;
60 template <
typename Source>
61 static typename std::enable_if<!std::is_convertible<Source, std::string>::value, std::string>::type
69 template <
typename Source>
70 static typename std::enable_if<std::is_convertible<Source, std::string>::value, std::string>::type
78 template <
typename Destination>
79 static bool fromString(
const char* v, Destination& dest);
88 static bool stringIsNumberWithErrorMessage(
const char* v,
const NumberType type);
94 #include "iceoryx_utils/internal/cxx/convert.inl"
Collection of static methods for conversion from and to string.
Definition: convert.hpp:44
static bool fromString(const char *v, Destination &dest)
Sets dest from a given string. If the conversion fails false is returned and the value of dest is und...
static std::enable_if< std::is_convertible< Source, std::string >::value, std::string >::type toString(const Source &t)
Converts every type which is either a pod (plain old data) type or is convertable to a string (this m...
static std::enable_if<!std::is_convertible< Source, std::string >::value, std::string >::type toString(const Source &t)
Converts every type which is either a pod (plain old data) type or is convertable to a string (this m...
Definition: convert.inl:25
static bool stringIsNumber(const char *v, const NumberType type)
checks if a given string v is a number
Definition: convert.inl:73
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28