40 #include <unicode/utypes.h>
41 #include <unicode/uscript.h>
56 std::fill_n(ma00, 0xff, -1);
57 std::fill_n(ma20, 0x7f, -1);
58 std::fill_n(ma30, 0x7f, -1);
105 int32_t getPairIndex(UChar32 ch)
const
109 if (ch >= 0x2000 && ch < 0x207f)
110 return ma20[ch - 0x2000];
111 if (ch >= 0x3000 && ch < 0x307f)
112 return ma30[ch - 0x3000];
121 UScriptCode getScript(UChar32 ch, UErrorCode* status)
123 UScriptCode
script = uscript_getScript(ch, status);
124 if (U_FAILURE(*status))
126 if (script == USCRIPT_KATAKANA || script == USCRIPT_KATAKANA_OR_HIRAGANA)
127 return USCRIPT_HIRAGANA;
142 return scriptOne <= USCRIPT_INHERITED || scriptTwo <= USCRIPT_INHERITED || scriptOne == scriptTwo;
148 UErrorCode error = U_ZERO_ERROR;
163 if (high >= 0xD800 && high <= 0xDBFF &&
scriptEnd < charLimit - 1)
169 if (low >= 0xDC00 && low <= 0xDFFF) {
170 ch = (high - 0xD800) * 0x0400 + low - 0xDC00 + 0x10000;
175 UScriptCode
sc = getScript(ch, &error);
176 int32_t pairIndex = gPairIndices.getPairIndex(ch);
184 if (pairIndex >= 0) {
185 if ((pairIndex & 1) == 0) {
193 int32_t pi = pairIndex & ~1;
210 if (scriptCode <= USCRIPT_INHERITED && sc > USCRIPT_INHERITED) {
222 if (pairIndex >= 0 && (pairIndex & 1) != 0 &&
parenSP >= 0) {
std::vector< ParenStackEntry > parenStack
const PairIndices gPairIndices
static bool sameScript(int32_t scriptOne, int32_t scriptTwo)
static const char fgClassID
The address of this static class variable serves as this class's ID for ICU "poor man's RTTI"...