00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef TCOLDATA_H
00030 #define TCOLDATA_H
00031
00032 #include "unicode/ucol.h"
00033
00034 #include "ucmp32.h"
00035 #include "unicode/utypes.h"
00036 #include "colcache.h"
00037 #include "unicode/unistr.h"
00038 #include "unicode/locid.h"
00039 #include "filestrm.h"
00040 #include "umemstrm.h"
00041
00042
00043
00044 class VectorOfPToContractTable;
00045 class VectorOfPToExpandTable;
00046 class RuleBasedCollator;
00047 class CollationElementIterator;
00048
00049
00050 struct collIterate;
00051 typedef void * UCollator;
00052
00053
00054
00069 class TableCollationData
00070 {
00071 public:
00072 TableCollationData();
00073 virtual ~TableCollationData();
00074
00084 static void addToCache(const UnicodeString& key, TableCollationData* data);
00090 static TableCollationData* findInCache(const UnicodeString& key);
00091
00099 void streamIn(FileStream* is);
00100 void streamOut(FileStream* os) const;
00101
00105 void streamIn(UMemoryStream* is, UErrorCode& status);
00106 void streamOut(UMemoryStream* os) const;
00107
00112 UBool isBogus() const;
00113 private:
00117 TableCollationData(const TableCollationData&);
00118 TableCollationData& operator=(const TableCollationData&);
00119
00120 private:
00121
00122 static CollationCache fgCache;
00123
00124 private:
00132 friend class RuleBasedCollator;
00133 friend class CollationElementIterator;
00134
00135
00136 friend int32_t ucol_getNextCE(const UCollator *coll, collIterate *source, UErrorCode *status);
00137 friend int32_t getComplicatedCE(const UCollator *coll, collIterate *source, UErrorCode *status);
00138 friend int32_t ucol_getSortKey(const UCollator *coll, const UChar *source,
00139 int32_t sourceLength, uint8_t *result, int32_t resultLength);
00140 friend UCollationResult ucol_strcoll( const UCollator *coll,
00141 const UChar *source,
00142 int32_t sourceLength,
00143 const UChar *target,
00144 int32_t targetLength);
00145
00146 UBool isFrenchSec;
00147 int16_t maxSecOrder;
00148 int16_t maxTerOrder;
00149 CompactIntArray* mapping;
00150 VectorOfPToContractTable* contractTable;
00151 VectorOfPToExpandTable* expandTable;
00152 UBool fBogus;
00153
00171 UnicodeString ruleTable;
00172 UBool isRuleTableLoaded;
00173 Locale desiredLocale;
00174 UnicodeString realLocaleName;
00175 };
00176
00177 #endif //_TCOLDATA
00178