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

mergecol.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * Copyright © {1996-1999}, International Business Machines Corporation and others. All Rights Reserved.
00003  ******************************************************************************
00004  */
00005 //=============================================================================
00006 //
00007 // File mergecol.h
00008 //
00009 // 
00010 //
00011 // Created by: Helena Shih
00012 //
00013 // Modification History:
00014 //
00015 //  Date        Name        Description
00016 //  3/5/97      mark        Cleaned up fixEntry().  Added constants BYTEPOWER
00017 //                          and BYTEMASK to replace BYTESIZE.
00018 //  6/17/97     helena      In getPattern, added the queue-up list for entries 
00019 //                          with the same extension chars.
00020 //  8/18/97     helena      Added internal API documentation.
00021 //  8/13/98     erm         Synched up with 1.2 version of MergeCollation.java
00022 // 04/23/99     stephen     Removed EDecompositionMode, merged with
00023 //                          Normalizer::EMode
00024 //=============================================================================
00025 
00026 #ifndef MERGECOL_H
00027 #define MERGECOL_H
00028 
00029 #include "unicode/unistr.h"
00030 #include "ptnentry.h"
00031 #include "tables.h"
00032 #include "unicode/coll.h"
00033 #include "unicode/normlzr.h"
00034 
00035 
00061 class MergeCollation 
00062 {
00063 public:
00064 
00071   MergeCollation( const   UnicodeString&  pattern,
00072           Normalizer::EMode decompMode,
00073           UErrorCode&      success);
00077   MergeCollation( const   MergeCollation& other);
00078 
00082   ~MergeCollation();
00083 
00086   const   MergeCollation&     operator=(const MergeCollation& other);
00092   UnicodeString& getPattern(UnicodeString& pattern) const;
00093 
00101   UnicodeString& getPattern(UnicodeString& pattern, UBool withWhiteSpace) const;
00102 
00109   UnicodeString& emitPattern(UnicodeString& pattern) const;
00110 
00119   UnicodeString& emitPattern(UnicodeString& pattern, UBool withWhiteSpace) const;
00120 
00127   void setPattern(const   UnicodeString&  pattern,
00128           Normalizer::EMode decompMode,
00129           UErrorCode&      status);
00130 
00137   void addPattern(const   UnicodeString&  pattern,
00138           Normalizer::EMode decompMode,
00139           UErrorCode&      status);
00140 
00145   int32_t getCount(void) const;
00146 
00152   const PatternEntry* getItemAt(UTextOffset index) const;
00153 
00154 private:
00155 
00156     //============================================================
00157     // privates
00158     //============================================================
00159 
00160   VectorOfPointersToPatternEntry* patterns; // a vector of PatternEntries
00161   static  const   int32_t         BITARRAYSIZE;
00162   static  const   uint8_t         BITARRAYMASK;
00163   static  const   int32_t         BYTEPOWER;
00164   static  const   int32_t         BYTEMASK;
00165 
00166   PatternEntry*   lastEntry;
00167   PatternEntry*   saveEntry;
00168   uint8_t*        statusArray;
00169 
00170 
00177   const PatternEntry* findLastWithNoExtension(int32_t i) const;
00178 
00190   void fixEntry(  PatternEntry*   newEntry,
00191           UErrorCode&      status);
00192 
00202   int32_t findLastEntry(  const PatternEntry* lastPatEntry, 
00203               UnicodeString&  excess,
00204               UErrorCode&      success) const;
00205 };
00206 
00207 inline UnicodeString& MergeCollation::getPattern(UnicodeString& result) const
00208 {
00209   return getPattern(result, TRUE);
00210 }
00211 
00212 inline UnicodeString& MergeCollation::emitPattern(UnicodeString& result) const
00213 {
00214   return emitPattern(result, TRUE);
00215 }
00216 
00217 
00218 #endif // _MERGECOL

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