A library for working with phylogenetic and population genetic data.
v0.32.0
convert.cpp File Reference
#include "genesis/utils/text/convert.hpp"
#include "genesis/utils/text/string.hpp"
#include <algorithm>
#include <cctype>
#include <limits>
#include <string>
#include <stdexcept>
#include <vector>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

bool convert_to_bool (std::string const &str)
 Convert a string to bool, return the result, and throw an exception when the conversion was not successful. More...
 
bool convert_to_bool (std::string const &str, bool &result)
 Convert a string to bool, store the result in result, and return whether the conversion as successful. More...
 
double convert_to_bool_double (std::string const &str)
 Convert a string to bool, but return it as a double, and throw an exception when the conversion was not successful. More...
 
bool convert_to_bool_double (std::string const &str, double &result)
 Convert a string to bool, but store the result as a double in result, and return whether the conversion as successful. More...
 
double convert_to_double (std::string const &str)
 Convert a string to double, return the result, and throw an exception when the conversion was not successful. More...
 
bool convert_to_double (std::string const &str, double &result)
 Convert a string to double, store the result in result, and return whether the conversion as successful. More...
 
template<typename T , class F >
bool convert_to_numeric_ (std::string const &str, T &result, T initial, F conversion)
 
long long convert_to_signed_integer (std::string const &str)
 Convert a string to signed integer, return the result, and throw an exception when the conversion was not successful. More...
 
bool convert_to_signed_integer (std::string const &str, long long &result)
 Convert a string to signed integer, store the result in result, and return whether the conversion as successful. More...
 
unsigned long long convert_to_unsigned_integer (std::string const &str)
 Convert a string to unsigned integer, return the result, and throw an exception when the conversion was not successful. More...
 
bool convert_to_unsigned_integer (std::string const &str, unsigned long long &result)
 Convert a string to unsigned integer, store the result in result, and return whether the conversion as successful. More...
 
bool is_convertible_to_bool (std::string const &str)
 Return whether a string can be converted to bool. More...
 
bool is_convertible_to_bool_double (std::string const &str)
 Return whether a string can be converted to bool (and stored as a double). More...
 
bool is_convertible_to_double (std::string const &str)
 Return whether a string can be converted to double. More...
 
bool is_convertible_to_signed_integer (std::string const &str)
 Return whether a string can be converted to signed integer. More...
 
bool is_convertible_to_unsigned_integer (std::string const &str)
 Return whether a string can be converted to unsigned integer. More...