Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 ()

Static Public Member Functions

static this ()
static ~this ()

Static Public Attributes

static FunctionLoader Bind[] targets

Private Types

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

Static Private Member Functions

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

Private Attributes

Handle handle

Static Private Attributes

static void * library

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 113 of file UDateFormat.d.


Member Typedef Documentation

typedef UCalendar UDate UDate
 

Definition at line 117 of file UDateFormat.d.

typedef void* UFieldPos
 

Definition at line 119 of file UDateFormat.d.

typedef void* Handle [protected, inherited]
 

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

Definition at line 112 of file ICU.d.


Member Enumeration Documentation

enum Style
 

Enumeration values:
Full 
Long 
Medium 
Short 
Default 
None 
Ignore 

Definition at line 121 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 132 of file UDateFormat.d.

enum Symbol [private]
 

Enumeration values:
Eras 
Months 
ShortMonths 
Weekdays 
ShortWeekdays 
AmPms 
LocalizedChars 

Definition at line 161 of file UDateFormat.d.

enum Error [protected, inherited]
 

ICU error codes (the ones which are referenced)

Enumeration values:
OK 
BufferOverflow 

Definition at line 146 of file ICU.d.


Constructor & Destructor Documentation

~this  )  [inline]
 

Close a UDateFormat

Definition at line 194 of file UDateFormat.d.

References handle.

static ~this  )  [inline, static]
 

Definition at line 414 of file UDateFormat.d.

References library.


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 180 of file UDateFormat.d.

References handle, ICU::testError(), and ICU::toString().

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

Format a date using an UDateFormat

Definition at line 205 of file UDateFormat.d.

References UString::format(), and handle.

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

Parse a string into an date/time using a UDateFormat

Definition at line 221 of file UDateFormat.d.

References UText::content, handle, 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 238 of file UDateFormat.d.

References UCalendar::handle, and handle.

UCalendar getCalendar  )  [inline]
 

Get the UCalendar associated with this UDateFormat

Definition at line 249 of file UDateFormat.d.

References handle, and 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 263 of file UDateFormat.d.

References UNumberFormat::handle, and handle.

UDate getTwoDigitYearStart  )  [inline]
 

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

Definition at line 275 of file UDateFormat.d.

References handle, and ICU::testError().

void setTwoDigitYearStart UDate  start  )  [inline]
 

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

Definition at line 291 of file UDateFormat.d.

References handle, and ICU::testError().

void getPattern UString  dst,
bool  localize
[inline]
 

Extract the pattern from a UDateFormat

Definition at line 305 of file UDateFormat.d.

References UString::format(), and handle.

void setPattern UText  pattern,
bool  localized
[inline]
 

Set the pattern for a UDateFormat

Definition at line 321 of file UDateFormat.d.

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

void setLenient bool  yes  )  [inline]
 

Specify whether an UDateFormat will perform lenient parsing.

Definition at line 332 of file UDateFormat.d.

References handle.

bool isLenient  )  [inline]
 

Determine if an UDateFormat will perform lenient parsing.

Definition at line 343 of file UDateFormat.d.

References handle.

static this  )  [inline, static]
 

Definition at line 405 of file UDateFormat.d.

References library, and targets.

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

Definition at line 156 of file ICU.d.

Referenced by UCollator::getLocale().

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

Definition at line 174 of file ICU.d.

Referenced by UCalendar::add(), USet::applyPattern(), UChar::charFromName(), UNormalize::check(), URegex::clone(), UNormalize::compare(), UDomainName::compare(), UText::compareFolded(), UConverter::UTranscoder::convert(), UEnumeration::count(), UConverter::decode(), UConverter::encode(), URegex::end(), UTransform::execute(), USearch::first(), UResourceBundle::get(), UCalendar::get(), UCollator::getAttribute(), UResourceBundle::getBinary(), UCollator::getBound(), UChar::getCharName(), UChar::getComment(), UCollator::getContractions(), URegex::getFlags(), UResourceBundle::getInt(), UResourceBundle::getIntVector(), UCalendar::getLimit(), UResourceBundle::getLocale(), UCalendar::getMillis(), UConverter::getName(), UResourceBundle::getNextString(), URegex::getPattern(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCollator::getTailoredSet(), getTwoDigitYearStart(), UCollator::getVariableTop(), URegex::groupCount(), UCalendar::inDaylightTime(), UNormalize::isNormalized(), USearch::last(), URegex::match(), USearch::next(), URegex::next(), UEnumeration::next(), UCollator::normalizeShortDefinitionString(), parse(), USearch::previous(), URegex::probe(), URegex::replaceAll(), URegex::replaceFirst(), URegex::reset(), UEnumeration::reset(), UCalendar::roll(), UCollator::setAttribute(), USearch::setCollator(), UCalendar::setDate(), UCalendar::setDateTime(), UTransform::setFilter(), USearch::setIterator(), UCalendar::setMillis(), USearch::setOffset(), USearch::setPattern(), UDecimalFormat::setPattern(), UMessageFormat::setPattern(), USearch::setText(), URegex::setText(), UBreakIterator::setText(), UCalendar::setTimeZone(), setTwoDigitYearStart(), UCollator::setVariableTop(), URegex::split(), URegex::start(), UTransform::this(), UStringPrep::this(), USet::this(), USearch::this(), UResourceBundle::this(), URegex::this(), UNumberFormat::this(), UMessageFormat::this(), this(), UCollator::this(), UCalendar::this(), UBreakIterator::this(), URuleIterator::this(), and UText::toUtf8().

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

Definition at line 184 of file ICU.d.

Referenced by UChar::charFromName(), UConverter::compareNames(), UCollator::getDisplayName(), UResourceBundle::getResource(), UCollator::getShortDefinitionString(), UResourceBundle::getString(), UCalendar::getTimeZoneName(), UCollator::normalizeShortDefinitionString(), UMessageFormat::setLocale(), UStringPrep::this(), UResourceBundle::this(), this(), UCollator::this(), UBreakIterator::this(), UText::toLower(), and UText::toUpper().

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

Definition at line 206 of file ICU.d.

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

Definition at line 228 of file ICU.d.

References strlen().

Referenced by UConverter::UTranscoder::convert().

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

Definition at line 237 of file ICU.d.

References wcslen().

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

Definition at line 246 of file ICU.d.

References strlen().

Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), UCollator::getLocale(), UConverter::getName(), UChar::getPropertyName(), UChar::getPropertyValueName(), and UConverter::opApply().

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

Definition at line 257 of file ICU.d.

References wcslen().


Member Data Documentation

Handle handle [private]
 

Definition at line 115 of file UDateFormat.d.

Referenced by format(), getCalendar(), getPattern(), getTwoDigitYearStart(), isLenient(), parse(), setCalendar(), setLenient(), setNumberFormat(), setPattern(), setTwoDigitYearStart(), this(), and ~this().

void* library [static, private]
 

Bind the ICU functions from a shared library. This is complicated by the issues regarding D and DLLs on the Windows platform

Definition at line 357 of file UDateFormat.d.

Referenced by this(), and ~this().

FunctionLoader Bind [] targets [static]
 

Initial value:

 
                [
                {cast(void**) &udat_open,               "udat_open"}

Definition at line 384 of file UDateFormat.d.

Referenced by this().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:43 2005 for Mango by  doxygen 1.4.0