ICU 56.1: strenum.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

strenum.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 2002-2012, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 *******************************************************************************
8 */
9
10 #ifndef STRENUM_H
11 #define STRENUM_H
12
13 #include "unicode/uobject.h"
14 #include "unicode/unistr.h"
15
21 U_NAMESPACE_BEGIN
22
55 class U_COMMON_API StringEnumeration : public UObject {
56 public:
61 virtual ~StringEnumeration();
62
78 virtual StringEnumeration *clone() const;
79
97 virtual int32_t count(UErrorCode& status) const = 0;
98
129 virtual const char* next(int32_t *resultLength, UErrorCode& status);
130
154 virtual const UChar* unext(int32_t *resultLength, UErrorCode& status);
155
176 virtual const UnicodeString* snext(UErrorCode& status);
177
190 virtual void reset(UErrorCode& status) = 0;
191
199 virtual UBool operator==(const StringEnumeration& that)const;
207 virtual UBool operator!=(const StringEnumeration& that)const;
208
209 protected:
214 UnicodeString unistr;
219 char charsBuffer[32];
225 char *chars;
230 int32_t charsCapacity;
231
236 StringEnumeration();
237
246 void ensureCharsCapacity(int32_t capacity, UErrorCode &status);
247
270 UnicodeString *setChars(const char *s, int32_t length, UErrorCode &status);
271 };
272
273 U_NAMESPACE_END
274
275 /* STRENUM_H */
276 #endif
icu::StringEnumeration::unistr
UnicodeString unistr
UnicodeString field for use with default implementations and subclasses.
Definition: strenum.h:214
icu::StringEnumeration::chars
char * chars
char * buffer for use with default implementations and subclasses.
Definition: strenum.h:225
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 'pure' C++ implementations of uenum api.
Definition: strenum.h:55
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
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:230
uobject.h
C++ API: Common ICU base class UObject.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
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:357
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:293
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:221
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:234