MCPcopy Create free account
hub / github.com/apache/arrow / Convert

Method Convert

cpp/src/arrow/util/value_parsing.h:336–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
356template <>

Callers

nothing calls this directly

Calls 2

ParseHexFunction · 0.85
ParseUnsignedFunction · 0.85

Tested by

no test coverage detected