summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-02-12 13:01:16 -0800
committerKenny Root <kroot@google.com>2010-02-12 13:01:16 -0800
commit564bfc27f253694183f5972cdda6357c66bd7bbd (patch)
treeb9af3f503d7183a8f9f1cf5fe99fcf391eaa0c89 /libs
parent965e37ec88609c36a3c5461ece459a96abb6f7ca (diff)
downloadframeworks_base-564bfc27f253694183f5972cdda6357c66bd7bbd.zip
frameworks_base-564bfc27f253694183f5972cdda6357c66bd7bbd.tar.gz
frameworks_base-564bfc27f253694183f5972cdda6357c66bd7bbd.tar.bz2
Excise code from Unicode.cpp that was dead
Remove some utility functions for discovering character data that ICU probably took over a while ago. Change-Id: I97abe4de2f51eb2bf48679941258bc501184c3dc
Diffstat (limited to 'libs')
-rw-r--r--libs/utils/CharacterData.h41
-rw-r--r--libs/utils/Unicode.cpp61
2 files changed, 0 insertions, 102 deletions
diff --git a/libs/utils/CharacterData.h b/libs/utils/CharacterData.h
index e931d99..d9b7c56 100644
--- a/libs/utils/CharacterData.h
+++ b/libs/utils/CharacterData.h
@@ -615,32 +615,6 @@ namespace CharacterData {
{0, 0}
};
- // Array of uppercase differences
- static const short UCDIFF[] = {
- 0, -32, 743, 121, -1, -232, -300, 97,
- 163, 130, 56, -2, -79, -210, -206, -205,
- -202, -203, -207, -209, -211, -213, -214, -218,
- -217, -219, -83, 84, -38, -37, -31, -64,
- -63, -62, -57, -47, -54, -86, -80, 7,
- -96, -48, -59, 8, 74, 86, 100, 128,
- 112, 126, 9, -7205, -16, -26, -7264, -40
- };
-
- // Array of lowercase differences
- static const short LCDIFF[] = {
- 0, 32, 1, -199, -121, 210, 206, 205,
- 79, 202, 203, 207, 211, 209, 213, 214,
- 218, 217, 219, 2, -97, -56, -130, -163,
- 83, 38, 37, 64, 63, -60, -7, 80,
- 48, 7264, -8, -74, -9, -86, -100, -112,
- -128, -126, -7517, -8383, -8262, 16, 26, 40
- };
-
- // Array of titlecase differences
- static const short TCDIFF[] = {
- 3, 1, 0, -1
- };
-
// Array of mirrored character differences
static const short MIRROR_DIFF[] = {
0, 1, -1, 2, -2, 16, -16, 3,
@@ -649,21 +623,6 @@ namespace CharacterData {
-2108
};
- // Array of all possible numeric values
- static const int NUMERICS[] = {
- -1, 0, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, -2, 100, 1000,
- 40, 50, 60, 70, 80, 90, 10000, 500,
- 5000, 36, 37, 38, 39, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 200, 300,
- 400, 600, 700, 800, 900, 2000, 3000, 4000,
- 6000, 7000, 8000, 9000, 20000, 30000, 40000, 50000,
- 60000, 70000, 80000, 90000
- };
-
// All possible packed data values, no duplicates
static const uint32_t PACKED_DATA[] = {
0x00000000, 0x0000012F, 0x0000016F, 0x0000014F, 0x0000018F, 0x0000018C, 0x000001B8, 0x000000B8,
diff --git a/libs/utils/Unicode.cpp b/libs/utils/Unicode.cpp
index f92703e..65dbb4a 100644
--- a/libs/utils/Unicode.cpp
+++ b/libs/utils/Unicode.cpp
@@ -103,55 +103,6 @@ uint32_t android::Unicode::getPackedData(UChar32 c)
return CharacterData::PACKED_DATA[findCharacterValue(c) & 0x7FF];
}
-android::Unicode::CharType android::Unicode::getType(UChar32 c)
-{
- if (c < 0 || c >= 0x10FFFF)
- return CHARTYPE_UNASSIGNED;
- return (CharType)((getPackedData(c) >> TYPE_SHIFT) & TYPE_MASK);
-}
-
-android::Unicode::DecompositionType android::Unicode::getDecompositionType(UChar32 c)
-{
- // findCharacterValue returns a 16-bit value with the top 5 bits containing a decomposition type
- // and the remaining bits containing an index.
- return (DecompositionType)((findCharacterValue(c) >> DECOMPOSITION_SHIFT) & DECOMPOSITION_MASK);
-}
-
-int android::Unicode::getDigitValue(UChar32 c, int radix)
-{
- if (radix < MIN_RADIX || radix > MAX_RADIX)
- return -1;
-
- int tempValue = radix;
-
- if (c >= '0' && c <= '9')
- tempValue = c - '0';
- else if (c >= 'a' && c <= 'z')
- tempValue = c - 'a' + 10;
- else if (c >= 'A' && c <= 'Z')
- tempValue = c - 'A' + 10;
-
- return tempValue < radix ? tempValue : -1;
-}
-
-int android::Unicode::getNumericValue(UChar32 c)
-{
- if (isMirrored(c))
- return -1;
-
- return (int) CharacterData::NUMERICS[((getPackedData(c) >> NUMERIC_SHIFT) & NUMERIC_MASK)];
-}
-
-UChar32 android::Unicode::toLower(UChar32 c)
-{
- return c + CharacterData::LCDIFF[(getPackedData(c) >> TOLOWER_SHIFT) & TOLOWER_MASK];
-}
-
-UChar32 android::Unicode::toUpper(UChar32 c)
-{
- return c + CharacterData::UCDIFF[(getPackedData(c) >> TOUPPER_SHIFT) & TOUPPER_MASK];
-}
-
android::Unicode::Direction android::Unicode::getDirectionality(UChar32 c)
{
uint32_t data = getPackedData(c);
@@ -179,15 +130,3 @@ UChar32 android::Unicode::toMirror(UChar32 c)
return c + CharacterData::MIRROR_DIFF[(getPackedData(c) >> MIRROR_SHIFT) & MIRROR_MASK];
}
-
-UChar32 android::Unicode::toTitle(UChar32 c)
-{
- int32_t diff = CharacterData::TCDIFF[(getPackedData(c) >> TOTITLE_SHIFT) & TOTITLE_MASK];
-
- if (TOTITLE_MASK == diff)
- return toUpper(c);
-
- return c + diff;
-}
-
-