KSS Utility
C++ general utilities
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
convert.hpp File Reference

Convert strings to other types. More...

#include <cerrno>
#include <chrono>
#include <iostream>
#include <stdexcept>
#include <sstream>
#include <string>
#include <system_error>
#include <typeinfo>
#include "rtti.hpp"

Go to the source code of this file.

Namespaces

 kss
 All Klassen Software Solutions libraries begin with this namespace.
 
 kss::util
 General utility methods that don't fit into any of the other categories.
 
 kss::util::strings
 Items related to string handling.
 

Functions

template<class T >
kss::util::strings::convert (const std::string &s, const T &=T())
 
template<>
std::string kss::util::strings::convert (const std::string &s, const std::string &)
 
template<>
float kss::util::strings::convert (const std::string &s, const float &)
 
template<>
double kss::util::strings::convert (const std::string &s, const double &)
 
template<>
long double kss::util::strings::convert (const std::string &s, const long double &)
 
template<>
int kss::util::strings::convert (const std::string &s, const int &)
 
template<>
long kss::util::strings::convert (const std::string &s, const long &)
 
template<>
long long kss::util::strings::convert (const std::string &s, const long long &)
 
template<>
unsigned kss::util::strings::convert (const std::string &s, const unsigned &)
 
template<>
unsigned long kss::util::strings::convert (const std::string &s, const unsigned long &)
 
template<>
unsigned long long kss::util::strings::convert (const std::string &s, const unsigned long long &)
 
template<>
std::chrono::hours kss::util::strings::convert (const std::string &s, const std::chrono::hours &)
 
template<>
std::chrono::minutes kss::util::strings::convert (const std::string &s, const std::chrono::minutes &)
 
template<>
std::chrono::seconds kss::util::strings::convert (const std::string &s, const std::chrono::seconds &)
 
template<>
std::chrono::milliseconds kss::util::strings::convert (const std::string &s, const std::chrono::milliseconds &)
 
template<>
std::chrono::microseconds kss::util::strings::convert (const std::string &s, const std::chrono::microseconds &)
 
template<>
std::chrono::nanoseconds kss::util::strings::convert (const std::string &s, const std::chrono::nanoseconds &)
 
template<>
std::chrono::time_point
< std::chrono::system_clock,
std::chrono::hours > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::system_clock, std::chrono::hours > &)
 
template<>
std::chrono::time_point
< std::chrono::system_clock,
std::chrono::minutes > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::system_clock, std::chrono::minutes > &)
 
template<>
std::chrono::time_point
< std::chrono::system_clock,
std::chrono::seconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::system_clock, std::chrono::seconds > &)
 
template<>
std::chrono::time_point
< std::chrono::system_clock,
std::chrono::milliseconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::system_clock, std::chrono::milliseconds > &)
 
template<>
std::chrono::time_point
< std::chrono::system_clock,
std::chrono::microseconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::system_clock, std::chrono::microseconds > &)
 
template<>
std::chrono::time_point
< std::chrono::system_clock,
std::chrono::nanoseconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > &)
 
template<>
std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::hours > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::steady_clock, std::chrono::hours > &)
 
template<>
std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::minutes > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::steady_clock, std::chrono::minutes > &)
 
template<>
std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::seconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::steady_clock, std::chrono::seconds > &)
 
template<>
std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::milliseconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::steady_clock, std::chrono::milliseconds > &)
 
template<>
std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::microseconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::steady_clock, std::chrono::microseconds > &)
 
template<>
std::chrono::time_point
< std::chrono::steady_clock,
std::chrono::nanoseconds > 
kss::util::strings::convert (const std::string &s, const std::chrono::time_point< std::chrono::steady_clock, std::chrono::nanoseconds > &)
 

Detailed Description

Convert strings to other types.

Definition in file convert.hpp.