Checks if a character 'c' is a valid digit for the given base. Handles C++ digit separators (') within the main logic, not here.
| 164 | // Checks if a character 'c' is a valid digit for the given base. |
| 165 | // Handles C++ digit separators (') within the main logic, not here. |
| 166 | inline bool isValidDigitChar( char c, int base ) { |
| 167 | switch ( base ) { |
| 168 | case 2: |
| 169 | return isBinaryDigit( c ); |
| 170 | case 8: |
| 171 | return isOctalDigit( c ); |
| 172 | case 10: |
| 173 | return std::isdigit( c ); |
| 174 | case 16: |
| 175 | return std::isxdigit( c ); |
| 176 | default: |
| 177 | return false; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | /* |
| 182 | consumeDigitsWithSep |
no test coverage detected