1#ifndef DBE_CONVERSION_H_
2#define DBE_CONVERSION_H_
28template<
typename T>
inline std::string
valtostr ( T
const & value )
30 return std::to_string ( value );
40 std::ostringstream ss;
41 ss << std::boolalpha << s;
53template<typename T, typename std::enable_if<std::is_integral<T>::value,
int>::type = 0>
59 return std::to_string ( value );
63 std::ostringstream ss;
67 ss << std::hex << std::showbase << +((
typename std::make_unsigned<T>::type) value);
71 ss << std::oct << std::showbase << +((
typename std::make_unsigned<T>::type) value);
76 TLOG_DEBUG(1) <<
" This conversion should not happen for value " << ss.str() ;
92template<typename T, typename std::enable_if<std::is_floating_point<T>::value,
int>::type = 0>
93inline std::string
valtostr ( T
const & value,
97 return std::to_string(value);
101inline std::string
valtostr ( std::string
const & value,
111T
to ( QStringList
const & DataList )
113 Q_UNUSED ( DataList )
123 Q_UNUSED ( DataList )
130T
to ( std::vector<std::string>
const & x )
139template<> QStringList
to ( std::vector<std::string>
const & DataList );
144template<> std::string
to<std::string> ( QStringList
const & DataList );
146 QStringList
const & DataList );
151template<> u_int8_t
to<u_int8_t> ( QStringList
const & DataList,
155template<> int8_t
to<int8_t> ( QStringList
const & DataList,
159template<> u_int16_t
to<u_int16_t> ( QStringList
const & DataList,
163template<> int16_t
to<int16_t> ( QStringList
const & DataList,
167template<> u_int32_t
to<u_int32_t> ( QStringList
const & DataList,
171template<> int32_t
to<int32_t> ( QStringList
const & DataList,
175template<> u_int64_t
to<u_int64_t> ( QStringList
const & DataList,
179template<> int64_t
to<int64_t> ( QStringList
const & DataList,
183template<>
float to<float> ( QStringList
const & DataList,
187template<>
double to<double> ( QStringList
const & DataList,
#define TLOG_DEBUG(lvl,...)
int8_t to< int8_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
std::string valtostr(T const &value)
u_int64_t to< u_int64_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
int16_t to< int16_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int8_t to< u_int8_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
std::string valtostr< bool >(bool const &s)
int64_t to< int64_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
T to(QStringList const &DataList)
std::string to< std::string >(QStringList const &DataList)
int32_t to< int32_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
std::string valtostr< std::string >(std::string const &x)
u_int32_t to< u_int32_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
double to< double >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int16_t to< u_int16_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
float to< float >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
bool to< bool >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)