ifw-core  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions

Data conversion tools. More...

#include <typeinfo>
#include <iomanip>
#include <variant>
#include "ctd/defines/defines.hpp"
#include "ctd/string/string.hpp"

Go to the source code of this file.

Namespaces

 ctd
 
 ctd::conversion
 

Functions

template<typename TYPE >
std::string ctd::conversion::NbToStr (const TYPE number, const std::string &format="")
 Convert the given value to a string representation. More...
 
std::string ctd::conversion::DblToString (const double dbl_val, const std::string &prec_or_format="3")
 Convert a double value to its string representation, applying the given precision. More...
 
std::string ctd::conversion::BoolToString (const bool bool_val, const bool long_format=true)
 Convert a boolean value to a string (Short format: T/F; Long format: True/False). More...
 
bool ctd::conversion::Boolean (const std::string &value, const bool permissive=false)
 Interpret a string as a boolean (t/T/true/TRUE -> true; f/F/false/FALSE -> false). More...
 
template<typename TYPE >
void ctd::conversion::Convert (const std::string &value, ctd::defines::DataType data_type, std::variant< TYPE > &native_value)
 Convert a value represented as a string into its 'native type'. Data type given. More...
 
void ctd::conversion::Convert (const std::string &str_value, std::string &native_value)
 Handle case: Conversion of std::string to std::string. More...
 
template<typename TYPE >
void ctd::conversion::Convert (const std::string &str_value, TYPE &native_value)
 Convert a value represented as string into its 'native type'. Data type not given. More...
 

Detailed Description

Data conversion tools.