strenum.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2002-2012, 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 
00021 U_NAMESPACE_BEGIN
00022 
00055 class U_COMMON_API StringEnumeration : public UObject { 
00056 public:
00061     virtual ~StringEnumeration();
00062 
00078     virtual StringEnumeration *clone() const;
00079 
00097     virtual int32_t count(UErrorCode& status) const = 0;
00098 
00129     virtual const char* next(int32_t *resultLength, UErrorCode& status);
00130 
00154     virtual const UChar* unext(int32_t *resultLength, UErrorCode& status);
00155 
00176     virtual const UnicodeString* snext(UErrorCode& status);
00177 
00190     virtual void reset(UErrorCode& status) = 0;
00191 
00199     virtual UBool operator==(const StringEnumeration& that)const;
00207     virtual UBool operator!=(const StringEnumeration& that)const;
00208 
00209 protected:
00214     UnicodeString unistr;
00219     char charsBuffer[32];
00225     char *chars;
00230     int32_t charsCapacity;
00231 
00236     StringEnumeration();
00237 
00246     void ensureCharsCapacity(int32_t capacity, UErrorCode &status);
00247 
00270     UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status);
00271 };
00272 
00273 U_NAMESPACE_END
00274 
00275 /* STRENUM_H */
00276 #endif

Generated on 25 Nov 2014 for ICU 50.1.2 by  doxygen 1.4.7