Namespaces
string_conv.h File Reference

Various string conversion functions. More...

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <o2scl/misc.h>

Go to the source code of this file.

Namespaces

 o2scl
 The main O2scl namespace.
 

Functions

Functions in string_conv.h
std::string o2scl::ptos (void *p)
 Convert a pointer to a string. More...
 
std::string o2scl::itos (int x)
 Convert an integer to a string.
 
std::string o2scl::szttos (size_t x)
 Convert a size_t to a string.
 
std::string o2scl::btos (bool b)
 Convert a boolean value to a string. More...
 
std::string o2scl::dtos (double x, int prec=6, bool auto_prec=false)
 Convert a double to a string. More...
 
size_t o2scl::size_of_exponent (double x)
 Returns the number of characters required to display the exponent of x in scientific mode. More...
 
std::string o2scl::dtos (double x, std::ostream &format)
 Convert a double to a string using a specified format.
 
int o2scl::stoi (std::string s, bool err_on_fail=true)
 Convert a string to an integer. More...
 
size_t o2scl::stoszt (std::string s, bool err_on_fail=true)
 Convert a string to a size_t. More...
 
bool o2scl::stob (std::string s, bool err_on_fail=true)
 Convert a string to a boolean value. More...
 
double o2scl::stod (std::string s, bool err_on_fail=true)
 Convert a string to a double. More...
 
bool o2scl::has_minus_sign (double *x)
 Find out if the number pointed to by x has a minus sign. More...
 
bool o2scl::is_number (std::string s)
 Return true if the string s is likely a integral or floating point number. More...
 
double o2scl::function_to_double (std::string s, bool err_on_fail=true)
 Convert a formula to a double. More...
 
void o2scl::split_string (std::string str, std::vector< std::string > &sv)
 Split a string into words using whitespace for delimiters and (partially) respecting quotes. More...
 
void o2scl::rewrap (std::string str, std::vector< std::string > &sv, size_t ncol=79)
 Rewrap a string into a single column, avoiding strings less than a particular number of characters.
 

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).