#include <string>
#include <typeinfo>
#include "rutz/time.h"
Go to the source code of this file.
Classes | |
class | conversion_error |
Type of exception that is thrown from throwBadConversion. More... | |
Functions | |
Basic type string conversion functions | |
std::string | convertToString (const int &val) |
int -> string via stringstream | |
void | convertFromString (const std::string &str, int &val) |
string -> int via stringstream | |
std::string | convertToString (const long int &val) |
long int -> string via stringstream | |
void | convertFromString (const std::string &str, long int &val) |
string -> long int via stringstream | |
std::string | convertToString (const long long int &val) |
long long int -> string via stringstream | |
void | convertFromString (const std::string &str, long long int &val) |
string -> long long int via stringstream | |
std::string | convertToString (const short int &val) |
short int -> string via stringstream | |
void | convertFromString (const std::string &str, short int &val) |
string -> short int via stringstream | |
std::string | convertToString (const unsigned int &val) |
unsigned int -> string via stringstream | |
void | convertFromString (const std::string &str, unsigned int &val) |
string -> unsigned int via stringstream | |
std::string | convertToString (const unsigned long int &val) |
unsigned long int -> string via stringstream | |
void | convertFromString (const std::string &str, unsigned long int &val) |
string -> unsigned long int via stringstream | |
std::string | convertToString (const unsigned long long int &val) |
unsigned long long int -> string via stringstream | |
void | convertFromString (const std::string &str, unsigned long long int &val) |
string -> unsigned long long int via stringstream | |
std::string | convertToString (const unsigned short int &val) |
unsigned short int -> string via stringstream | |
void | convertFromString (const std::string &str, unsigned short int &val) |
string -> unsigned short int via stringstream | |
std::string | convertToString (const unsigned char &val) |
unsigned char -> string via stringstream | |
void | convertFromString (const std::string &str, unsigned char &val) |
string -> unsigned char via stringstream | |
std::string | convertToString (const float &val) |
float -> string via stringstream | |
void | convertFromString (const std::string &str, float &val) |
string -> float via stringstream | |
std::string | convertToString (const double &val) |
double -> string via stringstream | |
void | convertFromString (const std::string &str, double &val) |
string -> double stringstream | |
std::string | convertToString (const std::string &val) |
std::string overload | |
void | convertFromString (const std::string &str, std::string &val) |
std::string overload | |
std::string | convertToString (const bool &val) |
bool overload: format is "true|false" | |
void | convertFromString (const std::string &str, bool &val) |
bool overload | |
Overloaded implementations of string conversion functions | |
std::string | convertToString (const in_addr &val) |
in_addr overload: format is "<int>.<int>.<int>.<int>" | |
void | convertFromString (const std::string &str, in_addr &val) |
in_addr overload: format is "<int>.<int>.<int>.<int>" | |
std::string | convertToString (const rutz::time &val) |
rutz::time overload: format is "<h>:<m>:<s>.<ms>" | |
void | convertFromString (const std::string &str, rutz::time &val) |
rutz::time overload: format is "<h>:<m>:<s>.<ms>" | |
Easier-syntax functions to convert to/from string | |
template<class T > | |
std::string | toStr (const T &val) |
converts val into a string and returns the string | |
template<class T > | |
T | fromStr (const std::string &str) |
converts str into a T value and returns the T value |
Convert to and from std::string
Definition in file StringConversions.H.