00001 /* 00002 ******************************************************************************* 00003 * 00004 * Copyright (C) 2002-2003, International Business Machines 00005 * Corporation and others. All Rights Reserved. 00006 * 00007 ******************************************************************************* 00008 */ 00009 00010 #ifndef STRENUM_H 00011 #define STRENUM_H 00012 00013 #include "unicode/uobject.h" 00014 #include "unicode/unistr.h" 00015 00016 U_NAMESPACE_BEGIN 00017 00050 class U_COMMON_API StringEnumeration : public UObject { 00051 public: 00056 virtual ~StringEnumeration(); 00057 00073 virtual StringEnumeration *clone() const; 00074 00092 virtual int32_t count(UErrorCode& status) const = 0; 00093 00123 virtual const char* next(int32_t *resultLength, UErrorCode& status); 00124 00148 virtual const UChar* unext(int32_t *resultLength, UErrorCode& status); 00149 00166 virtual const UnicodeString* snext(UErrorCode& status) = 0; 00167 00180 virtual void reset(UErrorCode& status) = 0; 00181 00182 protected: 00187 UnicodeString unistr; 00192 char charsBuffer[32]; 00198 char *chars; 00203 int32_t charsCapacity; 00204 00209 StringEnumeration(); 00210 00219 void ensureCharsCapacity(int32_t capacity, UErrorCode &status); 00220 00243 UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status); 00244 }; 00245 00246 U_NAMESPACE_END 00247 00248 /* STRENUM_H */ 00249 #endif