OLD | NEW |
(Empty) | |
| 1 From c795f7766bd4f650a2396c834bc2a07768781ae8 Mon Sep 17 00:00:00 2001 |
| 2 From: Igor Oliveira <igor.o@sisa.samsung.com> |
| 3 Date: Tue, 17 Sep 2013 14:43:07 -0700 |
| 4 Subject: [PATCH] The CL https://codereview.chromium.org/23618052/ depends of |
| 5 an API that will be added by libicu 5.2, |
| 6 BreakIterator::getRuleStatus. This patch is just a copy and |
| 7 paste of the libicu 5.2 API into chromium libicu. |
| 8 |
| 9 --- |
| 10 README.chromium | 3 +++ |
| 11 source/common/brkiter.cpp | 7 +++++++ |
| 12 source/common/unicode/brkiter.h | 15 +++++++++++++++ |
| 13 3 files changed, 25 insertions(+) |
| 14 |
| 15 diff --git a/README.chromium b/README.chromium |
| 16 index 76acd4b..eaf2e81 100644 |
| 17 --- a/README.chromium |
| 18 +++ b/README.chromium |
| 19 @@ -255,5 +255,8 @@ This directory contains the source code of ICU 4.6 for C/C++ |
| 20 - patches/csetdet.patch |
| 21 - upstream bug: http://bugs.icu-project.org/trac/ticket/10318 |
| 22 |
| 23 +26. Add BreakIterator::getRuleStatus |
| 24 + - Copy and paste BreakIterator::getRuleStatus API from icu 5.2 |
| 25 + |
| 26 |
| 27 |
| 28 diff --git a/source/common/brkiter.cpp b/source/common/brkiter.cpp |
| 29 index 26f7b6a..41da826 100644 |
| 30 --- a/source/common/brkiter.cpp |
| 31 +++ b/source/common/brkiter.cpp |
| 32 @@ -436,6 +436,13 @@ BreakIterator::getLocaleID(ULocDataLocaleType type, UErrorC
ode& status) const { |
| 33 return locBased.getLocaleID(type, status); |
| 34 } |
| 35 |
| 36 +// This implementation of getRuleStatus is a do-nothing stub, here to |
| 37 +// provide a default implementation for any derived BreakIterator classes that |
| 38 +// do not implement it themselves. |
| 39 +int32_t BreakIterator::getRuleStatus() const { |
| 40 + return 0; |
| 41 +} |
| 42 + |
| 43 U_NAMESPACE_END |
| 44 |
| 45 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ |
| 46 diff --git a/source/common/unicode/brkiter.h b/source/common/unicode/brkiter.h |
| 47 index bdd3cc7..1800336 100644 |
| 48 --- a/source/common/unicode/brkiter.h |
| 49 +++ b/source/common/unicode/brkiter.h |
| 50 @@ -284,6 +284,21 @@ public: |
| 51 virtual int32_t next(int32_t n) = 0; |
| 52 |
| 53 /** |
| 54 + * For RuleBasedBreakIterators, return the status tag from the |
| 55 + * break rule that determined the most recently |
| 56 + * returned break position. |
| 57 + * <p> |
| 58 + * For break iterator types that do not support a rule status, |
| 59 + * a default value of 0 is returned. |
| 60 + * <p> |
| 61 + * @return the status from the break rule that determined the most recently |
| 62 + * returned break position. |
| 63 + * @see RuleBaseBreakIterator::getRuleStatus() |
| 64 + * @see UWordBreak |
| 65 + */ |
| 66 + virtual int32_t getRuleStatus() const; |
| 67 + |
| 68 + /** |
| 69 * Create BreakIterator for word-breaks using the given locale. |
| 70 * Returns an instance of a BreakIterator implementing word breaks. |
| 71 * WordBreak is useful for word selection (ex. double click) |
| 72 -- |
| 73 1.7.12.4 (Apple Git-37) |
| 74 |
OLD | NEW |