| 39 | template<> template<> BasicStringView<const char>::BasicStringView(const String& string) noexcept : BasicStringView{string.data(), string.size(), string.viewFlags()} {} |
| 40 | |
| 41 | template<class T> Array<BasicStringView<T>> BasicStringView<T>::split(const char delimiter) const { |
| 42 | Array<BasicStringView<T>> parts; |
| 43 | T* const end = this->end(); |
| 44 | T* oldpos = _data; |
| 45 | T* pos; |
| 46 | while (oldpos < end && (pos = static_cast<T*>(std::memchr(oldpos, delimiter, end - oldpos)))) { |
| 47 | arrayAppend(parts, slice(oldpos, pos)); |
| 48 | oldpos = pos + 1; |
| 49 | } |
| 50 | |
| 51 | if (!empty()) |
| 52 | arrayAppend(parts, suffix(oldpos)); |
| 53 | |
| 54 | return parts; |
| 55 | } |
| 56 | |
| 57 | template<class T> Array<BasicStringView<T>> BasicStringView<T>::splitWithoutEmptyParts(const char delimiter) const { |
| 58 | Array<BasicStringView<T>> parts; |
nothing calls this directly
no test coverage detected