jpayne@69: // © 2016 and later: Unicode, Inc. and others. jpayne@69: // License & terms of use: http://www.unicode.org/copyright.html jpayne@69: /* jpayne@69: ******************************************************************************** jpayne@69: * Copyright (C) 2010-2012, International Business Machines jpayne@69: * Corporation and others. All Rights Reserved. jpayne@69: ******************************************************************************** jpayne@69: * jpayne@69: * File attiter.h jpayne@69: * jpayne@69: * Modification History: jpayne@69: * jpayne@69: * Date Name Description jpayne@69: * 12/15/2009 dougfelt Created jpayne@69: ******************************************************************************** jpayne@69: */ jpayne@69: jpayne@69: #ifndef FPOSITER_H jpayne@69: #define FPOSITER_H jpayne@69: jpayne@69: #include "unicode/utypes.h" jpayne@69: jpayne@69: #if U_SHOW_CPLUSPLUS_API jpayne@69: jpayne@69: #include "unicode/uobject.h" jpayne@69: jpayne@69: /** jpayne@69: * \file jpayne@69: * \brief C++ API: FieldPosition Iterator. jpayne@69: */ jpayne@69: jpayne@69: #if UCONFIG_NO_FORMATTING jpayne@69: jpayne@69: U_NAMESPACE_BEGIN jpayne@69: jpayne@69: /* jpayne@69: * Allow the declaration of APIs with pointers to FieldPositionIterator jpayne@69: * even when formatting is removed from the build. jpayne@69: */ jpayne@69: class FieldPositionIterator; jpayne@69: jpayne@69: U_NAMESPACE_END jpayne@69: jpayne@69: #else jpayne@69: jpayne@69: #include "unicode/fieldpos.h" jpayne@69: #include "unicode/umisc.h" jpayne@69: jpayne@69: U_NAMESPACE_BEGIN jpayne@69: jpayne@69: class UVector32; jpayne@69: jpayne@69: /** jpayne@69: * FieldPositionIterator returns the field ids and their start/limit positions generated jpayne@69: * by a call to Format::format. See Format, NumberFormat, DecimalFormat. jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: class U_I18N_API FieldPositionIterator : public UObject { jpayne@69: public: jpayne@69: /** jpayne@69: * Destructor. jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: ~FieldPositionIterator(); jpayne@69: jpayne@69: /** jpayne@69: * Constructs a new, empty iterator. jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: FieldPositionIterator(void); jpayne@69: jpayne@69: /** jpayne@69: * Copy constructor. If the copy failed for some reason, the new iterator will jpayne@69: * be empty. jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: FieldPositionIterator(const FieldPositionIterator&); jpayne@69: jpayne@69: /** jpayne@69: * Return true if another object is semantically equal to this jpayne@69: * one. jpayne@69: *
jpayne@69: * Return true if this FieldPositionIterator is at the same position in an jpayne@69: * equal array of run values. jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: UBool operator==(const FieldPositionIterator&) const; jpayne@69: jpayne@69: /** jpayne@69: * Returns the complement of the result of operator== jpayne@69: * @param rhs The FieldPositionIterator to be compared for inequality jpayne@69: * @return the complement of the result of operator== jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: UBool operator!=(const FieldPositionIterator& rhs) const { return !operator==(rhs); } jpayne@69: jpayne@69: /** jpayne@69: * If the current position is valid, updates the FieldPosition values, advances the iterator, jpayne@69: * and returns TRUE, otherwise returns FALSE. jpayne@69: * @stable ICU 4.4 jpayne@69: */ jpayne@69: UBool next(FieldPosition& fp); jpayne@69: jpayne@69: private: jpayne@69: /** jpayne@69: * Sets the data used by the iterator, and resets the position. jpayne@69: * Returns U_ILLEGAL_ARGUMENT_ERROR in status if the data is not valid jpayne@69: * (length is not a multiple of 3, or start >= limit for any run). jpayne@69: */ jpayne@69: void setData(UVector32 *adopt, UErrorCode& status); jpayne@69: jpayne@69: friend class FieldPositionIteratorHandler; jpayne@69: jpayne@69: UVector32 *data; jpayne@69: int32_t pos; jpayne@69: }; jpayne@69: jpayne@69: U_NAMESPACE_END jpayne@69: jpayne@69: #endif /* #if !UCONFIG_NO_FORMATTING */ jpayne@69: jpayne@69: #endif /* U_SHOW_CPLUSPLUS_API */ jpayne@69: jpayne@69: #endif // FPOSITER_H