| 537 | |
| 538 | template <class UnaryPredicate> |
| 539 | static 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). |
| 558 | static inline int64_t UTF8Length(const uint8_t* first, const uint8_t* last) { |
no test coverage detected