Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* |
michael@0 | 2 | ********************************************************************** |
michael@0 | 3 | * Copyright (c) 2002-2012, International Business Machines |
michael@0 | 4 | * Corporation and others. All Rights Reserved. |
michael@0 | 5 | ********************************************************************** |
michael@0 | 6 | * Author: Alan Liu |
michael@0 | 7 | * Created: November 11 2002 |
michael@0 | 8 | * Since: ICU 2.4 |
michael@0 | 9 | ********************************************************************** |
michael@0 | 10 | */ |
michael@0 | 11 | #ifndef _USTRENUM_H_ |
michael@0 | 12 | #define _USTRENUM_H_ |
michael@0 | 13 | |
michael@0 | 14 | #include "unicode/uenum.h" |
michael@0 | 15 | #include "unicode/strenum.h" |
michael@0 | 16 | |
michael@0 | 17 | //---------------------------------------------------------------------- |
michael@0 | 18 | U_NAMESPACE_BEGIN |
michael@0 | 19 | |
michael@0 | 20 | /** |
michael@0 | 21 | * A wrapper to make a UEnumeration into a StringEnumeration. The |
michael@0 | 22 | * wrapper adopts the UEnumeration is wraps. |
michael@0 | 23 | */ |
michael@0 | 24 | class U_COMMON_API UStringEnumeration : public StringEnumeration { |
michael@0 | 25 | |
michael@0 | 26 | public: |
michael@0 | 27 | /** |
michael@0 | 28 | * Constructor. This constructor adopts its UEnumeration |
michael@0 | 29 | * argument. |
michael@0 | 30 | * @param uenum a UEnumeration object. This object takes |
michael@0 | 31 | * ownership of 'uenum' and will close it in its destructor. The |
michael@0 | 32 | * caller must not call uenum_close on 'uenum' after calling this |
michael@0 | 33 | * constructor. |
michael@0 | 34 | */ |
michael@0 | 35 | UStringEnumeration(UEnumeration* uenum); |
michael@0 | 36 | |
michael@0 | 37 | /** |
michael@0 | 38 | * Destructor. This closes the UEnumeration passed in to the |
michael@0 | 39 | * constructor. |
michael@0 | 40 | */ |
michael@0 | 41 | virtual ~UStringEnumeration(); |
michael@0 | 42 | |
michael@0 | 43 | /** |
michael@0 | 44 | * Return the number of elements that the iterator traverses. |
michael@0 | 45 | * @param status the error code. |
michael@0 | 46 | * @return number of elements in the iterator. |
michael@0 | 47 | */ |
michael@0 | 48 | virtual int32_t count(UErrorCode& status) const; |
michael@0 | 49 | |
michael@0 | 50 | virtual const char* next(int32_t *resultLength, UErrorCode& status); |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * Returns the next element a UnicodeString*. If there are no |
michael@0 | 54 | * more elements, returns NULL. |
michael@0 | 55 | * @param status the error code. |
michael@0 | 56 | * @return a pointer to the string, or NULL. |
michael@0 | 57 | */ |
michael@0 | 58 | virtual const UnicodeString* snext(UErrorCode& status); |
michael@0 | 59 | |
michael@0 | 60 | /** |
michael@0 | 61 | * Resets the iterator. |
michael@0 | 62 | * @param status the error code. |
michael@0 | 63 | */ |
michael@0 | 64 | virtual void reset(UErrorCode& status); |
michael@0 | 65 | |
michael@0 | 66 | /** |
michael@0 | 67 | * ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. |
michael@0 | 68 | */ |
michael@0 | 69 | virtual UClassID getDynamicClassID() const; |
michael@0 | 70 | |
michael@0 | 71 | /** |
michael@0 | 72 | * ICU4C "poor man's RTTI", returns a UClassID for this ICU class. |
michael@0 | 73 | */ |
michael@0 | 74 | static UClassID U_EXPORT2 getStaticClassID(); |
michael@0 | 75 | |
michael@0 | 76 | private: |
michael@0 | 77 | UEnumeration *uenum; // owned |
michael@0 | 78 | }; |
michael@0 | 79 | |
michael@0 | 80 | U_NAMESPACE_END |
michael@0 | 81 | |
michael@0 | 82 | #endif |
michael@0 | 83 |