* @brief Returns @c true if the given string is formed only by decimal digits. * * The empty string is considered to be composed only by digits. */
| 225 | * The empty string is considered to be composed only by digits. |
| 226 | */ |
| 227 | bool hasOnlyDecimalDigits(const std::string &str) { |
| 228 | return std::all_of(str.begin(), str.end(), |
| 229 | [](const unsigned char c) { return std::isdigit(c); }); |
| 230 | } |
| 231 | |
| 232 | /** |
| 233 | * @brief Returns @c true if the given string is formed only by hexadecimal |