Logo Search packages:      
Sourcecode: icu version File versions  Download package

#define U16_NEXT ( s,
i,
length,
 ) 

Value:

{ \
    (c)=(s)[(i)++]; \
    if(U16_IS_LEAD(c)) { \
        uint16_t __c2; \
        if((i)<(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \
            ++(i); \
            (c)=U16_GET_SUPPLEMENTARY((c), __c2); \
        } \
    } \
}
Get a code point from a string at a code point boundary offset, and advance the offset to the next code point boundary. (Post-incrementing forward iteration.) "Safe" macro, handles unpaired surrogates and checks for string boundaries.

The offset may point to the lead surrogate unit for a supplementary code point, in which case the macro will read the following trail surrogate as well. If the offset points to a trail surrogate or to a single, unpaired lead surrogate, then that itself will be returned as the code point.

Parameters:
s const UChar * string
i string offset, must be i<length
length string length
c output UChar32 variable
See also:
U16_NEXT_UNSAFE ICU 2.4

Definition at line 261 of file utf16.h.

Referenced by UnicodeSet::_toPattern(), CanonicalIterator::extract(), SpoofImpl::scriptScan(), UnicodeSet::span(), UnicodeString::trim(), u_hasBinaryProperty(), ucnv_getNextUChar(), ucol_getUnsafeSet(), uspoof_check(), uspoof_getSkeleton(), and usprep_prepare().


Generated by  Doxygen 1.6.0   Back to index