CBMC
|
Go to the source code of this file.
Functions | |
unsigned | safe_string2unsigned (const std::string &str, int base) |
std::size_t | safe_string2size_t (const std::string &str, int base) |
int | unsafe_string2int (const std::string &str, int base) |
unsigned | unsafe_string2unsigned (const std::string &str, int base) |
std::size_t | unsafe_string2size_t (const std::string &str, int base) |
signed long long int | unsafe_string2signedlonglong (const std::string &str, int base) |
unsigned long long int | unsafe_string2unsignedlonglong (const std::string &str, int base) |
std::optional< int > | string2optional_int (const std::string &str, int base) |
Convert string to integer as per stoi, but return nullopt when stoi would throw. More... | |
std::optional< unsigned > | string2optional_unsigned (const std::string &str, int base) |
Convert string to unsigned similar to the stoul or stoull functions, return nullopt when the conversion fails. More... | |
std::optional< std::size_t > | string2optional_size_t (const std::string &str, int base) |
Convert string to size_t similar to the stoul or stoull functions, return nullopt when the conversion fails. More... | |
std::size_t safe_string2size_t | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 23 of file string2int.cpp.
unsigned safe_string2unsigned | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 16 of file string2int.cpp.
std::optional<int> string2optional_int | ( | const std::string & | str, |
int | base | ||
) |
Convert string to integer as per stoi, but return nullopt when stoi would throw.
Definition at line 59 of file string2int.cpp.
std::optional<std::size_t> string2optional_size_t | ( | const std::string & | str, |
int | base = 10 |
||
) |
Convert string to size_t similar to the stoul or stoull functions, return nullopt when the conversion fails.
Note: Unlike stoul or stoull negative inputs are disallowed
Definition at line 71 of file string2int.cpp.
std::optional<unsigned> string2optional_unsigned | ( | const std::string & | str, |
int | base = 10 |
||
) |
Convert string to unsigned similar to the stoul or stoull functions, return nullopt when the conversion fails.
Note: Unlike stoul or stoull negative inputs are disallowed
Definition at line 65 of file string2int.cpp.
int unsafe_string2int | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 30 of file string2int.cpp.
signed long long int unsafe_string2signedlonglong | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 45 of file string2int.cpp.
std::size_t unsafe_string2size_t | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 40 of file string2int.cpp.
unsigned unsafe_string2unsigned | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 35 of file string2int.cpp.
unsigned long long int unsafe_string2unsignedlonglong | ( | const std::string & | str, |
int | base | ||
) |
Definition at line 52 of file string2int.cpp.