Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

tcoldata.h

Go to the documentation of this file.
00001 /*
00002 * Copyright © {1997-1999}, International Business Machines Corporation and others. All Rights Reserved.
00003 *****************************************************************************************
00004 */
00005 //===============================================================================
00006 //
00007 // File tcoldata.h
00008 //
00009 // Internal file.  Defines TableCollationData, an internal class which is shared
00010 // by TableCollation objects, and which contains all the invariant (and large)
00011 // pieces of data.  Once created, TableCollationData objects do not change.
00012 //
00013 // Created by: Alan Liu
00014 //
00015 // Modification History:
00016 //
00017 //  Date        Name        Description
00018 //  2/5/97      aliu        Creation.
00019 //  3/5/97      aliu        Don't stream rule table in or out.  Added data members
00020 //                          isRuleTableLoaded, desiredLocale, and realLocaleName,
00021 //                          which are required for dynamic reloading of the rule
00022 //                          string.  We still keep rules in this object so that
00023 //                          they can be held in the in-memory cache.
00024 //  3/26/97     helena      Updated with platform independent data types.
00025 //  6/20/97     helena      Java class name change.
00026 //  8/18/97     helena      Added internal API documentation.
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 // This is just temporary, for prototyping.
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     // Do not access the fgCache object directly; use addToCache and findInCache.
00122     static  CollationCache      fgCache;
00123 
00124 private:
00132     friend class RuleBasedCollator;
00133     friend class CollationElementIterator;
00134 
00135 // This is just temporary, for prototyping.
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 //eof

Generated at Tue Dec 5 17:55:32 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000