Logo Search packages:      
Sourcecode: icu version File versions

SimpleDateFormat::SimpleDateFormat ( const UnicodeString pattern,
const UnicodeString override,
UErrorCode status 
)

Construct a SimpleDateFormat using the given pattern, numbering system override, and the default locale. The locale is used to obtain the symbols used in formatting (e.g., the names of the months), but not to provide the pattern.

A numbering system override is a string containing either the name of a known numbering system, or a set of field and numbering system pairs that specify which fields are to be formattied with the alternate numbering system. For example, to specify that all numeric fields in the specified date or time pattern are to be rendered using Thai digits, simply specify the numbering system override as "thai". To specify that just the year portion of the date be formatted using Hebrew numbering, use the override string "y=hebrew". Numbering system overrides can be combined using a semi-colon character in the override string, such as "d=decimal;M=arabic;y=hebrew", etc.

[Note:] Not all locales support SimpleDateFormat; for full generality, use the factory methods in the DateFormat class.

Parameters:
patternthe pattern for the format.
overridethe override string.
statusOutput param set to success/failure code. ICU 4.2

Definition at line 271 of file smpdtfmt.cpp.

References fDateOverride, fLocale, fTimeOverride, initialize(), initializeCalendar(), initializeSymbols(), NULL, processOverrideString(), UnicodeString::setTo(), UnicodeString::setToBogus(), and SimpleDateFormat().

:   fPattern(pattern),
    fLocale(Locale::getDefault()),
    fSymbols(NULL),
    fTimeZoneFormat(NULL),
    fGMTFormatters(NULL),
    fNumberFormatters(NULL),
    fOverrideList(NULL)
{
    fDateOverride.setTo(override);
    fTimeOverride.setToBogus();
    initializeSymbols(fLocale, initializeCalendar(NULL,fLocale,status), status);
    initialize(fLocale, status);
    initializeDefaultCentury();

    processOverrideString(fLocale,override,kOvrStrBoth,status);

}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index