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) 2010-2012, International Business Machines |
michael@0 | 4 | * Corporation and others. All Rights Reserved. |
michael@0 | 5 | ******************************************************************************** |
michael@0 | 6 | * |
michael@0 | 7 | * File attiter.h |
michael@0 | 8 | * |
michael@0 | 9 | * Modification History: |
michael@0 | 10 | * |
michael@0 | 11 | * Date Name Description |
michael@0 | 12 | * 12/15/2009 dougfelt Created |
michael@0 | 13 | ******************************************************************************** |
michael@0 | 14 | */ |
michael@0 | 15 | |
michael@0 | 16 | #ifndef FPOSITER_H |
michael@0 | 17 | #define FPOSITER_H |
michael@0 | 18 | |
michael@0 | 19 | #include "unicode/utypes.h" |
michael@0 | 20 | #include "unicode/uobject.h" |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | * \file |
michael@0 | 24 | * \brief C++ API: FieldPosition Iterator. |
michael@0 | 25 | */ |
michael@0 | 26 | |
michael@0 | 27 | #if UCONFIG_NO_FORMATTING |
michael@0 | 28 | |
michael@0 | 29 | U_NAMESPACE_BEGIN |
michael@0 | 30 | |
michael@0 | 31 | /* |
michael@0 | 32 | * Allow the declaration of APIs with pointers to FieldPositionIterator |
michael@0 | 33 | * even when formatting is removed from the build. |
michael@0 | 34 | */ |
michael@0 | 35 | class FieldPositionIterator; |
michael@0 | 36 | |
michael@0 | 37 | U_NAMESPACE_END |
michael@0 | 38 | |
michael@0 | 39 | #else |
michael@0 | 40 | |
michael@0 | 41 | #include "unicode/fieldpos.h" |
michael@0 | 42 | #include "unicode/umisc.h" |
michael@0 | 43 | |
michael@0 | 44 | U_NAMESPACE_BEGIN |
michael@0 | 45 | |
michael@0 | 46 | class UVector32; |
michael@0 | 47 | |
michael@0 | 48 | /** |
michael@0 | 49 | * FieldPositionIterator returns the field ids and their start/limit positions generated |
michael@0 | 50 | * by a call to Format::format. See Format, NumberFormat, DecimalFormat. |
michael@0 | 51 | * @stable ICU 4.4 |
michael@0 | 52 | */ |
michael@0 | 53 | class U_I18N_API FieldPositionIterator : public UObject { |
michael@0 | 54 | public: |
michael@0 | 55 | /** |
michael@0 | 56 | * Destructor. |
michael@0 | 57 | * @stable ICU 4.4 |
michael@0 | 58 | */ |
michael@0 | 59 | ~FieldPositionIterator(); |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * Constructs a new, empty iterator. |
michael@0 | 63 | * @stable ICU 4.4 |
michael@0 | 64 | */ |
michael@0 | 65 | FieldPositionIterator(void); |
michael@0 | 66 | |
michael@0 | 67 | /** |
michael@0 | 68 | * Copy constructor. If the copy failed for some reason, the new iterator will |
michael@0 | 69 | * be empty. |
michael@0 | 70 | * @stable ICU 4.4 |
michael@0 | 71 | */ |
michael@0 | 72 | FieldPositionIterator(const FieldPositionIterator&); |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | * Return true if another object is semantically equal to this |
michael@0 | 76 | * one. |
michael@0 | 77 | * <p> |
michael@0 | 78 | * Return true if this FieldPositionIterator is at the same position in an |
michael@0 | 79 | * equal array of run values. |
michael@0 | 80 | * @stable ICU 4.4 |
michael@0 | 81 | */ |
michael@0 | 82 | UBool operator==(const FieldPositionIterator&) const; |
michael@0 | 83 | |
michael@0 | 84 | /** |
michael@0 | 85 | * Returns the complement of the result of operator== |
michael@0 | 86 | * @param rhs The FieldPositionIterator to be compared for inequality |
michael@0 | 87 | * @return the complement of the result of operator== |
michael@0 | 88 | * @stable ICU 4.4 |
michael@0 | 89 | */ |
michael@0 | 90 | UBool operator!=(const FieldPositionIterator& rhs) const { return !operator==(rhs); } |
michael@0 | 91 | |
michael@0 | 92 | /** |
michael@0 | 93 | * If the current position is valid, updates the FieldPosition values, advances the iterator, |
michael@0 | 94 | * and returns TRUE, otherwise returns FALSE. |
michael@0 | 95 | * @stable ICU 4.4 |
michael@0 | 96 | */ |
michael@0 | 97 | UBool next(FieldPosition& fp); |
michael@0 | 98 | |
michael@0 | 99 | private: |
michael@0 | 100 | friend class FieldPositionIteratorHandler; |
michael@0 | 101 | |
michael@0 | 102 | /** |
michael@0 | 103 | * Sets the data used by the iterator, and resets the position. |
michael@0 | 104 | * Returns U_ILLEGAL_ARGUMENT_ERROR in status if the data is not valid |
michael@0 | 105 | * (length is not a multiple of 3, or start >= limit for any run). |
michael@0 | 106 | */ |
michael@0 | 107 | void setData(UVector32 *adopt, UErrorCode& status); |
michael@0 | 108 | |
michael@0 | 109 | UVector32 *data; |
michael@0 | 110 | int32_t pos; |
michael@0 | 111 | }; |
michael@0 | 112 | |
michael@0 | 113 | U_NAMESPACE_END |
michael@0 | 114 | |
michael@0 | 115 | #endif /* #if !UCONFIG_NO_FORMATTING */ |
michael@0 | 116 | |
michael@0 | 117 | #endif // FPOSITER_H |