Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

UDateFormat Class Reference

Inheritance diagram for UDateFormat:

ICU List of all members.

Public Types

typedef UCalendar UDate UDate
typedef void * UFieldPos
enum  Style {
  Full, Long, Medium, Short,
  Default = Medium, None = -1, Ignore = -2
}
enum  Field {
  EraField = 0, YearField = 1, MonthField = 2, DateField = 3,
  HourOfDay1Field = 4, HourOfDay0Field = 5, MinuteField = 6, SecondField = 7,
  FractionalSecondField = 8, DayOfWeekField = 9, DayOfYearField = 10, DayOfWeekInMonthField = 11,
  WeekOfYearField = 12, WeekOfMonthField = 13, AmPmField = 14, Hour1Field = 15,
  Hour0Field = 16, TimezoneField = 17, YearWoyField = 18, DowLocalField = 19,
  ExtendedYearField = 20, JulianDayField = 21, MillisecondsInDayField = 22, TimezoneRfcField = 23,
  FieldCount = 24
}

Public Member Functions

 this (Style time, Style date, inout ULocale locale, inout UTimeZone tz, UText pattern)
 ~this ()
void format (UString dst, UDate date, UFieldPos p=null)
UDate parse (UText src, uint *index=null)
void setCalendar (UCalendar c)
UCalendar getCalendar ()
void setNumberFormat (UNumberFormat n)
UDate getTwoDigitYearStart ()
void setTwoDigitYearStart (UDate start)
void getPattern (UString dst, bool localize)
void setPattern (UText pattern, bool localized)
void setLenient (bool yes)
bool isLenient ()

Private Types

enum  Symbol {
  Eras, Months, ShortMonths, Weekdays,
  ShortWeekdays, AmPms, LocalizedChars
}
typedef void * Handle
enum  Error { OK, BufferOverflow = 15 }

Static Private Member Functions

bool isError (Error e)
void testError (Error e, char[] msg)
char * toString (char[] string)
wchar * toString (wchar[] string)
uint length (char *s)
uint length (wchar *s)
char[] toArray (char *s)
wchar[] toArray (wchar *s)

Private Attributes

Handle handle

Detailed Description

UDateFormat consists of functions that convert dates and times from their internal representations to textual form and back again in a language-independent manner. Converting from the internal representation (milliseconds since midnight, January 1, 1970) to text is known as "formatting," and converting from text to millis is known as "parsing." We currently define one concrete structure UDateFormat, which can handle pretty much all normal date formatting and parsing actions.

UDateFormat helps you to format and parse dates for any locale. Your code can be completely independent of the locale conventions for months, days of the week, or even the calendar format: lunar vs. solar.

See this page for full details.

Definition at line 110 of file UDateFormat.d.


Member Typedef Documentation

typedef UCalendar UDate UDate
 

Definition at line 114 of file UDateFormat.d.

typedef void* UFieldPos
 

Definition at line 116 of file UDateFormat.d.

Referenced by format().

typedef void* Handle [protected, inherited]
 

Use this for the primary argument-type to most ICU functions

Definition at line 109 of file ICU.d.


Member Enumeration Documentation

enum Style
 

Enumeration values:
Full 
Long 
Medium 
Short 
Default 
None 
Ignore 

Definition at line 118 of file UDateFormat.d.

enum Field
 

Enumeration values:
EraField 
YearField 
MonthField 
DateField 
HourOfDay1Field 
HourOfDay0Field 
MinuteField 
SecondField 
FractionalSecondField 
DayOfWeekField 
DayOfYearField 
DayOfWeekInMonthField 
WeekOfYearField 
WeekOfMonthField 
AmPmField 
Hour1Field 
Hour0Field 
TimezoneField 
YearWoyField 
DowLocalField 
ExtendedYearField 
JulianDayField 
MillisecondsInDayField 
TimezoneRfcField 
FieldCount 

Definition at line 129 of file UDateFormat.d.

enum Symbol [private]
 

Enumeration values:
Eras 
Months 
ShortMonths 
Weekdays 
ShortWeekdays 
AmPms 
LocalizedChars 

Definition at line 158 of file UDateFormat.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 117 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Close a UDateFormat

Definition at line 191 of file UDateFormat.d.


Member Function Documentation

this Style  time,
Style  date,
inout ULocale  locale,
inout UTimeZone  tz,
UText  pattern
[inline]
 

Open a new UDateFormat for formatting and parsing dates and time.

Definition at line 177 of file UDateFormat.d.

References date, ICU::testError(), time, and ICU::toString().

void format UString  dst,
UDate  date,
UFieldPos  p = null
[inline]
 

Format a date using an UDateFormat

Definition at line 202 of file UDateFormat.d.

References date, UString::format(), and UFieldPos.

UDate parse UText  src,
uint *  index = null
[inline]
 

Parse a string into an date/time using a UDateFormat

Definition at line 218 of file UDateFormat.d.

References UText::content, UText::len, and ICU::testError().

void setCalendar UCalendar  c  )  [inline]
 

Set the UCalendar associated with an UDateFormat. A UDateFormat uses a UCalendar to convert a raw value to, for example, the day of the week.

Definition at line 235 of file UDateFormat.d.

References UCalendar::handle.

UCalendar getCalendar  )  [inline]
 

Get the UCalendar associated with this UDateFormat

Definition at line 246 of file UDateFormat.d.

References UCalendar.

void setNumberFormat UNumberFormat  n  )  [inline]
 

Set the UNumberFormat associated with an UDateFormat.A UDateFormat uses a UNumberFormat to format numbers within a date, for example the day number.

Definition at line 260 of file UDateFormat.d.

References UNumberFormat::handle.

UDate getTwoDigitYearStart  )  [inline]
 

Get the year relative to which all 2-digit years are interpreted

Definition at line 272 of file UDateFormat.d.

References ICU::testError().

void setTwoDigitYearStart UDate  start  )  [inline]
 

Set the year relative to which all 2-digit years are interpreted

Definition at line 288 of file UDateFormat.d.

References ICU::testError().

void getPattern UString  dst,
bool  localize
[inline]
 

Extract the pattern from a UDateFormat

Definition at line 302 of file UDateFormat.d.

References UString::format().

void setPattern UText  pattern,
bool  localized
[inline]
 

Set the pattern for a UDateFormat

Definition at line 318 of file UDateFormat.d.

References UText::get(), and UText::length().

void setLenient bool  yes  )  [inline]
 

Specify whether an UDateFormat will perform lenient parsing.

Definition at line 329 of file UDateFormat.d.

bool isLenient  )  [inline]
 

Determine if an UDateFormat will perform lenient parsing.

Definition at line 340 of file UDateFormat.d.

bool isError Error  e  )  [inline, static, protected, inherited]
 

Definition at line 127 of file ICU.d.

Referenced by UConverter::detectSignature(), UString::format(), and UConverter::this().

void testError Error  e,
char[]  msg
[inline, static, protected, inherited]
 

Definition at line 145 of file ICU.d.

Referenced by UCalendar::add(), UText::compareFolded(), UConverter::decode(), UConverter::encode(), UResourceBundle::get(), UCalendar::get(), UResourceBundle::getBinary(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), UCalendar::getLimit(), UResourceBundle::getLocale(), UCalendar::getMillis(), UConverter::getName(), UResourceBundle::getNextString(), UResourceBundle::getString(), getTwoDigitYearStart(), UCalendar::inDaylightTime(), parse(), UCalendar::roll(), UCalendar::setDate(), UCalendar::setDateTime(), UCalendar::setMillis(), UDecimalFormat::setPattern(), UMessageFormat::setPattern(), UCalendar::setTimeZone(), setTwoDigitYearStart(), UResourceBundle::this(), UNumberFormat::this(), UMessageFormat::this(), this(), and UCalendar::this().

char* toString char[]  string  )  [inline, static, protected, inherited]
 

Definition at line 155 of file ICU.d.

Referenced by UConverter::compareNames(), UResourceBundle::getResource(), UResourceBundle::getString(), UCalendar::getTimeZoneName(), UMessageFormat::setLocale(), UResourceBundle::this(), UMessageFormat::this(), this(), UText::toLower(), ICU::toString(), and UText::toUpper().

wchar* toString wchar[]  string  )  [inline, static, protected, inherited]
 

Definition at line 175 of file ICU.d.

References ICU::toString().

uint length char *  s  )  [inline, static, protected, inherited]
 

Definition at line 184 of file ICU.d.

References strlen().

uint length wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 193 of file ICU.d.

References wcslen().

char [] toArray char *  s  )  [inline, static, protected, inherited]
 

Definition at line 202 of file ICU.d.

References strlen().

Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), and UConverter::getName().

wchar [] toArray wchar *  s  )  [inline, static, protected, inherited]
 

Definition at line 213 of file ICU.d.

References wcslen().


Member Data Documentation

Handle handle [private]
 

Definition at line 112 of file UDateFormat.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:13 2004 for Mango by doxygen 1.3.6