| 769 | } |
| 770 | |
| 771 | size_t Next(IterType what) override |
| 772 | { |
| 773 | const auto end = this->string.end(); |
| 774 | /* Already at the end? */ |
| 775 | if (this->cur_pos >= end) return END; |
| 776 | |
| 777 | switch (what) { |
| 778 | case ITER_CHARACTER: |
| 779 | ++this->cur_pos; |
| 780 | return this->cur_pos.GetByteOffset(); |
| 781 | |
| 782 | case ITER_WORD: |
| 783 | /* Consume current word. */ |
| 784 | while (this->cur_pos != end && !IsWhitespace(*this->cur_pos)) { |
| 785 | ++this->cur_pos; |
| 786 | } |
| 787 | /* Consume whitespace to the next word. */ |
| 788 | while (this->cur_pos != end && IsWhitespace(*this->cur_pos)) { |
| 789 | ++this->cur_pos; |
| 790 | } |
| 791 | return this->cur_pos.GetByteOffset(); |
| 792 | |
| 793 | default: |
| 794 | NOT_REACHED(); |
| 795 | } |
| 796 | |
| 797 | return END; |
| 798 | } |
| 799 | |
| 800 | size_t Prev(IterType what) override |
| 801 | { |
nothing calls this directly
no test coverage detected