| 9630 | } |
| 9631 | |
| 9632 | auto StringRef::numberOfCharacters() const noexcept -> size_type { |
| 9633 | size_type noChars = m_size; |
| 9634 | // Make adjustments for uft encodings |
| 9635 | for (size_type i = 0; i < m_size; ++i) { |
| 9636 | char c = m_start[i]; |
| 9637 | if ((c & byte_2_lead) == byte_2_lead) { |
| 9638 | noChars--; |
| 9639 | if ((c & byte_3_lead) == byte_3_lead) |
| 9640 | noChars--; |
| 9641 | if ((c & byte_4_lead) == byte_4_lead) |
| 9642 | noChars--; |
| 9643 | } |
| 9644 | } |
| 9645 | return noChars; |
| 9646 | } |
| 9647 | |
| 9648 | auto operator+(StringRef const &lhs, StringRef const &rhs) -> std::string { |
| 9649 | std::string str; |