| 334 | using value_type = typename ARROW_TYPE::c_type; |
| 335 | |
| 336 | bool Convert(const ARROW_TYPE&, const char* s, size_t length, value_type* out) { |
| 337 | if (ARROW_PREDICT_FALSE(length == 0)) { |
| 338 | return false; |
| 339 | } |
| 340 | // If it starts with 0x then its hex |
| 341 | if (length > 2 && s[0] == '0' && ((s[1] == 'x') || (s[1] == 'X'))) { |
| 342 | length -= 2; |
| 343 | s += 2; |
| 344 | |
| 345 | return ARROW_PREDICT_TRUE(ParseHex(s, length, out)); |
| 346 | } |
| 347 | // Skip leading zeros |
| 348 | while (length > 0 && *s == '0') { |
| 349 | length--; |
| 350 | s++; |
| 351 | } |
| 352 | return ParseUnsigned(s, length, out); |
| 353 | } |
| 354 | }; |
| 355 | |
| 356 | template <> |
nothing calls this directly
no test coverage detected