OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Functions
openstudio::string_conversions Namespace Reference

Functions

template<typename DesiredType , typename InputType , typename DestinationType >
bool assign_if_valid (const InputType &input, DestinationType &dest)
 
template<typename DesiredType , typename InputType >
bool is_valid (const InputType &input)
 
std::string number (std::int32_t, int base=10)
 Converts a number into a string, replicating the behavior of QString::number. More...
 
std::string number (std::uint32_t, int base=10)
 
std::string number (std::int64_t, int base=10)
 
std::string number (std::uint64_t, int base=10)
 
std::string number (double, FloatFormat format=FloatFormat::general, int precision=6)
 
template<typename DesiredType , typename InputType >
DesiredType to (const InputType &inp)
 
template<typename DesiredType , typename InputType >
boost::optional< DesiredType > to_no_throw (const InputType &inp)
 

Function Documentation

template<typename DesiredType , typename InputType , typename DestinationType >
bool openstudio::string_conversions::assign_if_valid ( const InputType &  input,
DestinationType &  dest 
)
template<typename DesiredType , typename InputType >
bool openstudio::string_conversions::is_valid ( const InputType &  input)
std::string openstudio::string_conversions::number ( std::int32_t  ,
int  base = 10 
)

Converts a number into a string, replicating the behavior of QString::number.

This is necessary because QString does not respect the locale, and stringstring and std::string::to_string do respect the locale

std::string openstudio::string_conversions::number ( std::uint32_t  ,
int  base = 10 
)
std::string openstudio::string_conversions::number ( std::int64_t  ,
int  base = 10 
)
std::string openstudio::string_conversions::number ( std::uint64_t  ,
int  base = 10 
)
std::string openstudio::string_conversions::number ( double  ,
FloatFormat  format = FloatFormat::general,
int  precision = 6 
)
template<typename DesiredType , typename InputType >
DesiredType openstudio::string_conversions::to ( const InputType &  inp)
template<typename DesiredType , typename InputType >
boost::optional<DesiredType> openstudio::string_conversions::to_no_throw ( const InputType &  inp)