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/utypes.h" 00016 00017 #if U_SHOW_CPLUSPLUS_API 00018 00019 #include "unicode/uobject.h" 00020 #include "unicode/unistr.h" 00021 00027 U_NAMESPACE_BEGIN 00028 00061 class U_COMMON_API StringEnumeration : public UObject { 00062 public: 00067 virtual ~StringEnumeration(); 00068 00081 virtual StringEnumeration *clone() const; 00082 00100 virtual int32_t count(UErrorCode& status) const = 0; 00101 00132 virtual const char* next(int32_t *resultLength, UErrorCode& status); 00133 00157 virtual const char16_t* unext(int32_t *resultLength, UErrorCode& status); 00158 00179 virtual const UnicodeString* snext(UErrorCode& status); 00180 00193 virtual void reset(UErrorCode& status) = 0; 00194 00202 virtual UBool operator==(const StringEnumeration& that)const; 00210 virtual UBool operator!=(const StringEnumeration& that)const; 00211 00212 protected: 00217 UnicodeString unistr; 00222 char charsBuffer[32]; 00228 char *chars; 00233 int32_t charsCapacity; 00234 00239 StringEnumeration(); 00240 00249 void ensureCharsCapacity(int32_t capacity, UErrorCode &status); 00250 00273 UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status); 00274 }; 00275 00276 U_NAMESPACE_END 00277 00278 #endif /* U_SHOW_CPLUSPLUS_API */ 00279 00280 /* STRENUM_H */ 00281 #endif
1.6.1