17#ifndef IOX_HOOFS_CXX_CONVERT_HPP
18#define IOX_HOOFS_CXX_CONVERT_HPP
20#include "iceoryx_hoofs/cxx/string.hpp"
21#include "iceoryx_hoofs/posix_wrapper/posix_call.hpp"
56 static constexpr int32_t STRTOULL_BASE = 10;
63 template <
typename Source>
64 static typename std::enable_if<!std::is_convertible<Source, std::string>::value, std::string>::type
72 template <
typename Source>
73 static typename std::enable_if<std::is_convertible<Source, std::string>::value, std::string>::type
81 template <
typename Destination>
82 static bool fromString(
const char* v, Destination& dest)
noexcept;
91 static bool stringIsNumberWithErrorMessage(
const char* v,
const NumberType type)
noexcept;
97#include "iceoryx_hoofs/internal/cxx/convert.inl"
Collection of static methods for conversion from and to string.
Definition convert.hpp:47
static bool stringIsNumber(const char *v, const NumberType type) noexcept
checks if a given string v is a number
static std::enable_if< std::is_convertible< Source, std::string >::value, std::string >::type toString(const Source &t) noexcept
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) noexcept
Converts every type which is either a pod (plain old data) type or is convertable to a string (this m...
static bool fromString(const char *v, Destination &dest) noexcept
Sets dest from a given string. If the conversion fails false is returned and the value of dest is und...
building block to easily create free function for logging in a library context
Definition lockfree_queue.hpp:29