ICU 63.1 63.1

strenum.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 *
6 * Copyright (C) 2002-2012, International Business Machines
7 * Corporation and others. All Rights Reserved.
8 *
9 *******************************************************************************
10 */
11
12 #ifndef STRENUM_H
13 #define STRENUM_H
14
15 #include "unicode/uobject.h"
16 #include "unicode/unistr.h"
17
23 U_NAMESPACE_BEGIN
24
57 class U_COMMON_API StringEnumeration : public UObject {
58 public:
63 virtual ~StringEnumeration();
64
80 virtual StringEnumeration *clone() const;
81
99 virtual int32_t count(UErrorCode& status) const = 0;
100
131 virtual const char* next(int32_t *resultLength, UErrorCode& status);
132
156 virtual const char16_t* unext(int32_t *resultLength, UErrorCode& status);
157
178 virtual const UnicodeString* snext(UErrorCode& status);
179
192 virtual void reset(UErrorCode& status) = 0;
193
201 virtual UBool operator==(const StringEnumeration& that)const;
209 virtual UBool operator!=(const StringEnumeration& that)const;
210
211 protected:
216 UnicodeString unistr;
221 char charsBuffer[32];
227 char *chars;
232 int32_t charsCapacity;
233
238 StringEnumeration();
239
248 void ensureCharsCapacity(int32_t capacity, UErrorCode &status);
249
272 UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status);
273 };
274
275 U_NAMESPACE_END
276
277 /* STRENUM_H */
278 #endif
icu::StringEnumeration::unistr
UnicodeString unistr
UnicodeString field for use with default implementations and subclasses.
Definition: strenum.h:216
icu::StringEnumeration::chars
char * chars
char * buffer for use with default implementations and subclasses.
Definition: strenum.h:227
unistr.h
C++ API: Unicode String.
icu::operator==
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
icu::StringEnumeration
Base class for &#39;pure&#39; C++ implementations of uenum api.
Definition: strenum.h:57
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
icu::operator!=
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition: stringpiece.h:218
icu::StringEnumeration::charsCapacity
int32_t charsCapacity
Capacity of chars, for use with default implementations and subclasses.
Definition: strenum.h:232
uobject.h
C++ API: Common ICU base class UObject.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
Definition: utypes.h:300
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:289
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:220
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:225