Chromium Code Reviews| Index: base/i18n/break_iterator.h |
| diff --git a/base/i18n/break_iterator.h b/base/i18n/break_iterator.h |
| index 19fdbe01cbdd84c52cc5c4e481bb296439660e77..0c0aa4e851cc3ab300f66da4cbf18f00e0803aad 100644 |
| --- a/base/i18n/break_iterator.h |
| +++ b/base/i18n/break_iterator.h |
| @@ -71,6 +71,8 @@ class BASE_I18N_EXPORT BreakIterator { |
| RULE_BASED, |
| }; |
| + enum WordBreakStatus { IS_WORD_BREAK, IS_SKIPPABLE_WORD, IS_NOT_WORD_BREAK }; |
| + |
| // Requires |str| to live as long as the BreakIterator does. |
| BreakIterator(const StringPiece16& str, BreakType break_type); |
| // Make a rule-based iterator. BreakType == RULE_BASED is implied. |
| @@ -95,12 +97,20 @@ class BASE_I18N_EXPORT BreakIterator { |
| // unless there is an error setting the text. |
| bool SetText(const base::char16* text, const size_t length); |
| + |
|
Matt Giuca
2015/08/06 00:32:15
nit: No extra blank line.
Julius
2015/08/06 20:43:54
Done.
|
| // Under BREAK_WORD mode, returns true if the break we just hit is the |
| // end of a word. (Otherwise, the break iterator just skipped over e.g. |
| // whitespace or punctuation.) Under BREAK_LINE and BREAK_NEWLINE modes, |
| // this distinction doesn't apply and it always returns false. |
| bool IsWord() const; |
| + // Under BREAK_WORD mode, returns IS_WORD_BREAK if the break we just hit is |
| + // the end of a word. Under BREAK_LINE and BREAK_NEWLINE modes, this |
| + // distinction doesn't apply and it always returns IS_NOT_WORD_BREAK. |
| + // Otherwise, the iterator just skipped over e.g. whitespace, punctuation, or |
| + // unknown characters and returns IS_SKIPPABLE_WORD. |
| + BreakIterator::WordBreakStatus IsWordBreak() const; |
| + |
| // Under BREAK_WORD mode, returns true if |position| is at the end of word or |
| // at the start of word. It always returns false under BREAK_LINE and |
| // BREAK_NEWLINE modes. |