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

Function UTF8AllOf

cpp/src/arrow/util/utf8_internal.h:539–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537
538template <class UnaryPredicate>
539static inline bool UTF8AllOf(const uint8_t* first, const uint8_t* last, bool* result,
540 UnaryPredicate&& predicate) {
541 const uint8_t* i = first;
542 while (i < last) {
543 uint32_t codepoint = 0;
544 if (ARROW_PREDICT_FALSE(!UTF8Decode(&i, &codepoint))) {
545 return false;
546 }
547
548 if (!predicate(codepoint)) {
549 *result = false;
550 return true;
551 }
552 }
553 *result = true;
554 return true;
555}
556
557/// Count the number of codepoints in the given string (assuming it is valid UTF8).
558static inline int64_t UTF8Length(const uint8_t* first, const uint8_t* last) {

Callers 2

CallMethod · 0.85
CallMethod · 0.85

Calls 1

UTF8DecodeFunction · 0.85

Tested by

no test coverage detected