23 #ifndef O2SCL_STRING_CONV_H
24 #define O2SCL_STRING_CONV_H
36 #ifndef DOXYGEN_NO_O2NS
47 std::string
ptos(
void *p);
51 std::string
itos(
int x);
55 std::string
szttos(
size_t x);
65 std::string
btos(
bool b);
74 std::string
dtos(
double x,
int prec=6,
bool auto_prec=
false);
88 std::string
dtos(
double x, std::ostream &format);
103 int stoi(std::string s,
bool err_on_fail=
true);
111 size_t stoszt(std::string s,
bool err_on_fail=
true);
123 bool stob(std::string s,
bool err_on_fail=
true);
138 double stod(std::string s,
bool err_on_fail=
true);
173 void split_string(std::string str, std::vector<std::string> &sv);
176 #ifndef DOXYGEN_NO_O2NS
std::string btos(bool b)
Convert a boolean value to a string.
size_t size_of_exponent(double x)
Returns the number of characters required to display the exponent of x in scientific mode...
int stoi(std::string s, bool err_on_fail=true)
Convert a string to an integer.
bool stob(std::string s, bool err_on_fail=true)
Convert a string to a boolean value.
bool has_minus_sign(double *x)
Find out if the number pointed to by x has a minus sign.
std::string dtos(double x, int prec=6, bool auto_prec=false)
Convert a double to a string.
bool is_number(std::string s)
Return true if the string s is likely a integral or floating point number.
void split_string(std::string str, std::vector< std::string > &sv)
Split a string into words using whitespace for delimiters and (partially) respecting quotes...
std::string itos_nothrow(int x)
Convert an integer to a string (exception-free version)
size_t stoszt(std::string s, bool err_on_fail=true)
Convert a string to a size_t.
std::string ptos(void *p)
Convert a pointer to a string.
double stod(std::string s, bool err_on_fail=true)
Convert a string to a double.
std::string itos(int x)
Convert an integer to a string.
double function_to_double(std::string s, bool err_on_fail=true)
Convert a formula to a double.
std::string szttos(size_t x)
Convert a size_t to a string.