| 171 | } |
| 172 | |
| 173 | bool ParseAndValidate(const char* token, int token_len, int min, int max, |
| 174 | int* result) { |
| 175 | DCHECK(token != nullptr); |
| 176 | DCHECK(token_len > 0); |
| 177 | DCHECK(result != nullptr); |
| 178 | StringParser::ParseResult status; |
| 179 | *result = StringParser::StringToInt<int>(token, token_len, &status); |
| 180 | if (UNLIKELY(StringParser::PARSE_SUCCESS != status)) return false; |
| 181 | if (UNLIKELY(*result < min || *result > max)) return false; |
| 182 | return true; |
| 183 | } |
| 184 | |
| 185 | bool ParseFractionToken(const char* token, int token_len, |
| 186 | DateTimeParseResult* result) { |
no outgoing calls
no test coverage detected