comparison modules/javafx.web/src/main/native/Source/ThirdParty/icu/source/common/bmpset.h @ 11038:20a8447c71c6

8207159: Update ICU to version 62.1 Reviewed-by: mbilla, kcr, ghb
author arajkumar
date Fri, 24 Aug 2018 15:06:40 +0530
parents fee4ef5c87df
children
comparison
equal deleted inserted replaced
0:b84262bca39c 1:9194f2644bab
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
1 /* 3 /*
2 ****************************************************************************** 4 ******************************************************************************
3 * 5 *
4 * Copyright (C) 2007, International Business Machines 6 * Copyright (C) 2007, International Business Machines
5 * Corporation and others. All Rights Reserved. 7 * Corporation and others. All Rights Reserved.
6 * 8 *
7 ****************************************************************************** 9 ******************************************************************************
8 * file name: bmpset.h 10 * file name: bmpset.h
9 * encoding: US-ASCII 11 * encoding: UTF-8
10 * tab size: 8 (not used) 12 * tab size: 8 (not used)
11 * indentation:4 13 * indentation:4
12 * 14 *
13 * created on: 2007jan29 15 * created on: 2007jan29
14 * created by: Markus W. Scherer 16 * created by: Markus W. Scherer
24 26
25 /* 27 /*
26 * Helper class for frozen UnicodeSets, implements contains() and span() 28 * Helper class for frozen UnicodeSets, implements contains() and span()
27 * optimized for BMP code points. Structured to be UTF-8-friendly. 29 * optimized for BMP code points. Structured to be UTF-8-friendly.
28 * 30 *
29 * ASCII: Look up bytes. 31 * Latin-1: Look up bytes.
30 * 2-byte characters: Bits organized vertically. 32 * 2-byte characters: Bits organized vertically.
31 * 3-byte characters: Use zero/one/mixed data per 64-block in U+0000..U+FFFF, 33 * 3-byte characters: Use zero/one/mixed data per 64-block in U+0000..U+FFFF,
32 * with mixed for illegal ranges. 34 * with mixed for illegal ranges.
33 * Supplementary characters: Call contains() on the parent set. 35 * Supplementary characters: Binary search over
36 * the supplementary part of the parent set's inversion list.
34 */ 37 */
35 class BMPSet : public UMemory { 38 class BMPSet : public UMemory {
36 public: 39 public:
37 BMPSet(const int32_t *parentList, int32_t parentListLength); 40 BMPSet(const int32_t *parentList, int32_t parentListLength);
38 BMPSet(const BMPSet &otherBMPSet, const int32_t *newParentList, int32_t newParentListLength); 41 BMPSet(const BMPSet &otherBMPSet, const int32_t *newParentList, int32_t newParentListLength);
92 int32_t findCodePoint(UChar32 c, int32_t lo, int32_t hi) const; 95 int32_t findCodePoint(UChar32 c, int32_t lo, int32_t hi) const;
93 96
94 inline UBool containsSlow(UChar32 c, int32_t lo, int32_t hi) const; 97 inline UBool containsSlow(UChar32 c, int32_t lo, int32_t hi) const;
95 98
96 /* 99 /*
97 * One byte per ASCII character, or trail byte in lead position. 100 * One byte 0 or 1 per Latin-1 character.
98 * 0 or 1 for ASCII characters.
99 * The value for trail bytes is the result of contains(FFFD)
100 * for faster validity checking at runtime.
101 */ 101 */
102 UBool asciiBytes[0xc0]; 102 UBool latin1Contains[0x100];
103
104 /* TRUE if contains(U+FFFD). */
105 UBool containsFFFD;
103 106
104 /* 107 /*
105 * One bit per code point from U+0000..U+07FF. 108 * One bit per code point from U+0000..U+07FF.
106 * The bits are organized vertically; consecutive code points 109 * The bits are organized vertically; consecutive code points
107 * correspond to the same bit positions in consecutive table words. 110 * correspond to the same bit positions in consecutive table words.