Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/unicode/uiter.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // © 2016 and later: Unicode, Inc. and others.
0002 // License & terms of use: http://www.unicode.org/copyright.html
0003 /*
0004 *******************************************************************************
0005 *
0006 *   Copyright (C) 2002-2011 International Business Machines
0007 *   Corporation and others.  All Rights Reserved.
0008 *
0009 *******************************************************************************
0010 *   file name:  uiter.h
0011 *   encoding:   UTF-8
0012 *   tab size:   8 (not used)
0013 *   indentation:4
0014 *
0015 *   created on: 2002jan18
0016 *   created by: Markus W. Scherer
0017 */
0018 
0019 #ifndef __UITER_H__
0020 #define __UITER_H__
0021 
0022 /**
0023  * \file
0024  * \brief C API: Unicode Character Iteration
0025  *
0026  * @see UCharIterator
0027  */
0028 
0029 #include "unicode/utypes.h"
0030 
0031 #if U_SHOW_CPLUSPLUS_API
0032     U_NAMESPACE_BEGIN
0033 
0034     class CharacterIterator;
0035     class Replaceable;
0036 
0037     U_NAMESPACE_END
0038 #endif
0039 
0040 U_CDECL_BEGIN
0041 
0042 struct UCharIterator;
0043 typedef struct UCharIterator UCharIterator; /**< C typedef for struct UCharIterator. @stable ICU 2.1 */
0044 
0045 /**
0046  * Origin constants for UCharIterator.getIndex() and UCharIterator.move().
0047  * @see UCharIteratorMove
0048  * @see UCharIterator
0049  * @stable ICU 2.1
0050  */
0051 typedef enum UCharIteratorOrigin {
0052     UITER_START, UITER_CURRENT, UITER_LIMIT, UITER_ZERO, UITER_LENGTH
0053 } UCharIteratorOrigin;
0054 
0055 /** Constants for UCharIterator. @stable ICU 2.6 */
0056 enum {
0057     /**
0058      * Constant value that may be returned by UCharIteratorMove
0059      * indicating that the final UTF-16 index is not known, but that the move succeeded.
0060      * This can occur when moving relative to limit or length, or
0061      * when moving relative to the current index after a setState()
0062      * when the current UTF-16 index is not known.
0063      *
0064      * It would be very inefficient to have to count from the beginning of the text
0065      * just to get the current/limit/length index after moving relative to it.
0066      * The actual index can be determined with getIndex(UITER_CURRENT)
0067      * which will count the UChars if necessary.
0068      *
0069      * @stable ICU 2.6
0070      */
0071     UITER_UNKNOWN_INDEX=-2
0072 };
0073 
0074 
0075 /**
0076  * Constant for UCharIterator getState() indicating an error or
0077  * an unknown state.
0078  * Returned by uiter_getState()/UCharIteratorGetState
0079  * when an error occurs.
0080  * Also, some UCharIterator implementations may not be able to return
0081  * a valid state for each position. This will be clearly documented
0082  * for each such iterator (none of the public ones here).
0083  *
0084  * @stable ICU 2.6
0085  */
0086 #define UITER_NO_STATE ((uint32_t)0xffffffff)
0087 
0088 /**
0089  * Function type declaration for UCharIterator.getIndex().
0090  *
0091  * Gets the current position, or the start or limit of the
0092  * iteration range.
0093  *
0094  * This function may perform slowly for UITER_CURRENT after setState() was called,
0095  * or for UITER_LENGTH, because an iterator implementation may have to count
0096  * UChars if the underlying storage is not UTF-16.
0097  *
0098  * @param iter the UCharIterator structure ("this pointer")
0099  * @param origin get the 0, start, limit, length, or current index
0100  * @return the requested index, or U_SENTINEL in an error condition
0101  *
0102  * @see UCharIteratorOrigin
0103  * @see UCharIterator
0104  * @stable ICU 2.1
0105  */
0106 typedef int32_t U_CALLCONV
0107 UCharIteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin);
0108 
0109 /**
0110  * Function type declaration for UCharIterator.move().
0111  *
0112  * Use iter->move(iter, index, UITER_ZERO) like CharacterIterator::setIndex(index).
0113  *
0114  * Moves the current position relative to the start or limit of the
0115  * iteration range, or relative to the current position itself.
0116  * The movement is expressed in numbers of code units forward
0117  * or backward by specifying a positive or negative delta.
0118  * Out of bounds movement will be pinned to the start or limit.
0119  *
0120  * This function may perform slowly for moving relative to UITER_LENGTH
0121  * because an iterator implementation may have to count the rest of the
0122  * UChars if the native storage is not UTF-16.
0123  *
0124  * When moving relative to the limit or length, or
0125  * relative to the current position after setState() was called,
0126  * move() may return UITER_UNKNOWN_INDEX (-2) to avoid an inefficient
0127  * determination of the actual UTF-16 index.
0128  * The actual index can be determined with getIndex(UITER_CURRENT)
0129  * which will count the UChars if necessary.
0130  * See UITER_UNKNOWN_INDEX for details.
0131  *
0132  * @param iter the UCharIterator structure ("this pointer")
0133  * @param delta can be positive, zero, or negative
0134  * @param origin move relative to the 0, start, limit, length, or current index
0135  * @return the new index, or U_SENTINEL on an error condition,
0136  *         or UITER_UNKNOWN_INDEX when the index is not known.
0137  *
0138  * @see UCharIteratorOrigin
0139  * @see UCharIterator
0140  * @see UITER_UNKNOWN_INDEX
0141  * @stable ICU 2.1
0142  */
0143 typedef int32_t U_CALLCONV
0144 UCharIteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin);
0145 
0146 /**
0147  * Function type declaration for UCharIterator.hasNext().
0148  *
0149  * Check if current() and next() can still
0150  * return another code unit.
0151  *
0152  * @param iter the UCharIterator structure ("this pointer")
0153  * @return boolean value for whether current() and next() can still return another code unit
0154  *
0155  * @see UCharIterator
0156  * @stable ICU 2.1
0157  */
0158 typedef UBool U_CALLCONV
0159 UCharIteratorHasNext(UCharIterator *iter);
0160 
0161 /**
0162  * Function type declaration for UCharIterator.hasPrevious().
0163  *
0164  * Check if previous() can still return another code unit.
0165  *
0166  * @param iter the UCharIterator structure ("this pointer")
0167  * @return boolean value for whether previous() can still return another code unit
0168  *
0169  * @see UCharIterator
0170  * @stable ICU 2.1
0171  */
0172 typedef UBool U_CALLCONV
0173 UCharIteratorHasPrevious(UCharIterator *iter);
0174  
0175 /**
0176  * Function type declaration for UCharIterator.current().
0177  *
0178  * Return the code unit at the current position,
0179  * or U_SENTINEL if there is none (index is at the limit).
0180  *
0181  * @param iter the UCharIterator structure ("this pointer")
0182  * @return the current code unit
0183  *
0184  * @see UCharIterator
0185  * @stable ICU 2.1
0186  */
0187 typedef UChar32 U_CALLCONV
0188 UCharIteratorCurrent(UCharIterator *iter);
0189 
0190 /**
0191  * Function type declaration for UCharIterator.next().
0192  *
0193  * Return the code unit at the current index and increment
0194  * the index (post-increment, like s[i++]),
0195  * or return U_SENTINEL if there is none (index is at the limit).
0196  *
0197  * @param iter the UCharIterator structure ("this pointer")
0198  * @return the current code unit (and post-increment the current index)
0199  *
0200  * @see UCharIterator
0201  * @stable ICU 2.1
0202  */
0203 typedef UChar32 U_CALLCONV
0204 UCharIteratorNext(UCharIterator *iter);
0205 
0206 /**
0207  * Function type declaration for UCharIterator.previous().
0208  *
0209  * Decrement the index and return the code unit from there
0210  * (pre-decrement, like s[--i]),
0211  * or return U_SENTINEL if there is none (index is at the start).
0212  *
0213  * @param iter the UCharIterator structure ("this pointer")
0214  * @return the previous code unit (after pre-decrementing the current index)
0215  *
0216  * @see UCharIterator
0217  * @stable ICU 2.1
0218  */
0219 typedef UChar32 U_CALLCONV
0220 UCharIteratorPrevious(UCharIterator *iter);
0221 
0222 /**
0223  * Function type declaration for UCharIterator.reservedFn().
0224  * Reserved for future use.
0225  *
0226  * @param iter the UCharIterator structure ("this pointer")
0227  * @param something some integer argument
0228  * @return some integer
0229  *
0230  * @see UCharIterator
0231  * @stable ICU 2.1
0232  */
0233 typedef int32_t U_CALLCONV
0234 UCharIteratorReserved(UCharIterator *iter, int32_t something);
0235 
0236 /**
0237  * Function type declaration for UCharIterator.getState().
0238  *
0239  * Get the "state" of the iterator in the form of a single 32-bit word.
0240  * It is recommended that the state value be calculated to be as small as
0241  * is feasible. For strings with limited lengths, fewer than 32 bits may
0242  * be sufficient.
0243  *
0244  * This is used together with setState()/UCharIteratorSetState
0245  * to save and restore the iterator position more efficiently than with
0246  * getIndex()/move().
0247  *
0248  * The iterator state is defined as a uint32_t value because it is designed
0249  * for use in ucol_nextSortKeyPart() which provides 32 bits to store the state
0250  * of the character iterator.
0251  *
0252  * With some UCharIterator implementations (e.g., UTF-8),
0253  * getting and setting the UTF-16 index with existing functions
0254  * (getIndex(UITER_CURRENT) followed by move(pos, UITER_ZERO)) is possible but
0255  * relatively slow because the iterator has to "walk" from a known index
0256  * to the requested one.
0257  * This takes more time the farther it needs to go.
0258  *
0259  * An opaque state value allows an iterator implementation to provide
0260  * an internal index (UTF-8: the source byte array index) for
0261  * fast, constant-time restoration.
0262  *
0263  * After calling setState(), a getIndex(UITER_CURRENT) may be slow because
0264  * the UTF-16 index may not be restored as well, but the iterator can deliver
0265  * the correct text contents and move relative to the current position
0266  * without performance degradation.
0267  *
0268  * Some UCharIterator implementations may not be able to return
0269  * a valid state for each position, in which case they return UITER_NO_STATE instead.
0270  * This will be clearly documented for each such iterator (none of the public ones here).
0271  *
0272  * @param iter the UCharIterator structure ("this pointer")
0273  * @return the state word
0274  *
0275  * @see UCharIterator
0276  * @see UCharIteratorSetState
0277  * @see UITER_NO_STATE
0278  * @stable ICU 2.6
0279  */
0280 typedef uint32_t U_CALLCONV
0281 UCharIteratorGetState(const UCharIterator *iter);
0282 
0283 /**
0284  * Function type declaration for UCharIterator.setState().
0285  *
0286  * Restore the "state" of the iterator using a state word from a getState() call.
0287  * The iterator object need not be the same one as for which getState() was called,
0288  * but it must be of the same type (set up using the same uiter_setXYZ function)
0289  * and it must iterate over the same string
0290  * (binary identical regardless of memory address).
0291  * For more about the state word see UCharIteratorGetState.
0292  *
0293  * After calling setState(), a getIndex(UITER_CURRENT) may be slow because
0294  * the UTF-16 index may not be restored as well, but the iterator can deliver
0295  * the correct text contents and move relative to the current position
0296  * without performance degradation.
0297  *
0298  * @param iter the UCharIterator structure ("this pointer")
0299  * @param state the state word from a getState() call
0300  *              on a same-type, same-string iterator
0301  * @param pErrorCode Must be a valid pointer to an error code value,
0302  *                   which must not indicate a failure before the function call.
0303  *
0304  * @see UCharIterator
0305  * @see UCharIteratorGetState
0306  * @stable ICU 2.6
0307  */
0308 typedef void U_CALLCONV
0309 UCharIteratorSetState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode);
0310 
0311 
0312 /**
0313  * C API for code unit iteration.
0314  * This can be used as a C wrapper around
0315  * CharacterIterator, Replaceable, or implemented using simple strings, etc.
0316  *
0317  * There are two roles for using UCharIterator:
0318  *
0319  * A "provider" sets the necessary function pointers and controls the "protected"
0320  * fields of the UCharIterator structure. A "provider" passes a UCharIterator
0321  * into C APIs that need a UCharIterator as an abstract, flexible string interface.
0322  *
0323  * Implementations of such C APIs are "callers" of UCharIterator functions;
0324  * they only use the "public" function pointers and never access the "protected"
0325  * fields directly.
0326  *
0327  * The current() and next() functions only check the current index against the
0328  * limit, and previous() only checks the current index against the start,
0329  * to see if the iterator already reached the end of the iteration range.
0330  *
0331  * The assumption - in all iterators - is that the index is moved via the API,
0332  * which means it won't go out of bounds, or the index is modified by
0333  * user code that knows enough about the iterator implementation to set valid
0334  * index values.
0335  *
0336  * UCharIterator functions return code unit values 0..0xffff,
0337  * or U_SENTINEL if the iteration bounds are reached.
0338  *
0339  * @stable ICU 2.1
0340  */
0341 struct UCharIterator {
0342     /**
0343      * (protected) Pointer to string or wrapped object or similar.
0344      * Not used by caller.
0345      * @stable ICU 2.1
0346      */
0347     const void *context;
0348 
0349     /**
0350      * (protected) Length of string or similar.
0351      * Not used by caller.
0352      * @stable ICU 2.1
0353      */
0354     int32_t length;
0355 
0356     /**
0357      * (protected) Start index or similar.
0358      * Not used by caller.
0359      * @stable ICU 2.1
0360      */
0361     int32_t start;
0362 
0363     /**
0364      * (protected) Current index or similar.
0365      * Not used by caller.
0366      * @stable ICU 2.1
0367      */
0368     int32_t index;
0369 
0370     /**
0371      * (protected) Limit index or similar.
0372      * Not used by caller.
0373      * @stable ICU 2.1
0374      */
0375     int32_t limit;
0376 
0377     /**
0378      * (protected) Used by UTF-8 iterators and possibly others.
0379      * @stable ICU 2.1
0380      */
0381     int32_t reservedField;
0382 
0383     /**
0384      * (public) Returns the current position or the
0385      * start or limit index of the iteration range.
0386      *
0387      * @see UCharIteratorGetIndex
0388      * @stable ICU 2.1
0389      */
0390     UCharIteratorGetIndex *getIndex;
0391 
0392     /**
0393      * (public) Moves the current position relative to the start or limit of the
0394      * iteration range, or relative to the current position itself.
0395      * The movement is expressed in numbers of code units forward
0396      * or backward by specifying a positive or negative delta.
0397      *
0398      * @see UCharIteratorMove
0399      * @stable ICU 2.1
0400      */
0401     UCharIteratorMove *move;
0402 
0403     /**
0404      * (public) Check if current() and next() can still
0405      * return another code unit.
0406      *
0407      * @see UCharIteratorHasNext
0408      * @stable ICU 2.1
0409      */
0410     UCharIteratorHasNext *hasNext;
0411 
0412     /**
0413      * (public) Check if previous() can still return another code unit.
0414      *
0415      * @see UCharIteratorHasPrevious
0416      * @stable ICU 2.1
0417      */
0418     UCharIteratorHasPrevious *hasPrevious;
0419 
0420     /**
0421      * (public) Return the code unit at the current position,
0422      * or U_SENTINEL if there is none (index is at the limit).
0423      *
0424      * @see UCharIteratorCurrent
0425      * @stable ICU 2.1
0426      */
0427     UCharIteratorCurrent *current;
0428 
0429     /**
0430      * (public) Return the code unit at the current index and increment
0431      * the index (post-increment, like s[i++]),
0432      * or return U_SENTINEL if there is none (index is at the limit).
0433      *
0434      * @see UCharIteratorNext
0435      * @stable ICU 2.1
0436      */
0437     UCharIteratorNext *next;
0438 
0439     /**
0440      * (public) Decrement the index and return the code unit from there
0441      * (pre-decrement, like s[--i]),
0442      * or return U_SENTINEL if there is none (index is at the start).
0443      *
0444      * @see UCharIteratorPrevious
0445      * @stable ICU 2.1
0446      */
0447     UCharIteratorPrevious *previous;
0448 
0449     /**
0450      * (public) Reserved for future use. Currently NULL.
0451      *
0452      * @see UCharIteratorReserved
0453      * @stable ICU 2.1
0454      */
0455     UCharIteratorReserved *reservedFn;
0456 
0457     /**
0458      * (public) Return the state of the iterator, to be restored later with setState().
0459      * This function pointer is NULL if the iterator does not implement it.
0460      *
0461      * @see UCharIteratorGet
0462      * @stable ICU 2.6
0463      */
0464     UCharIteratorGetState *getState;
0465 
0466     /**
0467      * (public) Restore the iterator state from the state word from a call
0468      * to getState().
0469      * This function pointer is NULL if the iterator does not implement it.
0470      *
0471      * @see UCharIteratorSet
0472      * @stable ICU 2.6
0473      */
0474     UCharIteratorSetState *setState;
0475 };
0476 
0477 /**
0478  * Helper function for UCharIterator to get the code point
0479  * at the current index.
0480  *
0481  * Return the code point that includes the code unit at the current position,
0482  * or U_SENTINEL if there is none (index is at the limit).
0483  * If the current code unit is a lead or trail surrogate,
0484  * then the following or preceding surrogate is used to form
0485  * the code point value.
0486  *
0487  * @param iter the UCharIterator structure ("this pointer")
0488  * @return the current code point
0489  *
0490  * @see UCharIterator
0491  * @see U16_GET
0492  * @see UnicodeString::char32At()
0493  * @stable ICU 2.1
0494  */
0495 U_CAPI UChar32 U_EXPORT2
0496 uiter_current32(UCharIterator *iter);
0497 
0498 /**
0499  * Helper function for UCharIterator to get the next code point.
0500  *
0501  * Return the code point at the current index and increment
0502  * the index (post-increment, like s[i++]),
0503  * or return U_SENTINEL if there is none (index is at the limit).
0504  *
0505  * @param iter the UCharIterator structure ("this pointer")
0506  * @return the current code point (and post-increment the current index)
0507  *
0508  * @see UCharIterator
0509  * @see U16_NEXT
0510  * @stable ICU 2.1
0511  */
0512 U_CAPI UChar32 U_EXPORT2
0513 uiter_next32(UCharIterator *iter);
0514 
0515 /**
0516  * Helper function for UCharIterator to get the previous code point.
0517  *
0518  * Decrement the index and return the code point from there
0519  * (pre-decrement, like s[--i]),
0520  * or return U_SENTINEL if there is none (index is at the start).
0521  *
0522  * @param iter the UCharIterator structure ("this pointer")
0523  * @return the previous code point (after pre-decrementing the current index)
0524  *
0525  * @see UCharIterator
0526  * @see U16_PREV
0527  * @stable ICU 2.1
0528  */
0529 U_CAPI UChar32 U_EXPORT2
0530 uiter_previous32(UCharIterator *iter);
0531 
0532 /**
0533  * Get the "state" of the iterator in the form of a single 32-bit word.
0534  * This is a convenience function that calls iter->getState(iter)
0535  * if iter->getState is not NULL;
0536  * if it is NULL or any other error occurs, then UITER_NO_STATE is returned.
0537  *
0538  * Some UCharIterator implementations may not be able to return
0539  * a valid state for each position, in which case they return UITER_NO_STATE instead.
0540  * This will be clearly documented for each such iterator (none of the public ones here).
0541  *
0542  * @param iter the UCharIterator structure ("this pointer")
0543  * @return the state word
0544  *
0545  * @see UCharIterator
0546  * @see UCharIteratorGetState
0547  * @see UITER_NO_STATE
0548  * @stable ICU 2.6
0549  */
0550 U_CAPI uint32_t U_EXPORT2
0551 uiter_getState(const UCharIterator *iter);
0552 
0553 /**
0554  * Restore the "state" of the iterator using a state word from a getState() call.
0555  * This is a convenience function that calls iter->setState(iter, state, pErrorCode)
0556  * if iter->setState is not NULL; if it is NULL, then U_UNSUPPORTED_ERROR is set.
0557  *
0558  * @param iter the UCharIterator structure ("this pointer")
0559  * @param state the state word from a getState() call
0560  *              on a same-type, same-string iterator
0561  * @param pErrorCode Must be a valid pointer to an error code value,
0562  *                   which must not indicate a failure before the function call.
0563  *
0564  * @see UCharIterator
0565  * @see UCharIteratorSetState
0566  * @stable ICU 2.6
0567  */
0568 U_CAPI void U_EXPORT2
0569 uiter_setState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode);
0570 
0571 /**
0572  * Set up a UCharIterator to iterate over a string.
0573  *
0574  * Sets the UCharIterator function pointers for iteration over the string s
0575  * with iteration boundaries start=index=0 and length=limit=string length.
0576  * The "provider" may set the start, index, and limit values at any time
0577  * within the range 0..length.
0578  * The length field will be ignored.
0579  *
0580  * The string pointer s is set into UCharIterator.context without copying
0581  * or reallocating the string contents.
0582  *
0583  * getState() simply returns the current index.
0584  * move() will always return the final index.
0585  *
0586  * @param iter UCharIterator structure to be set for iteration
0587  * @param s String to iterate over
0588  * @param length Length of s, or -1 if NUL-terminated
0589  *
0590  * @see UCharIterator
0591  * @stable ICU 2.1
0592  */
0593 U_CAPI void U_EXPORT2
0594 uiter_setString(UCharIterator *iter, const UChar *s, int32_t length);
0595 
0596 /**
0597  * Set up a UCharIterator to iterate over a UTF-16BE string
0598  * (byte vector with a big-endian pair of bytes per UChar).
0599  *
0600  * Everything works just like with a normal UChar iterator (uiter_setString),
0601  * except that UChars are assembled from byte pairs,
0602  * and that the length argument here indicates an even number of bytes.
0603  *
0604  * getState() simply returns the current index.
0605  * move() will always return the final index.
0606  *
0607  * @param iter UCharIterator structure to be set for iteration
0608  * @param s UTF-16BE string to iterate over
0609  * @param length Length of s as an even number of bytes, or -1 if NUL-terminated
0610  *               (NUL means pair of 0 bytes at even index from s)
0611  *
0612  * @see UCharIterator
0613  * @see uiter_setString
0614  * @stable ICU 2.6
0615  */
0616 U_CAPI void U_EXPORT2
0617 uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length);
0618 
0619 /**
0620  * Set up a UCharIterator to iterate over a UTF-8 string.
0621  *
0622  * Sets the UCharIterator function pointers for iteration over the UTF-8 string s
0623  * with UTF-8 iteration boundaries 0 and length.
0624  * The implementation counts the UTF-16 index on the fly and
0625  * lazily evaluates the UTF-16 length of the text.
0626  *
0627  * The start field is used as the UTF-8 offset, the limit field as the UTF-8 length.
0628  * When the reservedField is not 0, then it contains a supplementary code point
0629  * and the UTF-16 index is between the two corresponding surrogates.
0630  * At that point, the UTF-8 index is behind that code point.
0631  *
0632  * The UTF-8 string pointer s is set into UCharIterator.context without copying
0633  * or reallocating the string contents.
0634  *
0635  * getState() returns a state value consisting of
0636  * - the current UTF-8 source byte index (bits 31..1)
0637  * - a flag (bit 0) that indicates whether the UChar position is in the middle
0638  *   of a surrogate pair
0639  *   (from a 4-byte UTF-8 sequence for the corresponding supplementary code point)
0640  *
0641  * getState() cannot also encode the UTF-16 index in the state value.
0642  * move(relative to limit or length), or
0643  * move(relative to current) after setState(), may return UITER_UNKNOWN_INDEX.
0644  *
0645  * @param iter UCharIterator structure to be set for iteration
0646  * @param s UTF-8 string to iterate over
0647  * @param length Length of s in bytes, or -1 if NUL-terminated
0648  *
0649  * @see UCharIterator
0650  * @stable ICU 2.6
0651  */
0652 U_CAPI void U_EXPORT2
0653 uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length);
0654 
0655 #if U_SHOW_CPLUSPLUS_API
0656 
0657 /**
0658  * Set up a UCharIterator to wrap around a C++ CharacterIterator.
0659  *
0660  * Sets the UCharIterator function pointers for iteration using the
0661  * CharacterIterator charIter.
0662  *
0663  * The CharacterIterator pointer charIter is set into UCharIterator.context
0664  * without copying or cloning the CharacterIterator object.
0665  * The other "protected" UCharIterator fields are set to 0 and will be ignored.
0666  * The iteration index and boundaries are controlled by the CharacterIterator.
0667  *
0668  * getState() simply returns the current index.
0669  * move() will always return the final index.
0670  *
0671  * @param iter UCharIterator structure to be set for iteration
0672  * @param charIter CharacterIterator to wrap
0673  *
0674  * @see UCharIterator
0675  * @stable ICU 2.1
0676  */
0677 U_CAPI void U_EXPORT2
0678 uiter_setCharacterIterator(UCharIterator *iter, icu::CharacterIterator *charIter);
0679 
0680 /**
0681  * Set up a UCharIterator to iterate over a C++ Replaceable.
0682  *
0683  * Sets the UCharIterator function pointers for iteration over the
0684  * Replaceable rep with iteration boundaries start=index=0 and
0685  * length=limit=rep->length().
0686  * The "provider" may set the start, index, and limit values at any time
0687  * within the range 0..length=rep->length().
0688  * The length field will be ignored.
0689  *
0690  * The Replaceable pointer rep is set into UCharIterator.context without copying
0691  * or cloning/reallocating the Replaceable object.
0692  *
0693  * getState() simply returns the current index.
0694  * move() will always return the final index.
0695  *
0696  * @param iter UCharIterator structure to be set for iteration
0697  * @param rep Replaceable to iterate over
0698  *
0699  * @see UCharIterator
0700  * @stable ICU 2.1
0701  */
0702 U_CAPI void U_EXPORT2
0703 uiter_setReplaceable(UCharIterator *iter, const icu::Replaceable *rep);
0704 
0705 #endif
0706 
0707 U_CDECL_END
0708 
0709 #endif