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

caniter.h

Go to the documentation of this file.
00001 /*
00002  *******************************************************************************
00003  * Copyright (C) 1996-2002, International Business Machines Corporation and    *
00004  * others. All Rights Reserved.                                                *
00005  *******************************************************************************
00006  */
00007 
00008 #ifndef CANITER_H
00009 #define CANITER_H
00010 
00011 #include "unicode/utypes.h"
00012 #include "unicode/uobject.h"
00013 #include "unicode/unistr.h"
00014 
00019 #ifndef CANITER_SKIP_ZEROES
00020 #define CANITER_SKIP_ZEROES TRUE
00021 #endif
00022 
00023 U_NAMESPACE_BEGIN
00024 
00025 class Hashtable;
00026 
00062 class U_COMMON_API CanonicalIterator : public UObject {
00063 public:
00070     CanonicalIterator(const UnicodeString &source, UErrorCode &status);    
00071 
00076     ~CanonicalIterator();
00077 
00083     UnicodeString getSource();    
00084 
00089     void reset();    
00090 
00098     UnicodeString next();    
00099 
00107     void setSource(const UnicodeString &newSource, UErrorCode &status);    
00108 
00118     static void permute(UnicodeString &source, UBool skipZeros, Hashtable *result, UErrorCode &status);     
00119     
00125     virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
00126 
00132     static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
00133 
00134 private:
00135     // ===================== PRIVATES ==============================
00136     // private default constructor
00137     CanonicalIterator(); 
00138        
00139 
00144     CanonicalIterator(const CanonicalIterator& other);
00145 
00150     CanonicalIterator& operator=(const CanonicalIterator& other);
00151 
00152     // fields
00153     UnicodeString source;
00154     UBool done;
00155 
00156     // 2 dimensional array holds the pieces of the string with
00157     // their different canonically equivalent representations
00158     UnicodeString **pieces;
00159     int32_t pieces_length;
00160     int32_t *pieces_lengths;
00161 
00162     // current is used in iterating to combine pieces
00163     int32_t *current;
00164     int32_t current_length;
00165     
00166     // transient fields
00167     UnicodeString buffer;
00168     
00169     // we have a segment, in NFD. Find all the strings that are canonically equivalent to it.
00170     UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status); //private String[] getEquivalents(String segment)
00171     
00172     //Set getEquivalents2(String segment);
00173     Hashtable *getEquivalents2(const UChar *segment, int32_t segLen, UErrorCode &status);
00174     //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status);
00175     
00181     //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer);
00182     Hashtable *extract(UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
00183     //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
00184 
00185     void cleanPieces();
00186 
00191     static const char fgClassID;
00192 };
00193 U_NAMESPACE_END
00194 #endif

Generated on Wed Dec 18 16:49:28 2002 for ICU 2.4 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001