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

MessageFormat::MessageFormat ( const UnicodeString pattern,
const Locale newLocale,
UErrorCode status 
)

Constructs a new MessageFormat using the given pattern and locale.

Parameters:
pattern Pattern used to construct object.
newLocale The locale to use for formatting dates and numbers.
status Input/output error code. If the pattern cannot be parsed, set to failure code. ICU 2.0

Definition at line 294 of file msgfmt.cpp.

References allocateArgTypes(), allocateSubformats(), applyPattern(), Locale::getName(), MessageFormat(), Format::setLocaleIDs(), and U_MEMORY_ALLOCATION_ERROR.

: fLocale(newLocale),
  formatAliases(NULL),
  formatAliasesCapacity(0),
  idStart(UCHAR_ID_START),
  idContinue(UCHAR_ID_CONTINUE),
  subformats(NULL),
  subformatCount(0),
  subformatCapacity(0),
  argTypes(NULL),
  argTypeCount(0),
  argTypeCapacity(0),
  isArgNumeric(TRUE),
  defaultNumberFormat(NULL),
  defaultDateFormat(NULL)
{
    if (!allocateSubformats(DEFAULT_INITIAL_CAPACITY) ||
        !allocateArgTypes(DEFAULT_INITIAL_CAPACITY)) {
        success = U_MEMORY_ALLOCATION_ERROR;
        return;
    }
    applyPattern(pattern, success);
    setLocaleIDs(fLocale.getName(), fLocale.getName());
}


Generated by  Doxygen 1.6.0   Back to index