00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ******************************************************************************* 00005 * 00006 * Copyright (C) 2002-2012, International Business Machines 00007 * Corporation and others. All Rights Reserved. 00008 * 00009 ******************************************************************************* 00010 */ 00011 00012 #ifndef STRENUM_H 00013 #define STRENUM_H 00014 00015 #include "unicode/uobject.h" 00016 #include "unicode/unistr.h" 00017 00023 U_NAMESPACE_BEGIN 00024 00057 class U_COMMON_API StringEnumeration : public UObject { 00058 public: 00063 virtual ~StringEnumeration(); 00064 00080 virtual StringEnumeration *clone() const; 00081 00099 virtual int32_t count(UErrorCode& status) const = 0; 00100 00131 virtual const char* next(int32_t *resultLength, UErrorCode& status); 00132 00156 virtual const char16_t* unext(int32_t *resultLength, UErrorCode& status); 00157 00178 virtual const UnicodeString* snext(UErrorCode& status); 00179 00192 virtual void reset(UErrorCode& status) = 0; 00193 00201 virtual UBool operator==(const StringEnumeration& that)const; 00209 virtual UBool operator!=(const StringEnumeration& that)const; 00210 00211 protected: 00216 UnicodeString unistr; 00221 char charsBuffer[32]; 00227 char *chars; 00232 int32_t charsCapacity; 00233 00238 StringEnumeration(); 00239 00248 void ensureCharsCapacity(int32_t capacity, UErrorCode &status); 00249 00272 UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status); 00273 }; 00274 00275 U_NAMESPACE_END 00276 00277 /* STRENUM_H */ 00278 #endif
1.6.1