T Chusov::String::from_string | ( | const ucp_t * | pszValue, |
int | base = 10 |
||
) |
A set of templates providing an interface to convert an argument specifying a C or C++ string to a value of a specified type. This template is available (i.e. participates in overload resolution) when the type is integral.
T | is a type for the string value to convert to. The type T must be either constructible from pszValue directly or be one of the fundamental arithmetic types. Particularly this overload is chosen when T is integral. |
pszValue | A C-string containing the value to convert. |
base | A base in which the integral numeric value is expected in pszValue . |
The function performs a transformation of a Unicode string to an integral value of the type T
provided that the whole zero-terminated string pszValue
represents the value to return with respect to base
. If not all characters of pszValue
an be converted to the numeric value, the function fails and generates InvalidParameterException.
If the function is called with one argument and non-integral T
, Chusov::String::from_string(In_z const ucp_t* pszValue) "another overload" will be used from the conversion.
pszValue
is an empty string, or if not the entire pszValue
can be converted into the type T
, because of parsing errors or when the produced value goes out of valid range of supported values for T
. Chusov::Exceptions::InvalidParameterException | Parsing or range error occurred during the conversion to T . |