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

stsearch.h

Go to the documentation of this file.
00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 2001 IBM and others. All rights reserved.
00004 **********************************************************************
00005 *   Date        Name        Description
00006 *  03/22/2000   helena      Creation.
00007 **********************************************************************
00008 */
00009 
00010 #ifndef STSEARCH_H
00011 #define STSEARCH_H
00012 
00013 #include "unicode/tblcoll.h"
00014 #include "unicode/coleitr.h"
00015 #include "unicode/search.h"
00016 
00017 U_NAMESPACE_BEGIN
00018 
00118 class U_I18N_API StringSearch : public SearchIterator
00119 {
00120 public:
00121 
00122     // public constructors and destructors --------------------------------
00123 
00145     StringSearch(const UnicodeString &pattern, const UnicodeString &text,
00146                  const Locale        &locale,       
00147                        BreakIterator *breakiter,
00148                        UErrorCode    &status);
00149 
00171     StringSearch(const UnicodeString     &pattern, 
00172                  const UnicodeString     &text,
00173                        RuleBasedCollator *coll,       
00174                        BreakIterator     *breakiter,
00175                        UErrorCode        &status);
00176 
00202     StringSearch(const UnicodeString &pattern, CharacterIterator &text,
00203                  const Locale        &locale, 
00204                        BreakIterator *breakiter,
00205                        UErrorCode    &status);
00206 
00232     StringSearch(const UnicodeString     &pattern, CharacterIterator &text,
00233                        RuleBasedCollator *coll, 
00234                        BreakIterator     *breakiter,
00235                        UErrorCode        &status);
00236 
00243     StringSearch(const StringSearch &that);
00244 
00250     virtual ~StringSearch(void);
00251 
00252     // operator overloading ---------------------------------------------
00253 
00260     StringSearch & operator=(const StringSearch &that);
00261 
00270     virtual UBool operator==(const SearchIterator &that) const;
00271 
00272     // public get and set methods ----------------------------------------
00273 
00285     virtual void setOffset(UTextOffset position, UErrorCode &status);
00286 
00295     virtual UTextOffset getOffset(void) const;
00296 
00308     virtual void setText(const UnicodeString &text, UErrorCode &status);
00309     
00324     virtual void setText(CharacterIterator &text, UErrorCode &status);
00325 
00335     RuleBasedCollator * getCollator() const;
00336     
00347     void setCollator(RuleBasedCollator *coll, UErrorCode &status);
00348     
00358     void setPattern(const UnicodeString &pattern, UErrorCode &status);
00359     
00365     const UnicodeString & getPattern() const;
00366 
00367     // public methods ----------------------------------------------------
00368 
00377     virtual void reset();
00378 
00387     virtual SearchIterator * safeClone(void) const;
00388     
00389 protected:
00390 
00391     // protected method -------------------------------------------------
00392 
00414     virtual UTextOffset handleNext(UTextOffset position, UErrorCode &status);
00415 
00437     virtual UTextOffset handlePrev(UTextOffset position, UErrorCode &status);
00438     
00439 private :
00440 
00441     // private data members ----------------------------------------------
00442 
00446     RuleBasedCollator  m_collator_;
00450     UnicodeString      m_pattern_;
00454     UnicodeString      m_collation_rules_;
00458     UStringSearch     *m_strsrch_;
00459 };
00460 
00461 U_NAMESPACE_END
00462 
00463 #endif
00464 

Generated on Mon Dec 3 19:00:23 2001 for ICU 2.0 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001