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

UBool UnicodeString::truncate ( int32_t  targetLength ) [inline]

Truncate this UnicodeString to the targetLength.

Parameters:
targetLengththe desired length of this UnicodeString.
Returns:
TRUE if the text was truncated, FALSE otherwise ICU 2.0

Definition at line 4347 of file unistr.h.

References FALSE, Replaceable::length(), and TRUE.

Referenced by TestChoiceFormat::_testPattern(), UnicodeSet::_toPattern(), ICU_Utility::appendToRule(), ChoiceFormat::applyPattern(), UnicodeSet::applyPattern(), TransliteratorRegistry::findInBundle(), TransliteratorRegistry::getAvailableSource(), TransliteratorRegistry::getAvailableTarget(), TransliteratorRegistry::getAvailableVariant(), Locale::getDisplayCountry(), Locale::getDisplayLanguage(), Transliterator::getDisplayName(), Locale::getDisplayName(), Locale::getDisplayScript(), Locale::getDisplayVariant(), ICUCollatorService::handleDefault(), UnicodeNameTransliterator::handleTransliterate(), NameUnicodeTransliterator::handleTransliterate(), EscapeTransliterator::handleTransliterate(), TransliteratorIDParser::IDtoSTV(), TimeZone::initDefault(), NormalizerConformanceTest::iterativeNorm(), TokenIterator::next(), RuleBasedCollator::operator=(), RuleHalf::parse(), TransliteratorIDParser::parseCompoundID(), UXMLParser::parseFile(), RuleHalf::parseSection(), ICU_Utility::parseUnicodeIdentifier(), StringReplacer::replace(), Transliterator::setID(), CompactTrieEnumeration::snext(), MutableTrieEnumeration::snext(), NumberFormatTest::TestAdoptDecimalFormatSymbols(), TestChoiceFormat::TestClosures(), UnicodeStringTest::TestCompare(), NumberFormatTest::TestCurrency(), NumberFormatTest::TestCurrencySign(), DateFormatTest::TestDateFormatCalendar(), TimeZoneTest::TestDisplayName(), TimeZoneTest::TestGetAvailableIDs913(), TransliteratorTest::TestInstantiation(), DateFormatTest::TestLocaleDateFormat(), NumberFormatTest::TestQuotes(), UnicodeStringTest::TestSpacePadding(), CalendarRegressionTest::TestTimeZoneTransitionAdd(), StringMatcher::toPattern(), Quantifier::toPattern(), UnicodeSet::toPattern(), StringReplacer::toReplacerPattern(), StringMatcher::toReplacerPattern(), FunctionReplacer::toReplacerPattern(), Transliterator::toRules(), TransliterationRuleSet::toRules(), CompoundTransliterator::toRules(), Transliterator::Transliterator(), and IntlTestNumberFormat::tryIt().

{
  if(isBogus() && targetLength == 0) {
    // truncate(0) of a bogus string makes the string empty and non-bogus
    unBogus();
    return FALSE;
  } else if((uint32_t)targetLength < (uint32_t)length()) {
    setLength(targetLength);
    return TRUE;
  } else {
    return FALSE;
  }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index