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

RuleBasedNumberFormat::RuleBasedNumberFormat ( const UnicodeString rules,
const UnicodeString localizations,
const Locale locale,
UParseError perror,
UErrorCode status 
)

Creates a RuleBasedNumberFormat that behaves according to the description passed in. The formatter uses the default locale.

The localizations data provides information about the public rule sets and their localized display names for different locales. The first element in the list is an array of the names of the public rule sets. The first element in this array is the initial default ruleset. The remaining elements in the list are arrays of localizations of the names of the public rule sets. Each of these is one longer than the initial array, with the first String being the ULocale ID, and the remaining Strings being the localizations of the rule set names, in the same order as the initial array. Arrays are NULL-terminated.

Parameters:
rules A description of the formatter's desired behavior. See the class documentation for a complete explanation of the description syntax.
localizations a list of localizations for the rule set names in the description. These will be copied by the constructor.
locale A locale that governs which characters are used for formatting values in numerals and which characters are equivalent in lenient parsing.
perror The parse error if an error was encountered.
status The status indicating whether the constructor succeeded. ICU 3.2

Definition at line 648 of file rbnf.cpp.

References RuleBasedNumberFormat().

  : ruleSets(NULL)
  , defaultRuleSet(NULL)
  , locale(alocale)
  , collator(NULL)
  , decimalFormatSymbols(NULL)
  , lenient(FALSE)
  , lenientParseRules(NULL)
  , localizations(NULL)
  , noParse(FALSE) //TODO: to be removed after #6895
{
  LocalizationInfo* locinfo = StringLocalizationInfo::create(locs, perror, status);
  init(description, locinfo, perror, status);
}


Generated by  Doxygen 1.6.0   Back to index