Index: Source/platform/text/TextBreakIterator.h |
diff --git a/Source/platform/text/TextBreakIterator.h b/Source/platform/text/TextBreakIterator.h |
index 72187c6c3cc7f1c2deba1dfcfb85bbf31b531645..b595ab5da98030f0c0af295d3bd272044eae37af 100644 |
--- a/Source/platform/text/TextBreakIterator.h |
+++ b/Source/platform/text/TextBreakIterator.h |
@@ -30,6 +30,15 @@ |
namespace blink { |
+struct ClusterData { |
+ ClusterData(unsigned numGraphemes, unsigned numCharacters) |
+ : graphemes(numGraphemes) |
+ , characters(numCharacters) |
+ { } |
+ unsigned graphemes; |
+ unsigned characters; |
+}; |
+ |
typedef icu::BreakIterator TextBreakIterator; |
// Note: The returned iterator is good only until you get another iterator, with the exception of acquireLineBreakIterator. |
@@ -255,6 +264,8 @@ private: |
// of a non-combining character and following combining characters is |
// counted as 1 grapheme cluster. |
PLATFORM_EXPORT unsigned numGraphemeClusters(const String&); |
+// Counts the number of graphemes and characters. |
+PLATFORM_EXPORT ClusterData countCharactersAndGraphemesInCluster(const UChar* normalizedBuffer, unsigned normalizedBufferLength, uint16_t startIndex, uint16_t endIndex); |
} |