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

UChar32 UnicodeString::char32At ( int32_t  offset) const [inline]

Return the code point that contains the code unit at offset offset. If the offset is not valid (0..length()-1) then U+ffff is returned.

Parameters:
offseta valid offset into the text that indicates the text offset of any of the code units that will be assembled into a code point (21-bit value) and returned
Returns:
the code point of text at offset or 0xffff if the offset is not valid for this string ICU 2.0

Reimplemented from Replaceable.

Definition at line 4157 of file unistr.h.

References Replaceable::length(), and U16_GET.

Referenced by UnicodeSet::_appendToPat(), RuleCharacterIterator::_current(), UnicodeSet::addAll(), StringMatcher::addMatchSetTo(), StringReplacer::addReplacementSetTo(), TransliterationRule::addSourceSetTo(), DecimalFormat::appendAffixPattern(), DecimalFormat::compareComplexAffix(), SimpleDateFormat::compareSimpleAffix(), DecimalFormat::compareSimpleAffix(), Normalizer::current(), DecimalFormat::expandAffix(), TestReplaceable::getChar32At(), getChar32At(), TransliterationRule::getIndexValue(), UnicodeSet::getSingleCP(), BreakTransliterator::handleTransliterate(), RuleHalf::isValidInput(), RuleHalf::isValidOutput(), DecimalFormat::match(), StringMatcher::matchesIndexValue(), UnicodeSet::matchesIndexValue(), Normalizer::next(), SCharacterIterator::next32PostInc(), ICU_Utility::parseNumber(), ICU_Utility::parsePattern(), ICU_Utility::parseUnicodeIdentifier(), CanonicalIterator::permute(), Normalizer::previous(), StringReplacer::replace(), StringReplacer::setData(), StringMatcher::setData(), DecimalFormat::setPadCharacter(), CanonicalIterator::setSource(), DecimalFormatSymbols::setSymbol(), DecimalFormat::skipPadding(), SimpleDateFormat::skipUWhiteSpace(), DecimalFormat::skipUWhiteSpace(), DecimalFormat::subformat(), SimpleDateFormat::subParse(), DecimalFormat::subparse(), CharIterTest::TestIterationUChar32(), UnicodeStringTest::TestReverse(), UnicodeStringTest::TestStackAllocation(), and DecimalFormat::toPattern().

{
  int32_t len = length();
  if((uint32_t)offset < (uint32_t)len) {
    const UChar *array = getArrayStart();
    UChar32 c;
    U16_GET(array, 0, offset, len, c);
    return c;
  } else {
    return kInvalidUChar;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index