MCPcopy Create free account
hub / github.com/apache/impala / ParseAndValidate

Function ParseAndValidate

be/src/runtime/datetime-parser-common.cc:173–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173bool 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
185bool ParseFractionToken(const char* token, int token_len,
186 DateTimeParseResult* result) {

Callers 2

ParseDateTimeMethod · 0.85
ParseDateTimeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected