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..6e1c3b82ffbbd655536226d445a248382d9dfcb2 100644 |
| --- a/base/i18n/break_iterator.h |
| +++ b/base/i18n/break_iterator.h |
| @@ -71,6 +71,16 @@ class BASE_I18N_EXPORT BreakIterator { |
| RULE_BASED, |
| }; |
| + enum WordBreakStatus { |
| + // The end of text that the iterator recognizes as word characters. |
| + IS_WORD_BREAK, |
| + // Characters that the iterator can skip past, such as punctuation, |
| + // whitespace, and characters from another character set. |
| + IS_SKIPPABLE_WORD, |
| + // Only used if not in BREAK_WORD or RULE_BASED mode. |
|
please use gerrit instead
2015/08/07 20:53:10
What does returning this value mean? It's nice to
Julius
2015/08/10 16:06:37
Done.
|
| + 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. |
| @@ -101,6 +111,12 @@ class BASE_I18N_EXPORT BreakIterator { |
| // 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 returns IS_NOT_WORD_BREAK. Otherwise, the |
|
please use gerrit instead
2015/08/07 20:53:10
This "Otherwise" is confusing. Please be explicit
Julius
2015/08/10 16:06:37
Done.
|
| + // iterator found skippable characters and it 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. |