USRP Hardware Driver and USRP Manual Version: 20250718.0.git40403b7c.fc43
UHD and USRP Manual
Loading...
Searching...
No Matches
uhd::cast Namespace Reference

Functions

template<typename T>
hexstr_cast (const std::string &in)
 Convert a hexadecimal string into a value.
template<typename T>
fromstr_cast (const std::string &in)
template<typename data_t>
data_t from_str (const std::string &)
 Generic cast-from-string function.
template<>
UHD_API bool from_str (const std::string &val)
 Specialization of uhd::cast::from_str() for Boolean values.
template<>
UHD_API double from_str (const std::string &val)
 Specialization of uhd::cast::from_str() for double-precision values.
template<>
UHD_API int from_str (const std::string &val)
 Specialization of uhd::cast::from_str() for integer values.
template<>
UHD_API size_t from_str (const std::string &val)
 Specialization of uhd::cast::from_str() for size_t values.
template<>
UHD_API std::string from_str (const std::string &val)
 Specialization of uhd::cast::from_str() for strings.
UHD_API std::string to_ordinal_string (int val)
 Create an ordinal string from a number.

Function Documentation

◆ from_str() [1/6]

template<typename data_t>
data_t uhd::cast::from_str ( const std::string & )

Generic cast-from-string function.

◆ from_str() [2/6]

template<>
UHD_API bool uhd::cast::from_str ( const std::string & val)

Specialization of uhd::cast::from_str() for Boolean values.

◆ from_str() [3/6]

template<>
UHD_API double uhd::cast::from_str ( const std::string & val)

Specialization of uhd::cast::from_str() for double-precision values.

◆ from_str() [4/6]

template<>
UHD_API int uhd::cast::from_str ( const std::string & val)

Specialization of uhd::cast::from_str() for integer values.

◆ from_str() [5/6]

template<>
UHD_API size_t uhd::cast::from_str ( const std::string & val)

Specialization of uhd::cast::from_str() for size_t values.

◆ from_str() [6/6]

template<>
UHD_API std::string uhd::cast::from_str ( const std::string & val)

Specialization of uhd::cast::from_str() for strings.

◆ fromstr_cast()

template<typename T>
T uhd::cast::fromstr_cast ( const std::string & in)
inline

Convert hexadecimal, decimal, octal or other strings that support the >> operator into a value depending on the prefix.

◆ hexstr_cast()

template<typename T>
T uhd::cast::hexstr_cast ( const std::string & in)
inline

Convert a hexadecimal string into a value.

◆ to_ordinal_string()

UHD_API std::string uhd::cast::to_ordinal_string ( int val)

Create an ordinal string from a number.