Type: info
         Title: rtl::OUString::iterateCodePoints
     Posted by: [EMAIL PROTECTED]
      Affected: [EMAIL PROTECTED],
Effective from: SRC680 CWS i18n31


*Summary*
--------
rtl/ustring.h:
+ sal_uInt32 SAL_CALL rtl_uString_iterateCodePoints(rtl_uString const * string, 
sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints)

rtl/ustring.hxx:
+ sal_uInt32 rtl::OUString::iterateCodePoints(sal_Int32 * indexUtf16, sal_Int32 
incrementCodePoints = 1)

*Description*
-------------
Iterate through a string based on code points instead of UTF-16 code
units.

See Chapter 3 of The Unicode Standard 5.0 (Addison--Wesley, 2006) for
definitions of the various terms used in this description.

The given string is interpreted as a sequence of zero or more UTF-16
code units.  For each index into this sequence (from zero to one less
than the length of the sequence, inclusive), a code point represented
starting at the given index is computed as follows:

- If the UTF-16 code unit addressed by the index constitutes a
well-formed UTF-16 code unit sequence, the computed code point is the
scalar value encoded by that UTF-16 code unit sequence.

- Otherwise, if the index is at least two UTF-16 code units away from
the end of the sequence, and the sequence of two UTF-16 code units
addressed by the index constitutes a well-formed UTF-16 code unit
sequence, the computed code point is the scalar value encoded by that
UTF-16 code unit sequence.

- Otherwise, the computed code point is the UTF-16 code unit addressed
by the index.  (This last case catches unmatched surrogates as well as
indices pointing into the middle of surrogate pairs.)

@param string
pointer to a valid string; must not be null.

@param indexUtf16
pointer to a UTF-16 based index into the given string; must not be
null.  On entry, the index must be in the range from zero to the
length of the string (in UTF-16 code units), inclusive.  Upon
successful return, the index will be updated to address the UTF-16
code unit that is the given incrementCodePoints away from the initial
index.

@param incrementCodePoints
the number of code points to move the given *indexUtf16.  If
non-negative, moving is done after determining the code point at the
index.  If negative, moving is done before determining the code point
at the (then updated) index.  The value must be such that the
resulting UTF-16 based index is in the range from zero to the length
of the string (in UTF-16 code units), inclusive.

@return
the code point (an integer in the range from 0 to 0x10FFFF, inclusive)
that is represented within the string starting at the index computed
as follows:  If incrementCodePoints is non-negative, the index is the
initial value of *indexUtf16; if incrementCodePoints is negative, the
index is the updated value of *indexUtf16.  In either case, the
computed index must be in the range from zero to one less than the
length of the string (in UTF-16 code units), inclusive.

@since UDK 3.2.7


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to