Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

rbbi.h

00001 /* 00002 * Copyright (C) {1999-2001}, International Business Machines Corporation and others. All Rights Reserved. 00003 ********************************************************************** 00004 * Date Name Description 00005 * 10/22/99 alan Creation. 00006 * 11/11/99 rgillam Complete port from Java. 00007 ********************************************************************** 00008 */ 00009 00010 #ifndef RBBI_H 00011 #define RBBI_H 00012 00013 #include "unicode/utypes.h" 00014 #include "unicode/brkiter.h" 00015 #include "unicode/udata.h" 00016 00017 U_NAMESPACE_BEGIN 00018 00019 class RuleBasedBreakIteratorTables; 00020 class BreakIterator; 00021 00186 class U_COMMON_API RuleBasedBreakIterator : public BreakIterator { 00187 00188 protected: 00192 static const int8_t UBRK_IGNORE; 00193 friend class DictionaryBasedBreakIteratorTables; 00194 00195 private: 00199 static const int16_t START_STATE; 00200 00204 static const int16_t STOP_STATE; 00205 00206 protected: 00210 CharacterIterator* text; 00211 00215 RuleBasedBreakIteratorTables* tables; 00216 00217 private: 00221 static const char fgClassID; 00222 /* 00223 * HSYS: To be revisited, once the ctor are made public. 00224 */ 00225 protected: 00226 //======================================================================= 00227 // constructors 00228 //======================================================================= 00229 00230 // This constructor uses the udata interface to create a BreakIterator whose 00231 // internal tables live in a memory-mapped file. "image" is a pointer to the 00232 // beginning of that file. 00233 RuleBasedBreakIterator(UDataMemory* image); 00234 00235 public: 00240 RuleBasedBreakIterator(const RuleBasedBreakIterator& that); 00241 00242 //======================================================================= 00243 // boilerplate 00244 //======================================================================= 00245 00249 virtual ~RuleBasedBreakIterator(); 00250 00255 RuleBasedBreakIterator& operator=(const RuleBasedBreakIterator& that); 00256 00261 virtual UBool operator==(const BreakIterator& that) const; 00262 00267 UBool operator!=(const BreakIterator& that) const; 00268 00273 virtual BreakIterator* clone(void) const; 00274 00279 virtual int32_t hashCode(void) const; 00280 00284 virtual const UnicodeString& getRules(void) const; 00285 00286 //======================================================================= 00287 // BreakIterator overrides 00288 //======================================================================= 00289 00297 virtual const CharacterIterator& getText(void) const; 00298 00299 #ifdef ICU_ENABLE_DEPRECATED_BREAKITERATOR 00308 virtual CharacterIterator* createText(void) const; 00309 00319 virtual void setText(const UnicodeString* newText); 00320 #endif 00321 00328 virtual void adoptText(CharacterIterator* newText); 00329 00335 virtual void setText(const UnicodeString& newText); 00336 00342 virtual int32_t first(void); 00343 00349 virtual int32_t last(void); 00350 00360 virtual int32_t next(int32_t n); 00361 00366 virtual int32_t next(void); 00367 00372 virtual int32_t previous(void); 00373 00380 virtual int32_t following(int32_t offset); 00381 00388 virtual int32_t preceding(int32_t offset); 00389 00397 virtual UBool isBoundary(int32_t offset); 00398 00403 virtual int32_t current(void) const; 00404 00415 inline virtual UClassID getDynamicClassID(void) const; 00416 00427 inline static UClassID getStaticClassID(void); 00428 00429 virtual BreakIterator * createBufferClone(void *stackBuffer, 00430 int32_t &BufferSize, 00431 UErrorCode &status); 00432 #ifdef RBBI_DEBUG 00433 void debugDumpTables() const; 00434 #endif 00435 00436 00437 protected: 00438 //======================================================================= 00439 // implementation 00440 //======================================================================= 00448 virtual int32_t handleNext(void); 00449 00457 virtual int32_t handlePrevious(void); 00458 00464 virtual void reset(void); 00465 00466 private: 00467 00472 RuleBasedBreakIterator(RuleBasedBreakIteratorTables* adoptTables); 00473 00474 friend class BreakIterator; 00475 00476 }; 00477 00478 inline UBool RuleBasedBreakIterator::operator!=(const BreakIterator& that) const { 00479 return !operator==(that); 00480 } 00481 00482 inline UClassID RuleBasedBreakIterator::getDynamicClassID(void) const { 00483 return RuleBasedBreakIterator::getStaticClassID(); 00484 } 00485 00486 inline UClassID RuleBasedBreakIterator::getStaticClassID(void) { 00487 return (UClassID)(&fgClassID); 00488 } 00489 00490 U_NAMESPACE_END 00491 00492 #endif

Generated on Wed Jul 28 05:45:12 2004 for ICU 2.1 by doxygen 1.3.7