Function cras::parseInt8(const std::string&)

Function Documentation

int8_t cras::parseInt8(const std::string &string)

Parse the given string to a 8-bit int.

Note

This function supports hexadecimal numbers starting with 0x/0X, binary numbers with 0b/0B, octal with 0 and ) decimal otherwise.

Parameters:

string[in] The string to parse.

Throws:

std::invalid_argument – If the string does not represent a 8-bit int value or if there are excess characters other than whitespace.

Returns:

The corresponding 8-bit int value.